Class 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 Detail

      • SnmpResponseHandler

        public SnmpResponseHandler()
    • 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 interface SnmpHandler
        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 interface SnmpHandler
        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 interface SnmpHandler
        Parameters:
        sess - The SNMP session that received the result.
        pkt - The SNMP packet that was received.
      • 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()