public class ProxyForwarderImpl extends Object implements ProxyForwarder
ProxyForwarderImpl
class 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.PROXY_TYPE_ALL, PROXY_TYPE_INFORM, PROXY_TYPE_NOTIFY, PROXY_TYPE_READ, PROXY_TYPE_WRITE
Constructor and Description |
---|
ProxyForwarderImpl(org.snmp4j.Session session,
SnmpProxyMIB proxyMIB,
SnmpTargetMIB targetMIB)
Creates a
ProxyForwarder implementation 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. |
Modifier and Type | Method and Description |
---|---|
void |
addCounterListener(org.snmp4j.event.CounterListener l) |
protected void |
fireIncrementCounter(org.snmp4j.event.CounterEvent event) |
boolean |
forward(ProxyForwardRequest request)
Forwards a
Request if it matches the criteria defined by the
SNMP-PROXY-MIB associated with this proxy forwarder. |
protected List |
getMatches(ProxyForwardRequest request) |
protected boolean |
matchParameters(ProxyForwardRequest request,
org.snmp4j.smi.OctetString paramIn) |
protected boolean |
multipleForward(ProxyForwardRequest request) |
protected boolean |
proxyBackwardTranslation(org.snmp4j.PDU reqPDU,
org.snmp4j.PDU pdu,
org.snmp4j.event.ResponseEvent response) |
protected void |
proxyForwardTranslation(ProxyForwardRequest request,
org.snmp4j.PDU source,
org.snmp4j.PDU target)
Translates a source PDU into the supplied target PDU.
|
void |
removeCounterListener(org.snmp4j.event.CounterListener l) |
void |
setSession(org.snmp4j.Session snmpSession)
Sets the SNMP session to used by this proxy forwarder for sending
SNMP messages.
|
protected org.snmp4j.event.ResponseEvent |
singleForward(ProxyForwardRequest request) |
public ProxyForwarderImpl(org.snmp4j.Session session, SnmpProxyMIB proxyMIB, SnmpTargetMIB targetMIB)
ProxyForwarder
implementation 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.session
- a SNMP session.proxyMIB
- a SnmpProxyMIB
implementation with the proxy configuration.targetMIB
- a SnmpTargetMIB
implementation with the target
configuration.public boolean forward(ProxyForwardRequest request)
Request
if it matches the criteria defined by the
SNMP-PROXY-MIB associated with this proxy forwarder.forward
in interface ProxyForwarder
request
- a ProxyForwardRequest
encapsuling the forwarding request.true
if the request has been forwarded,
false
otherwise.protected List getMatches(ProxyForwardRequest request)
protected boolean matchParameters(ProxyForwardRequest request, org.snmp4j.smi.OctetString paramIn)
protected org.snmp4j.event.ResponseEvent singleForward(ProxyForwardRequest request)
protected boolean proxyBackwardTranslation(org.snmp4j.PDU reqPDU, org.snmp4j.PDU pdu, org.snmp4j.event.ResponseEvent response)
protected void proxyForwardTranslation(ProxyForwardRequest request, org.snmp4j.PDU source, org.snmp4j.PDU target) throws IllegalArgumentException
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 PDU target
is not changed.
Instead an intermediate PDU is returned.IllegalArgumentException
- if source
contains an illegal notification PDU.protected boolean multipleForward(ProxyForwardRequest request)
public void addCounterListener(org.snmp4j.event.CounterListener l)
public void removeCounterListener(org.snmp4j.event.CounterListener l)
protected void fireIncrementCounter(org.snmp4j.event.CounterEvent event)
public void setSession(org.snmp4j.Session snmpSession)
snmpSession
- the Snmp instance to be used to send SNMP messages.Copyright © 2017 SNMP4J.org. All rights reserved.