com.adventnet.snmp.snmp2.agent
Class VarBindAndFailure

java.lang.Object
  extended by com.adventnet.snmp.snmp2.agent.VarBindAndFailure

public class VarBindAndFailure
extends java.lang.Object

This class contains the VarBind and errstat value.

Takes care of v1 and v2c differences which are necessary.

API Users would need this class when spcifying error conditions to AdventNet extensible agent.

See Also:
SnmpVarBind

Field Summary
(package private)  SnmpVarBind varbind
           
 
Constructor Summary
VarBindAndFailure()
           
VarBindAndFailure(AgentSnmpException ae, int index)
          Constructor for VarBindAndFailure
VarBindAndFailure(int errIndex, byte errstat, byte errvalue)
          Constructor for VarBindAndFailure
 
Method Summary
(package private)  void fillVarBindIndex(SnmpVarBind varbind, int version)
          Used by classes internal to the agent library to generate the varbindIndex for V2c (noSuchObject , noSuchInstance and endOfMibView)
 int getErrindex()
          Sets the index of the VarBind in the PduRequestEvent which has been the cause of failure
 byte getErrstat()
          Get the errstat value
 byte getErrvalue()
          Get the error value associated with the varbind.
 void setErrindex(int index)
          Sets the index of the VarBind in the PduRequestEvent which has been the cause of failure
 void setErrstat(byte err)
          Sets the errstat value (the cause of error)
 void setErrvalue(byte errvalue)
          Set the error value associated with the varbind.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

varbind

SnmpVarBind varbind
Constructor Detail

VarBindAndFailure

public VarBindAndFailure(int errIndex,
                         byte errstat,
                         byte errvalue)
Constructor for VarBindAndFailure

Parameters:
int - errIndex index in the PduRequestEvent varbindList
int - errstat value
errvalue - to be set in case of V2c

VarBindAndFailure

public VarBindAndFailure(AgentSnmpException ae,
                         int index)
Constructor for VarBindAndFailure

Parameters:
ae - the AgentSnmpException
index - the varbind index causes error/failure

VarBindAndFailure

VarBindAndFailure()
Method Detail

setErrstat

public void setErrstat(byte err)
Sets the errstat value (the cause of error)

Parameters:
err - The error status value.
See Also:
SnmpAPI, getErrstat()

getErrstat

public byte getErrstat()
Get the errstat value

Returns:
the error status.
See Also:
SnmpAPI, setErrstat(byte)

getErrvalue

public byte getErrvalue()
Get the error value associated with the varbind.

Returns:
the value of the error.
See Also:
setErrvalue(byte)

setErrvalue

public void setErrvalue(byte errvalue)
Set the error value associated with the varbind.

Parameters:
errvalue - The value of the error.
See Also:
getErrvalue()

setErrindex

public void setErrindex(int index)
Sets the index of the VarBind in the PduRequestEvent which has been the cause of failure

Parameters:
index - the Error index to be set
See Also:
SnmpVarBind, getErrindex()

getErrindex

public int getErrindex()
Sets the index of the VarBind in the PduRequestEvent which has been the cause of failure

Returns:
The Error Index of this event
See Also:
SnmpVarBind, setErrindex(int)

fillVarBindIndex

void fillVarBindIndex(SnmpVarBind varbind,
                      int version)
Used by classes internal to the agent library to generate the varbindIndex for V2c (noSuchObject , noSuchInstance and endOfMibView)

Parameters:
varbind - SnmpVarBind which is failed
version - of the pdu