com.adventnet.snmp.snmp2.agent
Class VarBindRequestListenerHolder

java.lang.Object
  extended by com.adventnet.snmp.snmp2.agent.VarBindRequestListenerHolder
All Implemented Interfaces:
ComparableObject

public class VarBindRequestListenerHolder
extends java.lang.Object
implements ComparableObject

This class contains the VarBindRequestListener and the AgentNode attached to

API users would be able to use the generated code in an as is form except when they need some customisation. For most part all such code is generated by the Builder.

In case of forwarding where the Extensible agent is not MIB aware (registrations where the extensible agent has no MIB handle). The user classes could register with an array of integer values [1,3,6,1 ...] or .N.N.N string representation ie .1.3.6.1 etc

See Also:


Field Summary
(package private)  VarBindRequestListenerManager manager
           
(package private)  AgentNode node
           
(package private)  VarBindRequestListener pduListener
           
(package private)  boolean proxy
           
(package private)  java.util.Vector varbindList
           
 
Constructor Summary
VarBindRequestListenerHolder(VarBindRequestListener listener, VarBindRequestListenerManager manager, java.lang.Object oid)
          This constructor is used for registering the Listener
 
Method Summary
(package private)  void addVarBind(SnmpVarBind varbind, int globalIndex, java.util.Vector varbindList, AgentNode requestCell)
          adds the varbind to list of VarBinds which can be processed by the listener later
 int compareTo(int[] obj)
          Implementations of ComparableObject interface
 int compareTo(java.lang.Object obj)
          Implementations of ComparableObject interface
(package private)  int[] getIntOID()
           
 java.lang.Object getKey()
          Part of ComparableObject interface
(package private)  AgentNode getNextProxyCell(AgentNode node)
           
(package private)  int getNextSubId(int pos)
           
(package private)  int getNextSubId(SnmpVarBind varb)
           
(package private)  AgentNode getParentProxyCell(AgentNode node)
           
(package private)  AgentNode getRequestCell()
          Getter method called ny PduRequestHandler
(package private)  int getSubId(SnmpVarBind varb)
           
(package private)  int[] getSubidList()
          getter for subIdList
(package private)  VarBindRequestListener getVarBindRequestListener()
          The VarBindRequestListener instance
(package private)  boolean isNoNextObject(VarBindAndFailure vbFail2)
           
(package private)  boolean isProxy()
           
(package private)  boolean isValidErrValue(byte val)
          Checks if we have a valid errvalue
(package private)  void processFailedVarBindList(java.util.Vector failedList, VarBindRequestEvent pe, byte req, AgentResource agentSource)
          process the failed varbindList
(package private)  void processFailedVarBindList(java.util.Vector failedList, java.util.Vector totalList)
          Processes the failed VarrbindList and sets errindexes to absolute values
(package private)  SnmpVarBind processGetBulkRequest(SnmpPDU pdu, SnmpVarBind varb, AgentResource agentSource)
          Processes getBulk Request
(package private)  void processGetNextList(VarBindRequestEvent pe, java.util.Vector varbindList, int i, java.util.Vector dummyFailedList, java.util.Vector reqVarbindList, AgentResource agentSource, boolean forCheckingProxy)
           
(package private)  java.util.Vector processGetNextVarBinds(SnmpPDU pdu, java.util.Vector varbindList, AgentResource agentSource, boolean forProxy)
          Processes the SNMP Get requests and passes the request event to the interested listeners
(package private)  java.util.Vector processGetVarBinds(SnmpPDU pdu, java.util.Vector varbindList, AgentResource agentSource)
          Processes the SNMP Get requests and passes the request event to the interested listeners
(package private)  java.util.Vector processSetVarBinds(SnmpPDU pdu, java.util.Vector varbindList, AgentResource agentSource)
          Processes the SNMP Get requests and passes the request event to the interested listeners
(package private)  SnmpVarBind setErrorValueForGetNext(VarBindAndFailure vbfail1, VarBindRequestEvent pe, SnmpVarBind varb1, int index, AgentResource agentSource)
          Sets V2 varBindIndex for GetNext request
(package private)  void setErrorValueForGetVarBind(VarBindAndFailure vbfail1, SnmpVarBind varb1, int index, AgentResource agentSource)
          Set errvalue (varbindIndex in V2) for get and GetNext failures
(package private)  void setErrvalue(SnmpVarBind varb1, VarBindAndFailure vbfail1, SnmpPDU pdu)
           
(package private)  void setProxy(boolean proxy)
           
(package private)  void setRequestCell(AgentNode cell)
          method called ny VarBindRequestManager
(package private)  void setSubidList(int[] subidList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

AgentNode node

manager

VarBindRequestListenerManager manager

pduListener

VarBindRequestListener pduListener

varbindList

java.util.Vector varbindList

proxy

boolean proxy
Constructor Detail

VarBindRequestListenerHolder

VarBindRequestListenerHolder(VarBindRequestListener listener,
                             VarBindRequestListenerManager manager,
                             java.lang.Object oid)
                       throws RegistrationException
This constructor is used for registering the Listener

Throws:
RegistrationException
Method Detail

getSubidList

int[] getSubidList()
getter for subIdList

Subids are used for getting the NextIdentifiers in case of getNext requests


setSubidList

void setSubidList(int[] subidList)

isProxy

boolean isProxy()

setProxy

void setProxy(boolean proxy)

getVarBindRequestListener

VarBindRequestListener getVarBindRequestListener()
The VarBindRequestListener instance


compareTo

public int compareTo(java.lang.Object obj)
Implementations of ComparableObject interface

Specified by:
compareTo in interface ComparableObject
Parameters:
obj - ComparableObject to be compared
Returns:
  • 0 if two of them or equal
  • 1 if obj is less
  • -1 if obj is greater

  • compareTo

    public int compareTo(int[] obj)
    Implementations of ComparableObject interface


    getKey

    public java.lang.Object getKey()
    Part of ComparableObject interface

    Specified by:
    getKey in interface ComparableObject
    Returns:
    object of the key

    addVarBind

    void addVarBind(SnmpVarBind varbind,
                    int globalIndex,
                    java.util.Vector varbindList,
                    AgentNode requestCell)
    adds the varbind to list of VarBinds which can be processed by the listener later


    getIntOID

    int[] getIntOID()

    getNextProxyCell

    AgentNode getNextProxyCell(AgentNode node)

    getParentProxyCell

    AgentNode getParentProxyCell(AgentNode node)

    processGetNextList

    void processGetNextList(VarBindRequestEvent pe,
                            java.util.Vector varbindList,
                            int i,
                            java.util.Vector dummyFailedList,
                            java.util.Vector reqVarbindList,
                            AgentResource agentSource,
                            boolean forCheckingProxy)

    processGetNextVarBinds

    java.util.Vector processGetNextVarBinds(SnmpPDU pdu,
                                            java.util.Vector varbindList,
                                            AgentResource agentSource,
                                            boolean forProxy)
                                      throws AgentSnmpException
    Processes the SNMP Get requests and passes the request event to the interested listeners

    Throws:
    AgentSnmpException

    processGetVarBinds

    java.util.Vector processGetVarBinds(SnmpPDU pdu,
                                        java.util.Vector varbindList,
                                        AgentResource agentSource)
                                  throws AgentSnmpException
    Processes the SNMP Get requests and passes the request event to the interested listeners

    Throws:
    AgentSnmpException

    processSetVarBinds

    java.util.Vector processSetVarBinds(SnmpPDU pdu,
                                        java.util.Vector varbindList,
                                        AgentResource agentSource)
                                  throws AgentSnmpException
    Processes the SNMP Get requests and passes the request event to the interested listeners

    Throws:
    AgentSnmpException

    processGetBulkRequest

    SnmpVarBind processGetBulkRequest(SnmpPDU pdu,
                                      SnmpVarBind varb,
                                      AgentResource agentSource)
                                throws AgentSnmpException
    Processes getBulk Request

    Parameters:
    the - Varbind whose next varbind needs to be found
    Throws:
    AgentSnmpException

    processFailedVarBindList

    void processFailedVarBindList(java.util.Vector failedList,
                                  java.util.Vector totalList)
    Processes the failed VarrbindList and sets errindexes to absolute values


    processFailedVarBindList

    void processFailedVarBindList(java.util.Vector failedList,
                                  VarBindRequestEvent pe,
                                  byte req,
                                  AgentResource agentSource)
                            throws AgentSnmpException
    process the failed varbindList

    Throws:
    AgentSnmpException

    setErrorValueForGetNext

    SnmpVarBind setErrorValueForGetNext(VarBindAndFailure vbfail1,
                                        VarBindRequestEvent pe,
                                        SnmpVarBind varb1,
                                        int index,
                                        AgentResource agentSource)
                                  throws AgentSnmpException
    Sets V2 varBindIndex for GetNext request

    Throws:
    AgentSnmpException

    isNoNextObject

    boolean isNoNextObject(VarBindAndFailure vbFail2)

    setErrvalue

    void setErrvalue(SnmpVarBind varb1,
                     VarBindAndFailure vbfail1,
                     SnmpPDU pdu)

    setErrorValueForGetVarBind

    void setErrorValueForGetVarBind(VarBindAndFailure vbfail1,
                                    SnmpVarBind varb1,
                                    int index,
                                    AgentResource agentSource)
    Set errvalue (varbindIndex in V2) for get and GetNext failures


    isValidErrValue

    boolean isValidErrValue(byte val)
    Checks if we have a valid errvalue


    getNextSubId

    int getNextSubId(SnmpVarBind varb)

    getNextSubId

    int getNextSubId(int pos)

    getSubId

    int getSubId(SnmpVarBind varb)

    setRequestCell

    void setRequestCell(AgentNode cell)
    method called ny VarBindRequestManager


    getRequestCell

    AgentNode getRequestCell()
    Getter method called ny PduRequestHandler