MySnmpCrawler API

snmp.message.handler
Class DefaultSnmpRequestHandler

java.lang.Object
  |
  +--snmp.message.handler.DefaultSnmpRequestHandler
All Implemented Interfaces:
java.util.EventListener, SnmpMessageHandler, SnmpRequestHandler, SnmpSessionEventListener
Direct Known Subclasses:
SnmpGetNextRequestHandler, SnmpGetRequestHandler, SnmpSetRequestHandler

public abstract class DefaultSnmpRequestHandler
extends java.lang.Object
implements SnmpRequestHandler

This abstract class provides the implementation to determine the right request handler. It also defines the method to check if there is any error in the PDU based on the specifications in RFC1157.

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

Field Summary
 
Fields inherited from interface snmp.message.handler.SnmpRequestHandler
GET, GETNEXT, SET
 
Constructor Summary
protected DefaultSnmpRequestHandler()
          Default constructor to instantiate the SnmpMessageHandlerImpl object.
 
Method Summary
protected  int checkPDU(SnmpPdu snmpPdu)
          This method verifies each OID in the PDU to see if it is existed in the MIB database.
 boolean isHandler(int type)
          This method returns true if it is the right handler to handle the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface snmp.message.handler.SnmpMessageHandler
getHandlerType
 
Methods inherited from interface snmp.session.SnmpSessionEventListener
handleSession
 

Constructor Detail

DefaultSnmpRequestHandler

protected DefaultSnmpRequestHandler()
Default constructor to instantiate the SnmpMessageHandlerImpl object.

Method Detail

isHandler

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

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

checkPDU

protected int checkPDU(SnmpPdu snmpPdu)
                throws SnmpException
This method verifies each OID in the PDU to see if it is existed in the MIB database. If the OID does not exist in the MIB database, the method will return the index number of the OID in the PDU.

Parameters:
snmpPdu - The PDU to be checked.
Returns:
Returns -1 if each OID in the PDU existed in the MIB database. Otherwise, the index number of the OID is returned.
SnmpException

MySnmpCrawler API