org.opennms.protocols.snmp
Class SnmpResponseHandler

java.lang.Object
  extended by 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
SnmpResponseHandler()
           
 
Method Summary
 String getFirstResponseString()
           
 SnmpSyntax getFirstResponseValue()
           
 SnmpVarBind getFirstResponseVarBind()
          Returns the recovered snmp system object identifier, if any.
 SnmpPduPacket getResponse()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

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()


Copyright © 2008. All Rights Reserved.