MySnmpCrawler API

snmp.message.handler
Class SnmpTrapHandler

java.lang.Object
  |
  +--snmp.message.handler.SnmpTrapHandler
All Implemented Interfaces:
java.util.EventListener, SnmpMessageHandler, SnmpSessionEventListener

public class SnmpTrapHandler
extends java.lang.Object
implements SnmpMessageHandler

This class provides the required operations to handle SNMP Trap-PDU.

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:49 $
Author:
Scott Cheng

Field Summary
private static SnmpTrapHandler instance
           
private static int TRAP
           
 
Constructor Summary
private SnmpTrapHandler()
          Constructs the SnmpTrapHandler object
 
Method Summary
 int getHandlerType()
          Gets the type of the handler.
static SnmpTrapHandler getInstance()
          Gets the singleton object of the SnmpTrapHandler.
 void handleSession(SnmpSessionEvent event)
          Invoked to handle the session when the SNMP PDU is "Trap-PDU".
private  void handleTrap(SnmpSessionEvent event)
           
 boolean isHandler(int type)
          This method returns true if it is the right listener to handle the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRAP

private static final int TRAP
See Also:
Constant Field Values

instance

private static SnmpTrapHandler instance
Constructor Detail

SnmpTrapHandler

private SnmpTrapHandler()
Constructs the SnmpTrapHandler object

Method Detail

handleSession

public void handleSession(SnmpSessionEvent event)
Invoked to handle the session when the SNMP PDU is "Trap-PDU".

Specified by:
handleSession in interface SnmpSessionEventListener
Parameters:
event - The SnmpSessionEvent object

isHandler

public boolean isHandler(int type)
This method returns true if it is the right listener to handle the message.

Specified by:
isHandler in interface SnmpMessageHandler
Parameters:
type - Type of the operation

getHandlerType

public int getHandlerType()
Gets the type of the handler.

Specified by:
getHandlerType in interface SnmpMessageHandler
Returns:
The handler type

handleTrap

private void handleTrap(SnmpSessionEvent event)

getInstance

public static SnmpTrapHandler getInstance()
Gets the singleton object of the SnmpTrapHandler.

Returns:
The singleton object of the SnmpTrapHandler

MySnmpCrawler API