com.sun.jaw.snmp.common
Class SnmpStatusException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.sun.jaw.snmp.common.SnmpStatusException

public class SnmpStatusException
extends java.lang.Exception
implements SnmpDefinitions

The SnmpStatusException class reports an error which occurred during a get/set operation on an mib node. This exception includes a status error code as defined in SNMP protocol.

See Also:
Serialized Form

Field Summary
static int badValue
          Error code as defined in RFC 1448 for: badValue.
protected  int errorIndex
          Index of the error.
protected  int errorStatus
          Status of the error.
static int noAccess
          Error code as defined in RFC 1448 for: noAccess.
static int noSuchInstance
          Error code for reporting a no such instance error.
static int noSuchName
          Error code as defined in RFC 1448 for: noSuchName.
static int noSuchObject
          Error code for reporting a no such object error.
static int readOnly
          Error code as defined in RFC 1448 for: readOnly.
 
Constructor Summary
SnmpStatusException(int status)
          Constructs a new SnmpStatusException with the specified status error.
SnmpStatusException(int status, int index)
          Constructs a new SnmpStatusException with the specified status error and status index.
SnmpStatusException(SnmpStatusException x, int index)
          Constructs a new SnmpStatusException with an error index.
SnmpStatusException(java.lang.String s)
          Constructs a new SnmpStatusException with an error message.
 
Method Summary
 int getErrorIndex()
          Returns the index of the error.
 int getStatus()
          Return the error status.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

noSuchName

public static final int noSuchName
Error code as defined in RFC 1448 for: noSuchName.

badValue

public static final int badValue
Error code as defined in RFC 1448 for: badValue.

readOnly

public static final int readOnly
Error code as defined in RFC 1448 for: readOnly.

noAccess

public static final int noAccess
Error code as defined in RFC 1448 for: noAccess.

noSuchInstance

public static final int noSuchInstance
Error code for reporting a no such instance error.

noSuchObject

public static final int noSuchObject
Error code for reporting a no such object error.

errorStatus

protected int errorStatus
Status of the error.

errorIndex

protected int errorIndex
Index of the error. If different from -1, indicates the index where the error occurs.
Constructor Detail

SnmpStatusException

public SnmpStatusException(int status)
Constructs a new SnmpStatusException with the specified status error.
Parameters:
status - The error status.

SnmpStatusException

public SnmpStatusException(int status,
                           int index)
Constructs a new SnmpStatusException with the specified status error and status index.
Parameters:
status - The error status.
index - The error index.

SnmpStatusException

public SnmpStatusException(java.lang.String s)
Constructs a new SnmpStatusException with an error message.
Parameters:
s - The error message.

SnmpStatusException

public SnmpStatusException(SnmpStatusException x,
                           int index)
Constructs a new SnmpStatusException with an error index.
Parameters:
x - The original SnmpStatusException.
index - The error index.
Method Detail

getStatus

public int getStatus()
Return the error status.
Returns:
The error status.

getErrorIndex

public int getErrorIndex()
Returns the index of the error. A value of -1 means that the index is not known/applicable.
Returns:
The error index.