JoeSNMP API 0.3.4

org.opennms.protocols.snmp
Class SnmpAgentSession.AgentHandler

java.lang.Object
  extended by org.opennms.protocols.snmp.SnmpAgentSession.AgentHandler
All Implemented Interfaces:
SnmpPacketHandler
Enclosing class:
SnmpAgentSession

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.


Field Summary
private  SnmpAgentSession m_forWhom
          Who to pass as the session parameter
 
Constructor Summary
SnmpAgentSession.AgentHandler(SnmpAgentSession sess)
          Creates an internal agent handler to be the intermediary for the interface between the SnmpPortal and the Session.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_forWhom

private SnmpAgentSession m_forWhom
Who to pass as the session parameter

Constructor Detail

SnmpAgentSession.AgentHandler

public SnmpAgentSession.AgentHandler(SnmpAgentSession sess)

Creates an internal agent handler to be the intermediary for the interface between the SnmpPortal and the Session.

Parameters:
sess - The agent session reference.
Method Detail

processSnmpMessage

public void processSnmpMessage(java.net.InetAddress manager,
                               int port,
                               SnmpInt32 version,
                               SnmpOctetString community,
                               int pduType,
                               SnmpPduPacket pdu)

Processes the default V1 & V2 messages.

Specified by:
processSnmpMessage in interface SnmpPacketHandler
Parameters:
manager - The sending manager
port - The remote port.
version - The SNMP Version of the message.
community - The community string from the message.
pduType - The type of pdu
pdu - The actual pdu
Throws:
SnmpPduEncodingException - Thrown if the pdu fails to decode.
See Also:
SnmpPortal.Receiver.run(), SnmpPortal.handlePkt(java.net.DatagramPacket)

handleResponse

private void handleResponse(java.net.InetAddress manager,
                            int port,
                            SnmpPduPacket pdu,
                            SnmpPduRequest response)

processSnmpTrap

public void processSnmpTrap(java.net.InetAddress agent,
                            int port,
                            SnmpOctetString community,
                            SnmpPduTrap pdu)

Processes V1 trap messages.

Specified by:
processSnmpTrap in interface SnmpPacketHandler
Parameters:
agent - The sending agent
port - The remote port.
community - The community string from the message.
pdu - The actual pdu
Throws:
SnmpPduEncodingException - Thrown if the pdu fails to decode.
See Also:
SnmpPduTrap

processBadDatagram

public void processBadDatagram(java.net.DatagramPacket p)

Invoked when bad datagrams are received.

Specified by:
processBadDatagram in interface SnmpPacketHandler
Parameters:
p - The datagram packet in question.

processException

public void processException(java.lang.Exception e)

Invoked when an exception occurs in the session.

Specified by:
processException in interface SnmpPacketHandler
Parameters:
e - The exception.
See Also:
SnmpPortal

JoeSNMP API 0.3.4

Generated by iurt on 2011.