Package org.opennms.protocols.snmp
Class SnmpResponseHandler
- java.lang.Object
-
- org.opennms.protocols.snmp.SnmpResponseHandler
-
- All Implemented Interfaces:
SnmpHandler
public final class SnmpResponseHandler extends Object implements SnmpHandler
The SNMP handler used to receive responses from individual sessions. When a response is received that matches a system object identifier request the session is notified.- Author:
- Mike Davidson , OpenNMS
-
-
Constructor Summary
Constructors Constructor Description SnmpResponseHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFirstResponseString()SnmpSyntaxgetFirstResponseValue()SnmpVarBindgetFirstResponseVarBind()Returns the recovered SNMP system object identifier, if any.SnmpPduPacketgetResponse()StringgetResponseString(int index)SnmpSyntaxgetResponseValue(int index)SnmpVarBindgetResponseVarBind(int index)intgetResponseVarBindCount()voidsnmpInternalError(SnmpSession sess, int err, SnmpSyntax obj)This method is invoked when an internal error occurs on the SNMP session.voidsnmpReceivedPdu(SnmpSession sess, int command, SnmpPduPacket pkt)The method that handles a returned packet from the remote agent.voidsnmpTimeoutError(SnmpSession sess, SnmpSyntax pkt)This method is invoked when the session fails to receive a response to a particular packet.
-
-
-
Method Detail
-
snmpReceivedPdu
public void snmpReceivedPdu(SnmpSession sess, int command, SnmpPduPacket pkt)
The method that handles a returned packet from the remote agent.- Specified by:
snmpReceivedPduin interfaceSnmpHandler- Parameters:
sess- The SNMP session that received the result.command- The SNMP command.pkt- The SNMP packet that was received.
-
snmpInternalError
public void snmpInternalError(SnmpSession sess, int err, SnmpSyntax obj)
This method is invoked when an internal error occurs on the SNMP session.- Specified by:
snmpInternalErrorin interfaceSnmpHandler- Parameters:
sess- The SNMP session that received the result.err- The err.obj- The syntax object.
-
snmpTimeoutError
public void snmpTimeoutError(SnmpSession sess, SnmpSyntax pkt)
This method is invoked when the session fails to receive a response to a particular packet.- Specified by:
snmpTimeoutErrorin interfaceSnmpHandler- Parameters:
sess- The SNMP session that received the result.pkt- The SNMP packet that was received.
-
getResponse
public SnmpPduPacket getResponse()
-
getFirstResponseVarBind
public SnmpVarBind getFirstResponseVarBind()
Returns the recovered SNMP system object identifier, if any. If one was not returned then a null value is returned to the caller.
-
getFirstResponseValue
public SnmpSyntax getFirstResponseValue()
-
getFirstResponseString
public String getFirstResponseString()
-
getResponseValue
public SnmpSyntax getResponseValue(int index)
-
getResponseString
public String getResponseString(int index)
-
getResponseVarBind
public SnmpVarBind getResponseVarBind(int index)
-
getResponseVarBindCount
public int getResponseVarBindCount()
-
-