com.adventnet.snmp.snmp2.agent
Class AgentSnmpException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.adventnet.snmp.snmp2.SnmpException
                    |
                    +--com.adventnet.snmp.snmp2.agent.AgentSnmpException
Direct Known Subclasses:
AgentNoNextObject

public class AgentSnmpException
extends SnmpException

The purpose of this class is to catch and report Agent side errors.

See Also:
Serialized Form

Field Summary
(package private)  int errindex
           
(package private)  byte errstat
           
(package private)  byte errvalue
           
 
Constructor Summary
AgentSnmpException()
          Constructs a AgentSnmpException with no detail message.
AgentSnmpException(java.lang.String s)
          Constructs a AgentSnmpException with the specified detail message.
AgentSnmpException(java.lang.String s, byte errstat)
          Constructs a AgentSnmpException with the specified detail message error status.
AgentSnmpException(java.lang.String s, byte errstat, byte errvalue)
          Constructs a AgentSnmpException with the specified detail message error status and value.
 
Method Summary
 byte getErrstat()
          Gets for errstat to be sent along wih the exception which will be caught at the agentside and set to appropriate value in response PDU .
 byte getErrvalue()
          Getter for errvalue
 void setErrstat(byte errstat)
          Sets the errstat value
 void setErrvalue(byte errvalue)
          Setter for errvalue.
 java.lang.String toString()
          Getter for the string representation of the exception.
 java.lang.String toTagString()
          This method gives a descriptive message wherever possible for errstat and errvalue
 
Methods inherited from class com.adventnet.snmp.snmp2.SnmpException
exceptionString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

errstat

byte errstat

errvalue

byte errvalue

errindex

int errindex
Constructor Detail

AgentSnmpException

public AgentSnmpException()
Constructs a AgentSnmpException with no detail message.

AgentSnmpException

public AgentSnmpException(java.lang.String s)
Constructs a AgentSnmpException with the specified detail message. A detail message is a String that describes this particular exception.
Parameters:
s - the detail message

AgentSnmpException

public AgentSnmpException(java.lang.String s,
                          byte errstat)
Constructs a AgentSnmpException with the specified detail message error status.

A detail message is a String that describes this particular exception. Error status is a byte described the status of the exception.

Parameters:
s - the detail message
errstat - the error status for the Pdu

AgentSnmpException

public AgentSnmpException(java.lang.String s,
                          byte errstat,
                          byte errvalue)
Constructs a AgentSnmpException with the specified detail message error status and value.

A detail message is a String that describes this particular exception. Error status is a byte described the status of the exception. Error value is a byte described the value of the exception.

Parameters:
s - the detail message
errstat - the error status
errvalue - the errstat value to be set for the Pdu
Method Detail

setErrstat

public void setErrstat(byte errstat)
Sets the errstat value
Parameters:
errstat - the error status value

getErrstat

public byte getErrstat()
Gets for errstat to be sent along wih the exception which will be caught at the agentside and set to appropriate value in response PDU .
Returns:
errstat for this exception
See Also:
SnmpAPI

setErrvalue

public void setErrvalue(byte errvalue)
Setter for errvalue.

For V2c and v3 each varbind's errIndex is set (varbindIndex) in case of failure

Parameters:
errvalue - the error value of the exception

getErrvalue

public byte getErrvalue()
Getter for errvalue

For V2c and v3 each varbind's errIndex is set (varbindIndex) in case of failure

Returns:
the error value of the exception.

toString

public java.lang.String toString()
Getter for the string representation of the exception.
Overrides:
toString in class java.lang.Throwable
Returns:
the exception string.

toTagString

public java.lang.String toTagString()
This method gives a descriptive message wherever possible for errstat and errvalue
Returns:
the detailed exception string.