- java.lang.Object
-
- org.snmp4j.agent.mo.snmp.ProxyForwarderImpl
-
- All Implemented Interfaces:
ProxyForwarder
public class ProxyForwarderImpl extends Object implements ProxyForwarder
TheProxyForwarderImplclass implements a proxy forwarder instance as defined by RFC 3413. It is configured through the SNMP-PROXY-MIB and SNMP-TARGET-MIB implementations provided on construction. It sends notifications through the provided SNMP session.- Version:
- 3.0.0
- Author:
- Frank Fock
-
-
Field Summary
-
Fields inherited from interface org.snmp4j.agent.ProxyForwarder
PROXY_TYPE_ALL, PROXY_TYPE_INFORM, PROXY_TYPE_NOTIFY, PROXY_TYPE_READ, PROXY_TYPE_WRITE
-
-
Constructor Summary
Constructors Constructor Description ProxyForwarderImpl(org.snmp4j.Session session, SnmpProxyMIB proxyMIB, SnmpTargetMIB targetMIB)Creates aProxyForwarderimplementation based on a SNMP session used to send the notifications and a SNMP-PROXY-MIB and a SNMP-TARGET-MIB implementation used for its configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCounterListener(org.snmp4j.event.CounterListener l)protected voidfireIncrementCounter(org.snmp4j.event.CounterEvent event)<A extends org.snmp4j.smi.Address>
booleanforward(ProxyForwardRequest<A> request)Forwards aRequestif it matches the criteria defined by the SNMP-PROXY-MIB associated with this proxy forwarder.protected List<SnmpProxyMIB.SnmpProxyRow>getMatches(ProxyForwardRequest<?> request)protected booleanmatchParameters(ProxyForwardRequest<?> request, org.snmp4j.smi.OctetString paramIn)protected <A extends org.snmp4j.smi.Address>
booleanmultipleForward(ProxyForwardRequest<A> request)protected booleanproxyBackwardTranslation(org.snmp4j.PDU reqPDU, org.snmp4j.PDU pdu, org.snmp4j.event.ResponseEvent<?> response)protected voidproxyForwardTranslation(ProxyForwardRequest<?> request, org.snmp4j.PDU source, org.snmp4j.PDU target)Translates a source PDU into the supplied target PDU.voidremoveCounterListener(org.snmp4j.event.CounterListener l)voidsetSession(org.snmp4j.Session snmpSession)Sets the SNMP session to used by this proxy forwarder for sending SNMP messages.protected <A extends org.snmp4j.smi.Address>
org.snmp4j.event.ResponseEvent<A>singleForward(ProxyForwardRequest<A> request)
-
-
-
Constructor Detail
-
ProxyForwarderImpl
public ProxyForwarderImpl(org.snmp4j.Session session, SnmpProxyMIB proxyMIB, SnmpTargetMIB targetMIB)Creates aProxyForwarderimplementation based on a SNMP session used to send the notifications and a SNMP-PROXY-MIB and a SNMP-TARGET-MIB implementation used for its configuration.- Parameters:
session- a SNMP session.proxyMIB- aSnmpProxyMIBimplementation with the proxy configuration.targetMIB- aSnmpTargetMIBimplementation with the target configuration.
-
-
Method Detail
-
forward
public <A extends org.snmp4j.smi.Address> boolean forward(ProxyForwardRequest<A> request)
Forwards aRequestif it matches the criteria defined by the SNMP-PROXY-MIB associated with this proxy forwarder.- Specified by:
forwardin interfaceProxyForwarder- Type Parameters:
A- type of the peerAddress.- Parameters:
request- aProxyForwardRequestencapsuling the forwarding request.- Returns:
trueif the request has been forwarded,falseotherwise.
-
getMatches
protected List<SnmpProxyMIB.SnmpProxyRow> getMatches(ProxyForwardRequest<?> request)
-
matchParameters
protected boolean matchParameters(ProxyForwardRequest<?> request, org.snmp4j.smi.OctetString paramIn)
-
singleForward
protected <A extends org.snmp4j.smi.Address> org.snmp4j.event.ResponseEvent<A> singleForward(ProxyForwardRequest<A> request)
-
proxyBackwardTranslation
protected boolean proxyBackwardTranslation(org.snmp4j.PDU reqPDU, org.snmp4j.PDU pdu, org.snmp4j.event.ResponseEvent<?> response)
-
proxyForwardTranslation
protected void proxyForwardTranslation(ProxyForwardRequest<?> request, org.snmp4j.PDU source, org.snmp4j.PDU target) throws IllegalArgumentException
Translates a source PDU into the supplied target PDU. The mapping between the source PDU and the target PDU is done as defined by RFC 3584.- Parameters:
request- the proxy forwarding request.source- the source PDU instance.target- the target PDU instance. The variable bindings of the source will replace any VBs of the target instance. If the source PDU cannot be converted to the target PDUtargetis not changed. Instead an intermediate PDU is returned.- Throws:
IllegalArgumentException- ifsourcecontains an illegal notification PDU.
-
multipleForward
protected <A extends org.snmp4j.smi.Address> boolean multipleForward(ProxyForwardRequest<A> request)
-
addCounterListener
public void addCounterListener(org.snmp4j.event.CounterListener l)
-
removeCounterListener
public void removeCounterListener(org.snmp4j.event.CounterListener l)
-
fireIncrementCounter
protected void fireIncrementCounter(org.snmp4j.event.CounterEvent event)
-
setSession
public void setSession(org.snmp4j.Session snmpSession)
Sets the SNMP session to used by this proxy forwarder for sending SNMP messages.- Parameters:
snmpSession- the Snmp instance to be used to send SNMP messages.- Since:
- 1.9.1
-
-