com.adventnet.snmp.snmp2.agent
Class VarBindRequestEvent

java.lang.Object
  |
  +--com.adventnet.utils.agent.AgentEventObject
        |
        +--com.adventnet.snmp.snmp2.agent.VarBindRequestEvent

public class VarBindRequestEvent
extends AgentEventObject

The VarBindRequestEvent gives information about the request VarBind received.

VarBindRequestEvent is sent to all listeners interested in a particular node. The VarBindRequestEvent contains varbinds received for the targets interested in the nodes

See Also:
SnmpAgent, SnmpVar, SnmpOID, SnmpVarBind, Serialized Form

Field Summary
(package private)  java.lang.String agentAddress
           
(package private)  int agentVersion
           
(package private)  byte command
           
(package private)  byte[] data
           
(package private)  java.util.Vector failedList
           
(package private)  java.util.Vector failedVarBindList
           
(package private)  java.util.Vector globalIndexList
           
(package private)  VarBindRequestListenerHolder holder
          The holder which holds info about the listener
(package private)  int[] holderKey
           
(package private)  java.util.Vector leafNodes
           
(package private)  java.util.Vector originalOIDList
           
(package private)  SnmpPDU pdu
           
(package private)  PropertyRegistrationListener propListener
           
(package private)  AgentNode registeredNode
           
(package private)  java.util.Vector varbindList
           
 
Fields inherited from class com.adventnet.utils.agent.AgentEventObject
source
 
Constructor Summary
VarBindRequestEvent(java.lang.Object varBindRequestEventSource, PropertyRegistrationListener propListener, SnmpPDU pdu)
          Constructor for VarBindRequestEvent.
VarBindRequestEvent(java.lang.Object varBindRequestEventSource, SnmpPDU pdu)
          Constructor for VarBindRequestEvent.
 
Method Summary
(package private)  java.lang.String getAgentAddress()
           
 int getAgentVersion()
          Gets the Snmp version of the received SnmpPDU.
 byte getCommand()
          Gets the command type of the received snmpPDU
 java.lang.String getCommunity()
          Gets the community of the SnmpPDU sender.
(package private)  byte[] getData()
           
 java.util.Vector getFailedList()
          Getter for the Vector containing all the Failed varbinds
(package private)  java.util.Vector getGlobalIndexList()
           
(package private)  int[] getHolderKey()
           
 java.util.Vector getLeafNodes()
          Gets all leaf nodes of the received varbind.
 int getNextSubId(int pos)
          Gets the next sub OID of the received varbind.
 java.util.Vector getOriginalOIDList()
          Getter for the Original OID list vector
 PropertyRegistrationListener getPropertyRegistrationListener()
          gets the PropertyRegistrationListener from which agent properties can be derived.
 AgentNode getRegisteredNode()
          Gets the registered node of a particular listener.
 java.lang.String getRemoteHost()
          Gets the host name of the snmpPDU sender
 int getRemotePort()
          Gets the port number on which the SnmpPDU is received.
 int getReqId()
          Gets the SnmpPDU request Id.
 SnmpPDU getSnmpPDU()
          Returns the PDU originated with this varbindrequestevent
 java.util.Vector getVarBindList()
          Get the varbinds.
 int getVersion()
          Gets the Snmp version of the received SnmpPDU.
 boolean isRemoveEntry()
          Signifies the purpose of deleting the Table row created in a MultiVar request when any other VarBinds fail.
 boolean isRollback()
          Signifies whether this event is generated for the purpose of ROLLBACK.
 void setAgentVersion(int snmpVersion)
          Setter for the Snmp Version of this Event
 void setAgentVersion(java.lang.String snmpVersion)
          Setter for the Snmp Version of this Event
(package private)  void setData(byte[] data)
           
 void setFailedList(java.util.Vector list)
          Setter for the Vector containing all the Failed varbinds
 void setFailedVarBindList(java.util.Vector list)
          Set all varbinds which have failed API Users need to set this Vector when a varbind/s fail
(package private)  void setHolderKey(int[] holderKey)
           
(package private)  void setRemoveEntry(boolean flag)
           
(package private)  void setRollback(boolean rollback)
           
 void setVarBindList(java.util.Vector varbindList)
           
 
Methods inherited from class com.adventnet.utils.agent.AgentEventObject
getSource, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pdu

SnmpPDU pdu

registeredNode

AgentNode registeredNode

varbindList

java.util.Vector varbindList

propListener

PropertyRegistrationListener propListener

holder

VarBindRequestListenerHolder holder
The holder which holds info about the listener

failedVarBindList

java.util.Vector failedVarBindList

command

byte command

agentVersion

int agentVersion

leafNodes

java.util.Vector leafNodes

failedList

java.util.Vector failedList

data

byte[] data

globalIndexList

java.util.Vector globalIndexList

originalOIDList

java.util.Vector originalOIDList

holderKey

int[] holderKey

agentAddress

java.lang.String agentAddress
Constructor Detail

VarBindRequestEvent

public VarBindRequestEvent(java.lang.Object varBindRequestEventSource,
                           SnmpPDU pdu)
Constructor for VarBindRequestEvent.
Parameters:
varBindRequestEventSource - source of the varbind listener.
pdu - the received SnmpPDU.

VarBindRequestEvent

public VarBindRequestEvent(java.lang.Object varBindRequestEventSource,
                           PropertyRegistrationListener propListener,
                           SnmpPDU pdu)
Constructor for VarBindRequestEvent.
Parameters:
varBindRequestEventSource - source of the varbind listener.
propListener - the listener from which agent properties can be derived.
pdu - the received SnmpPDU.
Method Detail

getRegisteredNode

public AgentNode getRegisteredNode()
Gets the registered node of a particular listener.
Returns:
the Node for which this listener has registered interested in.

getPropertyRegistrationListener

public PropertyRegistrationListener getPropertyRegistrationListener()
gets the PropertyRegistrationListener from which agent properties can be derived.
Parameters:
The - PropertyRegistrationListener instance

setFailedVarBindList

public void setFailedVarBindList(java.util.Vector list)
Set all varbinds which have failed API Users need to set this Vector when a varbind/s fail
Parameters:
list - the array of failed vabinds
See Also:
VarbindAndFailure

getVarBindList

public java.util.Vector getVarBindList()
Get the varbinds.
Returns:
Vector of varbinds for this class command

getCommunity

public java.lang.String getCommunity()
Gets the community of the SnmpPDU sender.
Returns:
the community of the peer which has sent this request null if we are a windows sub agent

getRemoteHost

public java.lang.String getRemoteHost()
Gets the host name of the snmpPDU sender
Returns:
the remoteHost which sent the pdu null if we are a windows sub agent

getCommand

public byte getCommand()
Gets the command type of the received snmpPDU
Returns:
the command type of the pdu null if we are a windows sub agent
See Also:
SnmpAPI

getRemotePort

public int getRemotePort()
Gets the port number on which the SnmpPDU is received.
Returns:
port number. null if we are a windows sub agent

getVersion

public int getVersion()
Gets the Snmp version of the received SnmpPDU.
Returns:
Snmp version. SnmpAPI.VERSION_1 in case we are a Windows sub agent

setAgentVersion

public void setAgentVersion(java.lang.String snmpVersion)
Setter for the Snmp Version of this Event
Parameters:
snmpVersion - the Snmp Version String to be set (v1, v2c, v2 or v3)

setAgentVersion

public void setAgentVersion(int snmpVersion)
Setter for the Snmp Version of this Event
Parameters:
snmpVersion - the Snmp Version int to be set(0,1,3)

getAgentVersion

public int getAgentVersion()
Gets the Snmp version of the received SnmpPDU.
Returns:
Snmp version. SnmpAPI.VERSION_1 in case we are a Windows sub agent

getReqId

public int getReqId()
Gets the SnmpPDU request Id.
Returns:
the SnmpPDU's request Id -1 in case we are a windows sub agent

getLeafNodes

public java.util.Vector getLeafNodes()
Gets all leaf nodes of the received varbind.
Returns:
a vector of leaf nodes for all the varbinds which have oid defined in the MIB

setVarBindList

public void setVarBindList(java.util.Vector varbindList)

getNextSubId

public int getNextSubId(int pos)
Gets the next sub OID of the received varbind.
Parameters:
pos - The index of the subId list.
Returns:
the next Identifier

setFailedList

public void setFailedList(java.util.Vector list)
Setter for the Vector containing all the Failed varbinds
Parameters:
list - Vector of failed varbinds.

getFailedList

public java.util.Vector getFailedList()
Getter for the Vector containing all the Failed varbinds
Returns:
the failed list of varbinds vector.

getData

byte[] getData()

setData

void setData(byte[] data)

getGlobalIndexList

java.util.Vector getGlobalIndexList()

getOriginalOIDList

public java.util.Vector getOriginalOIDList()
Getter for the Original OID list vector
Returns:
The originalOIDList Vector

setHolderKey

void setHolderKey(int[] holderKey)

getHolderKey

int[] getHolderKey()

getAgentAddress

java.lang.String getAgentAddress()

isRollback

public boolean isRollback()
Signifies whether this event is generated for the purpose of ROLLBACK.
Returns:
rollback the boolean value signifying whether the request event is for ROLLBACK or not.

setRollback

void setRollback(boolean rollback)

isRemoveEntry

public boolean isRemoveEntry()
Signifies the purpose of deleting the Table row created in a MultiVar request when any other VarBinds fail.
Returns:
The boolean for removal of Table row created within a MultiVar request.

setRemoveEntry

void setRemoveEntry(boolean flag)

getSnmpPDU

public SnmpPDU getSnmpPDU()
Returns the PDU originated with this varbindrequestevent
Returns:
The SnmpPDU associated with this event