OpenNMS API 1.2.9

## org.opennms.protocols.snmp
Interface SnmpHandler

All Known Implementing Classes:
  IfTable, IfXTable, IpAddrTable, SnmpIfCollector, SnmpNodeCollector, SnmpResponseHandler, SnmpResponseHandler, SystemGroup

public interface SnmpHandler

The SnmpHandler interface is implemented by an object that wishs to receive callbacks when a SNMP protocol data unit is received from an agent. In addition, if an internal error occurs or an agent fails to respond then the object must handle those error conditions.

For error conditions the pdu is recast to an SnmpSyntax object. This is mainly due to the fact that the SnmpPduTrap is not derived from SnmpPduPacket. Implementations of the handler class can use instanceof to determine the type of PDU involved in the error.

Version:
  1.1.1.1
Author:
  Brian Weaver , OpenNMS

Method Summary
`void` `snmpInternalError(SnmpSession session, int err, SnmpSyntax pdu)` This method is invoked when an internal error occurs for the session.
`void` `snmpReceivedPdu(SnmpSession session, int command, SnmpPduPacket pdu)` This method is invoked when a pdu is successfully returned from the peer agent.
`void` `snmpTimeoutError(SnmpSession session, SnmpSyntax pdu)` This method is invoked when an agent fails to respond in the required time.

Method Detail

### snmpReceivedPdu

    public void snmpReceivedPdu(SnmpSession session,
                                int command,
                                SnmpPduPacket pdu)

  This method is invoked when a pdu is successfully returned from the peer agent. The command argument is recovered from the received pdu.

  Parameters:
    `session` - The SNMP session
    `command` - The PDU command
    `pdu` - The SNMP pdu

### snmpInternalError

    public void snmpInternalError(SnmpSession session,
                                  int err,
                                  SnmpSyntax pdu)

  This method is invoked when an internal error occurs for the session. To determine the exact error the err parameter should be compared with all the error conditions defined in the SnmpSession class.

  Parameters:
    `session` - The SNMP session in question
    `err` - The error that occured
    `pdu` - The PDU object that caused the error

### snmpTimeoutError

    public void snmpTimeoutError(SnmpSession session,
                                 SnmpSyntax pdu)

  This method is invoked when an agent fails to respond in the required time. This method will only be invoked if the total retries exceed the number defined by the session.

  Parameters:
    `session` - The SNMP Session
    `pdu` - The PDU object that timed out

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.