public interface SnmpAgentHandler
The SnmpAgentHandler interface is implemented by an object that wishs to receive callbacks when an SNMP protocol data unit is received from a manager.
Modifier and Type | Method and Description |
---|---|
void |
SnmpAgentSessionError(SnmpAgentSession session,
int error,
java.lang.Object ref)
This method is invoked if an error occurs in
the session.
|
SnmpPduRequest |
snmpReceivedGet(SnmpPduPacket pdu,
boolean getNext)
This method is defined to handle SNMP Get requests
that are received by the session.
|
void |
snmpReceivedPdu(SnmpAgentSession session,
java.net.InetAddress manager,
int port,
SnmpOctetString community,
SnmpPduPacket pdu)
This method is defined to handle SNMP requests
that are received by the session.
|
SnmpPduRequest |
snmpReceivedSet(SnmpPduPacket pdu)
This method is defined to handle SNMP Set requests
that are received by the session.
|
void snmpReceivedPdu(SnmpAgentSession session, java.net.InetAddress manager, int port, SnmpOctetString community, SnmpPduPacket pdu)
This method is defined to handle SNMP requests that are received by the session. The parameters allow the handler to determine the host, port, and community string of the received PDU
session
- The SNMP sessionmanager
- The remote senderport
- The remote senders portcommunity
- The community stringpdu
- The SNMP pduSnmpPduRequest snmpReceivedGet(SnmpPduPacket pdu, boolean getNext)
This method is defined to handle SNMP Get requests that are received by the session. The request has already been validated by the system. This routine will build a response and pass it back to the caller.
pdu
- The SNMP pdugetNext
- The agent is requesting the lexically NEXT item after each
item in the pdu.SnmpPduRequest snmpReceivedSet(SnmpPduPacket pdu)
This method is defined to handle SNMP Set requests that are received by the session. The request has already been validated by the system. This routine will build a response and pass it back to the caller.
pdu
- The SNMP pduvoid SnmpAgentSessionError(SnmpAgentSession session, int error, java.lang.Object ref)
This method is invoked if an error occurs in the session. The error code that represents the failure will be passed in the second parameter, 'error'. The error codes can be found in the class SnmpAgentSession class.
If a particular PDU is part of the error condition it will be passed in the third parameter, 'pdu'. The pdu will be of the type SnmpPduRequest or SnmpPduTrap object. The handler should use the "instanceof" operator to determine which type the object is. Also, the object may be null if the error condition is not associated with a particular PDU.
session
- The SNMP Sessionerror
- The error condition value.ref
- The PDU reference, or potentially null.
It may also be an exception.Generated by iurt on 2015.