private class SnmpTrapSession.TrapHandler extends java.lang.Object implements SnmpPacketHandler
The internal trap handler class is designed to receive information from the enclosed SnmpPortal class. The information is the processed and forwarded when appropiate to the SnmpTrapHandler registered with the session.
| Modifier and Type | Field and Description |
|---|---|
private SnmpTrapSession |
m_forWhom
Who to pass as the session parameter
|
| Constructor and Description |
|---|
SnmpTrapSession.TrapHandler(SnmpTrapSession sess)
Creates a in internal trap handler to be
the intermediary for the interface between
the SnmpPortal and the TrapSession.
|
| Modifier and Type | Method and Description |
|---|---|
void |
processBadDatagram(java.net.DatagramPacket p)
Invoked when bad datagrams are received.
|
void |
processException(java.lang.Exception e)
Invoked when an exception occurs in the session.
|
void |
processSnmpMessage(java.net.InetAddress agent,
int port,
SnmpInt32 version,
SnmpOctetString community,
int pduType,
SnmpPduPacket pdu)
Processes the default V1 & V2 messages.
|
void |
processSnmpTrap(java.net.InetAddress agent,
int port,
SnmpOctetString community,
SnmpPduTrap pdu)
Processes V1 trap messages.
|
private SnmpTrapSession m_forWhom
public SnmpTrapSession.TrapHandler(SnmpTrapSession sess)
Creates a in internal trap handler to be the intermediary for the interface between the SnmpPortal and the TrapSession.
sess - The trap session reference.public void processSnmpMessage(java.net.InetAddress agent,
int port,
SnmpInt32 version,
SnmpOctetString community,
int pduType,
SnmpPduPacket pdu)
Processes the default V1 & V2 messages.
processSnmpMessage in interface SnmpPacketHandleragent - The sending agentport - The remote port.version - The SNMP Version of the message.community - The community string from the message.pduType - The type of pdupdu - The actual pduSnmpPduEncodingException - Thrown if the pdu fails to decode.SnmpPortal.Receiver.run(),
SnmpPortal.handlePkt(java.net.DatagramPacket)public void processSnmpTrap(java.net.InetAddress agent,
int port,
SnmpOctetString community,
SnmpPduTrap pdu)
Processes V1 trap messages.
processSnmpTrap in interface SnmpPacketHandleragent - The sending agentport - The remote port.community - The community string from the message.pdu - The actual pduSnmpPduEncodingException - Thrown if the pdu fails to decode.SnmpPduTrappublic void processBadDatagram(java.net.DatagramPacket p)
Invoked when bad datagrams are received.
processBadDatagram in interface SnmpPacketHandlerp - The datagram packet in question.public void processException(java.lang.Exception e)
Invoked when an exception occurs in the session.
processException in interface SnmpPacketHandlere - The exception.SnmpPortalGenerated by iurt on 2013.