MySnmpCrawler API

snmp.message.handler
Class SnmpGetRequestHandler

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

public class SnmpGetRequestHandler
extends DefaultSnmpRequestHandler

This class handles the SNMP GetRequest-PDU. It firstly checks the PDU to see if each OID is defined in the MIB database. If there is no error, it then retrieves the object value from the MBean for each OID in the PDU and finally replies to the requesting manager.

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

Field Summary
private static SnmpGetRequestHandler instance
           
 
Fields inherited from interface snmp.message.handler.SnmpRequestHandler
GET, GETNEXT, SET
 
Constructor Summary
private SnmpGetRequestHandler()
          Constructs the SnmpGetRequestHandler object
 
Method Summary
private  boolean checkError(SnmpSession session)
           
 int getHandlerType()
          Gets the type of the handler.
static SnmpGetRequestHandler getInstance()
          Gets the singleton object of the SnmpGetRequestHandler.
private  void handleGet(SnmpSessionEvent event)
           
 void handleSession(SnmpSessionEvent event)
          Invoked to handle the session when the SNMP PDU is "GetRequest-PDU".
 
Methods inherited from class snmp.message.handler.DefaultSnmpRequestHandler
checkPDU, isHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static SnmpGetRequestHandler instance
Constructor Detail

SnmpGetRequestHandler

private SnmpGetRequestHandler()
Constructs the SnmpGetRequestHandler object

Method Detail

handleSession

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

Parameters:
event - The SnmpSessionEvent object

getHandlerType

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

Returns:
The handler type

handleGet

private void handleGet(SnmpSessionEvent event)
                throws SnmpException
SnmpException

checkError

private boolean checkError(SnmpSession session)
                    throws SnmpException
SnmpException

getInstance

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

Returns:
The singleton object of the SnmpGetRequestHandler

MySnmpCrawler API