OpenNMS API 1.2.3

org.opennms.protocols.snmp
Class SnmpTrapSession.TrapHandler

java.lang.Object
  extended byorg.opennms.protocols.snmp.SnmpTrapSession.TrapHandler
All Implemented Interfaces:
SnmpPacketHandler
Enclosing class:
SnmpTrapSession

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.


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

Field Detail

m_forWhom

private SnmpTrapSession m_forWhom
Who to pass as the session parameter

Constructor Detail

SnmpTrapSession.TrapHandler

public SnmpTrapSession.TrapHandler(SnmpTrapSession sess)

Creates a in internal trap handler to be the intermediary for the interface between the SnmpPortal and the TrapSession.

Parameters:
sess - The trap session reference.
Method Detail

processSnmpMessage

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

Processes the default V1 & V2 messages.

Specified by:
processSnmpMessage in interface SnmpPacketHandler
Parameters:
agent - The sending agent
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)

processSnmpTrap

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

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

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.