private class SnmpAgentSession.AgentHandler 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 SnmpAgentHandler registered with the session.
Modifier and Type | Field and Description |
---|---|
private SnmpAgentSession |
m_forWhom
Who to pass as the session parameter
|
Constructor and Description |
---|
AgentHandler(SnmpAgentSession sess)
Creates an internal agent handler to be
the intermediary for the interface between
the SnmpPortal and the Session.
|
Modifier and Type | Method and Description |
---|---|
private void |
handleResponse(java.net.InetAddress manager,
int port,
SnmpPduPacket pdu,
SnmpPduRequest response) |
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 manager,
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 SnmpAgentSession m_forWhom
public AgentHandler(SnmpAgentSession sess)
Creates an internal agent handler to be the intermediary for the interface between the SnmpPortal and the Session.
sess
- The agent session reference.public void processSnmpMessage(java.net.InetAddress manager, int port, SnmpInt32 version, SnmpOctetString community, int pduType, SnmpPduPacket pdu)
Processes the default V1 & V2 messages.
processSnmpMessage
in interface SnmpPacketHandler
manager
- The sending managerport
- 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)
private void handleResponse(java.net.InetAddress manager, int port, SnmpPduPacket pdu, SnmpPduRequest response)
public void processSnmpTrap(java.net.InetAddress agent, int port, SnmpOctetString community, SnmpPduTrap pdu)
Processes V1 trap messages.
processSnmpTrap
in interface SnmpPacketHandler
agent
- The sending agentport
- The remote port.community
- The community string from the message.pdu
- The actual pduSnmpPduEncodingException
- Thrown if the pdu fails to decode.SnmpPduTrap
public void processBadDatagram(java.net.DatagramPacket p)
Invoked when bad datagrams are received.
processBadDatagram
in interface SnmpPacketHandler
p
- The datagram packet in question.public void processException(java.lang.Exception e)
Invoked when an exception occurs in the session.
processException
in interface SnmpPacketHandler
e
- The exception.SnmpPortal
Generated by iurt on 2015.