|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
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 |
public 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
session
- The SNMP sessionagent
- The remote senderport
- The remote senders portcommunity
- The community stringpdu
- The SNMP pdupublic 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.
session
- The SNMP sessionagent
- The Trap senderport
- The port of the sendercommunity
- The community stringpdu
- The SNMP trap pdupublic 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.
session
- The SNMP Trap Sessionerror
- The error condition value.ref
- The PDU reference, or potentially null. It may also be an
exception.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |