MySnmpCrawler API

snmp.message.handler
Class SnmpSetRequestHandler

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

public class SnmpSetRequestHandler
extends DefaultSnmpRequestHandler

This class handles the SNMP SetRequest-PDU. It firstly checks the PDU to see if each OID is defined in the MIB database. If there is no error, it then sets the information associating to each OID to the MBean that contains the OID attribute 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 SnmpSetRequestHandler instance
           
 
Fields inherited from interface snmp.message.handler.SnmpRequestHandler
GET, GETNEXT, SET
 
Constructor Summary
private SnmpSetRequestHandler()
          Constructs the SnmpSetRequestHandler object
 
Method Summary
private  boolean checkError(SnmpSession session)
           
 int getHandlerType()
          Gets the type of the listener.
static SnmpSetRequestHandler getInstance()
          Gets the singleton object of the SnmpSetRequestHandler.
 void handleSession(SnmpSessionEvent event)
          Invoked to handle the session when the SNMP PDU is "SetRequest-PDU".
private  void handleSet(SnmpSessionEvent event)
           
 
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 SnmpSetRequestHandler instance
Constructor Detail

SnmpSetRequestHandler

private SnmpSetRequestHandler()
Constructs the SnmpSetRequestHandler object

Method Detail

handleSession

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

Parameters:
event - The SnmpSessionEvent object

getHandlerType

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

Returns:
The listener type

handleSet

private void handleSet(SnmpSessionEvent event)
                throws SnmpException
SnmpException

checkError

private boolean checkError(SnmpSession session)
                    throws SnmpException
SnmpException

getInstance

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

Returns:
The singleton object of the SnmpSetRequestHandler

MySnmpCrawler API