com.adventnet.snmp.beans
Class RequestEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.adventnet.snmp.beans.RequestEvent
All Implemented Interfaces:
java.io.Serializable

public class RequestEvent
extends java.util.EventObject

This event object, which contains information for an SNMP request that can be handled by any RequestEventListner, e.g. SnmpRequestServer.

To use, generate these events from your objects, and register an SnmpRequestServer instance to receive these events.

Please see the SnmpRequestServer docs for more details.

See Also:
SnmpRequestServer, Serialized Form

Field Summary
static byte GET
          Constant for Get Request
static byte GETBULK
          v2c and v3 only Constant for GETBULK Request
static byte GETNEXT
          Constant for GetNext Request
static byte SET
          Constant for Set Request
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
RequestEvent(java.lang.Object o, byte requestType)
          This instantiates a Request event with specified source, and specified request type - GET, or GETNEXT.
RequestEvent(java.lang.Object o, java.lang.String value)
          This instantiates a Set Request event with specified source, and specified set value.
RequestEvent(java.lang.Object o, java.lang.String[] objectNames, byte requestType)
          This instantiates a Request event with specified source, specified OID list, and specified request type, i.e, GET, or GETNEXT.
RequestEvent(java.lang.Object o, java.lang.String[] objectNames, SnmpVar[] vars)
          This instantiates a Request event with specified source, specified OID list and SnmpVar array list.
RequestEvent(java.lang.Object o, java.lang.String[] objectNames, java.lang.String[] values)
          This instantiates a Set Request event with specified source, specified OID list, and specified set value list.
RequestEvent(java.lang.Object o, java.lang.String objectName, byte requestType)
          This instantiates a Request event with specified source, specified OID, and specified request type, i.e, GET, or GETNEXT.
RequestEvent(java.lang.Object o, java.lang.String objectName, java.lang.String value)
          This instantiates a Set Request event with specified source, specified OID, and specified value.
 
Method Summary
 void setDestination(ResultListener dest)
          This sets the Destination for the response.
 void setRequestID(int requestID)
          This sets the Request ID value.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GET

public static final byte GET
Constant for Get Request

See Also:
Constant Field Values

GETNEXT

public static final byte GETNEXT
Constant for GetNext Request

See Also:
Constant Field Values

SET

public static final byte SET
Constant for Set Request

See Also:
Constant Field Values

GETBULK

public static final byte GETBULK
v2c and v3 only Constant for GETBULK Request

See Also:
Constant Field Values
Constructor Detail

RequestEvent

public RequestEvent(java.lang.Object o,
                    byte requestType)
This instantiates a Request event with specified source, and specified request type - GET, or GETNEXT. The variables in the request will be taken from the SnmpRequestServer OID list. This allows you to setup the SnmpRequestServer OID list and you need not specify the OIDs in the request.


RequestEvent

public RequestEvent(java.lang.Object o,
                    java.lang.String objectName,
                    byte requestType)
This instantiates a Request event with specified source, specified OID, and specified request type, i.e, GET, or GETNEXT.


RequestEvent

public RequestEvent(java.lang.Object o,
                    java.lang.String objectName,
                    java.lang.String value)
This instantiates a Set Request event with specified source, specified OID, and specified value. This method is only applicable to set requests.


RequestEvent

public RequestEvent(java.lang.Object o,
                    java.lang.String value)
This instantiates a Set Request event with specified source, and specified set value. The object ID is taken from the SnmpRequestServer that receives this event. This method is only applicable to set requests.


RequestEvent

public RequestEvent(java.lang.Object o,
                    java.lang.String[] objectNames,
                    byte requestType)
This instantiates a Request event with specified source, specified OID list, and specified request type, i.e, GET, or GETNEXT.


RequestEvent

public RequestEvent(java.lang.Object o,
                    java.lang.String[] objectNames,
                    SnmpVar[] vars)
This instantiates a Request event with specified source, specified OID list and SnmpVar array list. This is used for Set Request without loading the mibs.


RequestEvent

public RequestEvent(java.lang.Object o,
                    java.lang.String[] objectNames,
                    java.lang.String[] values)
This instantiates a Set Request event with specified source, specified OID list, and specified set value list. This is only applicable to set requests.

Method Detail

setDestination

public void setDestination(ResultListener dest)
This sets the Destination for the response. If the destination is not set, the response, or ResultEvent, will be sent to all ResultListeners registered with the SnmpRequestServer. Otherwise it will be sent only to the specified destination.


setRequestID

public void setRequestID(int requestID)
This sets the Request ID value. This will be used by the server if set, but will otherwise be generated and managed by the library.



Copyright (c)ZOHO Corp. 1996-2012