Package org.opennms.protocols.snmp
Class SnmpResponseHandler
- java.lang.Object
-
- org.opennms.protocols.snmp.SnmpResponseHandler
-
- All Implemented Interfaces:
SnmpHandler
public final class SnmpResponseHandler extends java.lang.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 java.lang.String
getFirstResponseString()
SnmpSyntax
getFirstResponseValue()
SnmpVarBind
getFirstResponseVarBind()
Returns the recovered SNMP system object identifier, if any.SnmpPduPacket
getResponse()
java.lang.String
getResponseString(int index)
SnmpSyntax
getResponseValue(int index)
SnmpVarBind
getResponseVarBind(int index)
int
getResponseVarBindCount()
void
snmpInternalError(SnmpSession sess, int err, SnmpSyntax obj)
This method is invoked when an internal error occurs on the SNMP session.void
snmpReceivedPdu(SnmpSession sess, int command, SnmpPduPacket pkt)
The method that handles a returned packet from the remote agent.void
snmpTimeoutError(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:
snmpReceivedPdu
in 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:
snmpInternalError
in 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:
snmpTimeoutError
in 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 java.lang.String getFirstResponseString()
-
getResponseValue
public SnmpSyntax getResponseValue(int index)
-
getResponseString
public java.lang.String getResponseString(int index)
-
getResponseVarBind
public SnmpVarBind getResponseVarBind(int index)
-
getResponseVarBindCount
public int getResponseVarBindCount()
-
-