MySnmpCrawler API

snmp.lib
Class SnmpException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--snmp.lib.SnmpException
All Implemented Interfaces:
java.io.Serializable

public class SnmpException
extends java.lang.Exception

This class defines the exception that will be thrown in the system when any error occurs. It contains several types of error codes. Each error category represents the component that the exception is raised. But currently, the system does not accurately report the errors and handle them systematically. TODO: Needs a bettr way to handle errors, and a consisten format in the exception text.

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:48 $
Author:
Scott Cheng
See Also:
Serialized Form

Field Summary
static int ERR_ENCODE_DATA
           
static int ERR_MBEAN_ATTR_DATATYPPE
           
static int ERR_MBEAN_SERVER
           
static int ERR_MIB_OBJECT_DATATYPE_UNKNOWN
           
static int ERR_NO_ACCESS
           
static int ERR_NO_MBEAN
           
static int ERR_NO_MBEAN_ATTR
           
static int ERR_NO_MBEAN_META
           
static int ERR_NO_MBEAN_OPERATION
           
static int ERR_NO_MBEANINTERFACE
           
static int ERR_NO_MBEANLISTENER
           
static int ERR_NO_MBEANMETA
           
static int ERR_NO_OID_GROUP
           
static int ERR_NO_OID_RECORD
           
static int ERR_NO_PERMISSION
           
static int ERR_NO_READ_ACCESS
           
static int ERR_NO_WRITE_ACCESS
           
static int ERR_PERMISSION
           
private  int errorCode
           
private  int errorOidIndexNum
           
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
SnmpException(java.lang.Exception e)
          Constructs the SnmpException object with an Exception object.
SnmpException(java.lang.Exception e, int errorCode)
          Constructs the SnmpException object with an Exception object and an error code.
SnmpException(int errorCode)
          Constructs the SnmpException object with an error code.
SnmpException(java.lang.String s)
          Constructs the SnmpException object with a error text string.
SnmpException(java.lang.String s, int errorCode)
          Constructs the SnmpException object with a error text string and an error code.
 
Method Summary
 int getErrorCode()
          Gets the error code of the SnmpException.
 int getErrorOidIndexNum()
          Gets the index number of the OID in the PDU that has an error.
 void setErrorCode(int errorCode)
          Sets the error code of the SnmpException.
 void setErrorOidIndexNum(int indexNum)
          Sets the index number of the OID in the PDU that has an error.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERR_NO_OID_GROUP

public static final int ERR_NO_OID_GROUP
See Also:
Constant Field Values

ERR_NO_OID_RECORD

public static final int ERR_NO_OID_RECORD
See Also:
Constant Field Values

ERR_NO_READ_ACCESS

public static final int ERR_NO_READ_ACCESS
See Also:
Constant Field Values

ERR_NO_WRITE_ACCESS

public static final int ERR_NO_WRITE_ACCESS
See Also:
Constant Field Values

ERR_NO_ACCESS

public static final int ERR_NO_ACCESS
See Also:
Constant Field Values

ERR_MIB_OBJECT_DATATYPE_UNKNOWN

public static final int ERR_MIB_OBJECT_DATATYPE_UNKNOWN
See Also:
Constant Field Values

ERR_NO_MBEAN

public static final int ERR_NO_MBEAN
See Also:
Constant Field Values

ERR_NO_MBEAN_OPERATION

public static final int ERR_NO_MBEAN_OPERATION
See Also:
Constant Field Values

ERR_NO_MBEAN_ATTR

public static final int ERR_NO_MBEAN_ATTR
See Also:
Constant Field Values

ERR_NO_MBEAN_META

public static final int ERR_NO_MBEAN_META
See Also:
Constant Field Values

ERR_PERMISSION

public static final int ERR_PERMISSION
See Also:
Constant Field Values

ERR_NO_PERMISSION

public static final int ERR_NO_PERMISSION
See Also:
Constant Field Values

ERR_MBEAN_SERVER

public static final int ERR_MBEAN_SERVER
See Also:
Constant Field Values

ERR_MBEAN_ATTR_DATATYPPE

public static final int ERR_MBEAN_ATTR_DATATYPPE
See Also:
Constant Field Values

ERR_NO_MBEANMETA

public static final int ERR_NO_MBEANMETA
See Also:
Constant Field Values

ERR_NO_MBEANLISTENER

public static final int ERR_NO_MBEANLISTENER
See Also:
Constant Field Values

ERR_NO_MBEANINTERFACE

public static final int ERR_NO_MBEANINTERFACE
See Also:
Constant Field Values

ERR_ENCODE_DATA

public static final int ERR_ENCODE_DATA
See Also:
Constant Field Values

errorCode

private int errorCode

errorOidIndexNum

private int errorOidIndexNum
Constructor Detail

SnmpException

public SnmpException(java.lang.String s)
Constructs the SnmpException object with a error text string.

Parameters:
s - The error text string.

SnmpException

public SnmpException(java.lang.Exception e)
Constructs the SnmpException object with an Exception object.

Parameters:
e - The Exception object.

SnmpException

public SnmpException(int errorCode)
Constructs the SnmpException object with an error code.

Parameters:
errorCode - The error code.

SnmpException

public SnmpException(java.lang.String s,
                     int errorCode)
Constructs the SnmpException object with a error text string and an error code.

Parameters:
s - The error text string.
errorCode - The error code.

SnmpException

public SnmpException(java.lang.Exception e,
                     int errorCode)
Constructs the SnmpException object with an Exception object and an error code.

Parameters:
e - The Exception object.
errorCode - The error code.
Method Detail

getErrorCode

public int getErrorCode()
Gets the error code of the SnmpException.

Returns:
The error code.

setErrorCode

public void setErrorCode(int errorCode)
Sets the error code of the SnmpException.

Parameters:
errorCode - The error code to be set.

getErrorOidIndexNum

public int getErrorOidIndexNum()
Gets the index number of the OID in the PDU that has an error.

Returns:
The index number of the OID.
Throws:
TypeOfException - thrown when ...

setErrorOidIndexNum

public void setErrorOidIndexNum(int indexNum)
Sets the index number of the OID in the PDU that has an error.

Parameters:
indexNum - The index number of the OID.

MySnmpCrawler API