Interface SnmpTrapHandler
-
- All Known Implementing Classes:
JoeSnmpTrapNotifier
public interface SnmpTrapHandler
The SnmpTrapHandler interface is implemented by an object that wishs to receive callbacks when a SNMP trap protocol data unit is received from an agent.
- Version:
- 1.1.1.1 2001/11/11 17:27:22
- Author:
- OpenNMS , Brian Weaver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
snmpReceivedTrap(SnmpTrapSession session, java.net.InetAddress agent, int port, SnmpOctetString community, SnmpPduPacket pdu)
This method is defined to handle SNMPv2 traps that are received by the session.void
snmpReceivedTrap(SnmpTrapSession session, java.net.InetAddress agent, int port, SnmpOctetString community, SnmpPduTrap pdu)
This method is define to handle SNMPv1 traps that are received by the session.void
snmpTrapSessionError(SnmpTrapSession session, int error, java.lang.Object ref)
This method is invoked if an error occurs in the trap session.
-
-
-
Method Detail
-
snmpReceivedTrap
void snmpReceivedTrap(SnmpTrapSession session, java.net.InetAddress agent, int port, SnmpOctetString community, SnmpPduPacket pdu)
This method is defined to handle SNMPv2 traps that are received by the session. The parameters allow teh handler to determine the host, port, and community string of the received PDU
- Parameters:
session
- The SNMP sessionagent
- The remote senderport
- The remote senders portcommunity
- The community stringpdu
- The SNMP pdu
-
snmpReceivedTrap
void snmpReceivedTrap(SnmpTrapSession session, java.net.InetAddress agent, int port, SnmpOctetString community, SnmpPduTrap pdu)
This method is define to handle SNMPv1 traps that are received by the session. The parameters allow the handler to determine the host, port, and community string of the received PDU.
- Parameters:
session
- The SNMP sessionagent
- The Trap senderport
- The port of the sendercommunity
- The community stringpdu
- The SNMP trap pdu
-
snmpTrapSessionError
void snmpTrapSessionError(SnmpTrapSession session, int error, java.lang.Object ref)
This method is invoked if an error occurs in the trap session. The error code that represents the failure will be passed in the second parameter, 'error'. The error codes can be found in the class SnmpTrapSession class.
If a particular PDU is part of the error condition it will be passed in the third parameter, 'pdu'. The pdu will be of the type SnmpPduRequest or SnmpPduTrap object. The handler should use the "instanceof" operator to determine which type the object is. Also, the object may be null if the error condition is not associated with a particular PDU.
- Parameters:
session
- The SNMP Trap Sessionerror
- The error condition value.ref
- The PDU reference, or potentially null. It may also be an exception.
-
-