com.adventnet.snmp.beans
Class ErrorMessages

java.lang.Object
  |
  +--com.adventnet.snmp.beans.ErrorMessages

public class ErrorMessages
extends java.lang.Object

This gets the actual error messages returned by the low level api if any. If the error is from the high level api then the return value of this is same as that of getErrorString().

You can use getErrorCode()from the bean you are using, which returns an int value. Use the static method of this class getErrorString(int index) of this class to get the corresponding error message. The following errors are defined as Snmp Errors. SNMP_ERR_NOERROR,SNMP_ERR_TOOBIG,SNMP_ERR_NOSUCHNAME,SNMP_ERR_BADVALUE, SNMP_ERR_READONLY,SNMP_ERR_GENERR,SNMP_ERR_NOACCESS,SNMP_ERR_WRONGTYPE, SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING,SNMP_ERR_WRONGVALUE, SNMP_ERR_NOCREATION,SNMP_ERR_INCONSISTENTVALUE,SNMP_ERR_RESOURCEUNAVAILABLE SNMP_ERR_COMMITFAILED,SNMP_ERR_UNDOFAILED,SNMP_ERR_AUTHORIZATIONERROR, SNMP_ERR_NOTWRITABLE,SNMP_ERR_INCONSISTENTNAME,SNMP_NOT_INIT, NOSUCHOBJECTEXP,NOSUCHINSTANCEEXP,ENDOFMIBVIEWEXP.


Field Summary
static int ASN1_ERROR_ERR
          Error Code Constant This is set when a error occurs while parsing the snmp message.
static int DECRYPT_ERROR_ERR
          Error Code Constant This is set when the Decryption fails at the authoratative engine(agent) side.
static int DISCOVERY_FAILED
          Error Code Constant This is set when the Discovery faile
static int EMPTY_DATA
          Error Code Constant This is set when the agent returns an empty data.
static int EMPTY_VAR_BIND
          Error Code Constant This is set when the agent returns an empty VarBind.
static int EMPTY_VARIABLE
          Error Code Constant This is set when the agent returns an empty variable.
static int ENDOFMIBVIEWEXP
          Error Code Constant This is set when and SNMP Exception occurs.
static int ERR_CREATING_VARIABLE
          Error Code Constant This is set when an error occurs while creating a variable
static int EXT_INDEX_UNAVAIL
          Error Code Constant This is set when the external index for a table is not available.
static int ILLEGAL_ARG
          Error Code Constant This is set when we pass a illegal argument for a method.
static int INVALID_CONTEXT_ID
          Error Code Constant This is set when we set a invalid Context ID.
static int INVALID_CONTEXT_NAME
          Error Code Constant This is set when we set a invalid Context Name.
static int INVALID_GENERIC_TYPE
          Error Code Constant This is set when we give a invalid generic type value.
static int INVALID_NON_REP
          Error Code Constant This is set when we set an Invalid Non-Repeater value.
static int INVALID_NUMERIC_VAL
          Error Code Constant This is set when an agent returns a non-numeric value when we expect a numeric value.
static int INVALID_TABLE_OID
          Error Code Constant This is set when we give an invalid Table OID when setting the Table OID.
static int INVALID_V1_REQ
          Error Code Constant This is set when the user makes a invalid request.
static int INVALID_VERSION
          Error Code Constant This is set when we set an invalid version on the target.
static int IO_ERROR
          Error Code Constant This is set when an IO Error occurs when connecting to a Remote Host.
static int IP_ADDR_NOT_SPECIFIED
          Error Code Constant This is set when the remote Ip address is not specified.
static int MIB_NODE_UNAVAIL
          Error Code Constant This is set when the Mib-Node is not available for an OID specified during a set request.
static int NO_ERR_REGISTERED
          Error Code Constant This is the default value of ErrorCode.
static int NOSUCHINSTANCEEXP
          Error Code Constant This is set when and SNMP Exception occurs.
static int NOSUCHOBJECTEXP
          Error Code Constant This is set when and SNMP Exception occurs.
static int NOT_IN_TIME_WINDOWS_ERR
          Error Code Constant This is set when there is no time Synchronization between the authoratative engine(agent) and the non-authoratative engine(manager).
static int OID_NOT_LEAF
          Error Code Constant This is set when OID is not a leaf node when we expect it be a leaf node.
static int OID_NOT_SPECIFIED
          Error Code Constant This is set when the OID('s) is not Specified before making a request.
static int REQ_TIMEDOUT
          Error Code Constant This is set when the agent Times Out.
static int SECURITYEXP_CONNECTING_REMOTE_HOST
          Error Code Constant This is set when an security exception is got when conncecting to a Remote Host.
static int SESSION_REMOTE_HOST_UNKNOWN
          Error Code Constant This is set when the Session's remote host is not known.
static int SNMP_ERR_AUTHORIZATIONERROR
          Error Code Constant This is set when there is an SNMP Error:AuthorizationError
static int SNMP_ERR_BADVALUE
          Error Code Constant This is set when there is an SNMP Error: Bad Value
static int SNMP_ERR_COMMITFAILED
          Error Code Constant This is set when there is an SNMP Error:commitFailed
static int SNMP_ERR_GENERR
          Error Code Constant This is set when there is an SNMP Error:genErr
static int SNMP_ERR_INCONSISTENTNAME
          Error Code Constant This is set when there is an SNMP Error:inconsistentName
static int SNMP_ERR_INCONSISTENTVALUE
          Error Code Constant This is set when there is an SNMP Error:inconsistentValue
static int SNMP_ERR_NOACCESS
          Error Code Constant This is set when there is an SNMP Error:No Access
static int SNMP_ERR_NOCREATION
          Error Code Constant This is set when there is an SNMP Error:errNotification
static int SNMP_ERR_NOERROR
          Error Code Constant This is set when there is an SNMP Error No Error
static int SNMP_ERR_NOSUCHNAME
          Error Code Constant This is set when there is an SNMP Error: No Such Name
static int SNMP_ERR_NOTWRITABLE
          Error Code Constant This is set when there is an SNMP Error:notWritable
static int SNMP_ERR_READONLY
          Error Code Constant This is set when there is an SNMP Error: ReadOnly
static int SNMP_ERR_RESOURCEUNAVAILABLE
          Error Code Constant This is set when there is an SNMP Error:resourceUnavailable
static int SNMP_ERR_TOOBIG
          Error Code Constant This is set when there is an SNMP Error: Too Big
static int SNMP_ERR_UNDOFAILED
          Error Code Constant This is set when there is an SNMP Error:undoFailed
static int SNMP_ERR_WRONGENCODING
          Error Code Constant This is set when there is an SNMP Error:WrongEncoding
static int SNMP_ERR_WRONGLENGTH
          Error Code Constant This is set when there is an SNMP Error:WrongLength
static int SNMP_ERR_WRONGTYPE
          Error Code Constant This is set when there is an SNMP Error:WrongType
static int SNMP_ERR_WRONGVALUE
          Error Code Constant This is set when there is an SNMP Error:WrongValue
static int SNMP_NOT_INIT
          Error Code Constant This is set when the class SnmpAPI is not initialized.
static int TIME_SYNC_FAILED
          Error Code Constant This is set when the Time Synchronization fails
static int UKNOWN_ENGINEID_ERR
          Error Code Constant This is set when the Invalid engine Id is sent to the agent.
static int UKNOWN_USERNAMES_ERR
          Error Code Constant This is set when the user is not configured on the authoratatie engine(agent side).
static int UNKNOWN_ERR
          Error Code Constant This is set when an Unknown error not listed in this code occurs
static int UNSUPP_SECLEVEL_ERR
          Error Code Constant This is set when an unsupported Security Level error occurs.
static int VAR_BIND_OUT_OF_RANGE
          Error Code Constant This is set when the VarBind is out of range.
static int WRONG_DIGEST_ERR
          Error Code Constant This is set when we specify a wrong MessageDigest(authentication&privacy parameters) in the V3 message.
 
Constructor Summary
ErrorMessages()
          Class to get the actual error messages returned by the low level api if any.
 
Method Summary
static java.lang.String getErrorString(int index)
          Method to get the error string corresponding to the particular error code value.
static void printToFile(java.lang.String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SNMP_ERR_NOERROR

public static final int SNMP_ERR_NOERROR
Error Code Constant This is set when there is an SNMP Error No Error

SNMP_ERR_TOOBIG

public static final int SNMP_ERR_TOOBIG
Error Code Constant This is set when there is an SNMP Error: Too Big

SNMP_ERR_NOSUCHNAME

public static final int SNMP_ERR_NOSUCHNAME
Error Code Constant This is set when there is an SNMP Error: No Such Name

SNMP_ERR_BADVALUE

public static final int SNMP_ERR_BADVALUE
Error Code Constant This is set when there is an SNMP Error: Bad Value

SNMP_ERR_READONLY

public static final int SNMP_ERR_READONLY
Error Code Constant This is set when there is an SNMP Error: ReadOnly

SNMP_ERR_GENERR

public static final int SNMP_ERR_GENERR
Error Code Constant This is set when there is an SNMP Error:genErr

SNMP_ERR_NOACCESS

public static final int SNMP_ERR_NOACCESS
Error Code Constant This is set when there is an SNMP Error:No Access

SNMP_ERR_WRONGTYPE

public static final int SNMP_ERR_WRONGTYPE
Error Code Constant This is set when there is an SNMP Error:WrongType

SNMP_ERR_WRONGLENGTH

public static final int SNMP_ERR_WRONGLENGTH
Error Code Constant This is set when there is an SNMP Error:WrongLength

SNMP_ERR_WRONGENCODING

public static final int SNMP_ERR_WRONGENCODING
Error Code Constant This is set when there is an SNMP Error:WrongEncoding

SNMP_ERR_WRONGVALUE

public static final int SNMP_ERR_WRONGVALUE
Error Code Constant This is set when there is an SNMP Error:WrongValue

SNMP_ERR_NOCREATION

public static final int SNMP_ERR_NOCREATION
Error Code Constant This is set when there is an SNMP Error:errNotification

SNMP_ERR_INCONSISTENTVALUE

public static final int SNMP_ERR_INCONSISTENTVALUE
Error Code Constant This is set when there is an SNMP Error:inconsistentValue

SNMP_ERR_RESOURCEUNAVAILABLE

public static final int SNMP_ERR_RESOURCEUNAVAILABLE
Error Code Constant This is set when there is an SNMP Error:resourceUnavailable

SNMP_ERR_COMMITFAILED

public static final int SNMP_ERR_COMMITFAILED
Error Code Constant This is set when there is an SNMP Error:commitFailed

SNMP_ERR_UNDOFAILED

public static final int SNMP_ERR_UNDOFAILED
Error Code Constant This is set when there is an SNMP Error:undoFailed

SNMP_ERR_AUTHORIZATIONERROR

public static final int SNMP_ERR_AUTHORIZATIONERROR
Error Code Constant This is set when there is an SNMP Error:AuthorizationError

SNMP_ERR_NOTWRITABLE

public static final int SNMP_ERR_NOTWRITABLE
Error Code Constant This is set when there is an SNMP Error:notWritable

SNMP_ERR_INCONSISTENTNAME

public static final int SNMP_ERR_INCONSISTENTNAME
Error Code Constant This is set when there is an SNMP Error:inconsistentName

SNMP_NOT_INIT

public static final int SNMP_NOT_INIT
Error Code Constant This is set when the class SnmpAPI is not initialized.

INVALID_VERSION

public static final int INVALID_VERSION
Error Code Constant This is set when we set an invalid version on the target. For instance if we set version V1 incase of V2 request.

OID_NOT_SPECIFIED

public static final int OID_NOT_SPECIFIED
Error Code Constant This is set when the OID('s) is not Specified before making a request. This may happen when the user do not specify a OID(s)before making an snmp Request. This is applicable even for trapOID suppose if the user sends a trap.

REQ_TIMEDOUT

public static final int REQ_TIMEDOUT
Error Code Constant This is set when the agent Times Out.

INVALID_V1_REQ

public static final int INVALID_V1_REQ
Error Code Constant This is set when the user makes a invalid request. For instance if we make a getBulk request incase of a v1 agent. This is generally for Asynchronous getbulk request.

EMPTY_VAR_BIND

public static final int EMPTY_VAR_BIND
Error Code Constant This is set when the agent returns an empty VarBind.

INVALID_NON_REP

public static final int INVALID_NON_REP
Error Code Constant This is set when we set an Invalid Non-Repeater value. For instance if we set a non-repeater value greater than the OID Size.

EMPTY_DATA

public static final int EMPTY_DATA
Error Code Constant This is set when the agent returns an empty data.

VAR_BIND_OUT_OF_RANGE

public static final int VAR_BIND_OUT_OF_RANGE
Error Code Constant This is set when the VarBind is out of range. For instance if we try to retrieve a varbind based on its index and if the index specified is out of range in the list of varbinds.

EMPTY_VARIABLE

public static final int EMPTY_VARIABLE
Error Code Constant This is set when the agent returns an empty variable.

INVALID_NUMERIC_VAL

public static final int INVALID_NUMERIC_VAL
Error Code Constant This is set when an agent returns a non-numeric value when we expect a numeric value.

MIB_NODE_UNAVAIL

public static final int MIB_NODE_UNAVAIL
Error Code Constant This is set when the Mib-Node is not available for an OID specified during a set request.

OID_NOT_LEAF

public static final int OID_NOT_LEAF
Error Code Constant This is set when OID is not a leaf node when we expect it be a leaf node.

ERR_CREATING_VARIABLE

public static final int ERR_CREATING_VARIABLE
Error Code Constant This is set when an error occurs while creating a variable

ILLEGAL_ARG

public static final int ILLEGAL_ARG
Error Code Constant This is set when we pass a illegal argument for a method.

INVALID_GENERIC_TYPE

public static final int INVALID_GENERIC_TYPE
Error Code Constant This is set when we give a invalid generic type value. For instance the generic value ranges from 0-6. If we give a value other than inbetween this range, this constant will be set.

IP_ADDR_NOT_SPECIFIED

public static final int IP_ADDR_NOT_SPECIFIED
Error Code Constant This is set when the remote Ip address is not specified. i.e when the host is not specified.

SESSION_REMOTE_HOST_UNKNOWN

public static final int SESSION_REMOTE_HOST_UNKNOWN
Error Code Constant This is set when the Session's remote host is not known. i.e when the host is not known.

SECURITYEXP_CONNECTING_REMOTE_HOST

public static final int SECURITYEXP_CONNECTING_REMOTE_HOST
Error Code Constant This is set when an security exception is got when conncecting to a Remote Host.

IO_ERROR

public static final int IO_ERROR
Error Code Constant This is set when an IO Error occurs when connecting to a Remote Host.

INVALID_TABLE_OID

public static final int INVALID_TABLE_OID
Error Code Constant This is set when we give an invalid Table OID when setting the Table OID.

EXT_INDEX_UNAVAIL

public static final int EXT_INDEX_UNAVAIL
Error Code Constant This is set when the external index for a table is not available.

INVALID_CONTEXT_NAME

public static final int INVALID_CONTEXT_NAME
Error Code Constant This is set when we set a invalid Context Name.

INVALID_CONTEXT_ID

public static final int INVALID_CONTEXT_ID
Error Code Constant This is set when we set a invalid Context ID.

UNKNOWN_ERR

public static final int UNKNOWN_ERR
Error Code Constant This is set when an Unknown error not listed in this code occurs

UNSUPP_SECLEVEL_ERR

public static final int UNSUPP_SECLEVEL_ERR
Error Code Constant This is set when an unsupported Security Level error occurs. For instance when you specify an security level other than NoAuthNoPriv, authNoPriv,authPriv.

NOT_IN_TIME_WINDOWS_ERR

public static final int NOT_IN_TIME_WINDOWS_ERR
Error Code Constant This is set when there is no time Synchronization between the authoratative engine(agent) and the non-authoratative engine(manager).

UKNOWN_USERNAMES_ERR

public static final int UKNOWN_USERNAMES_ERR
Error Code Constant This is set when the user is not configured on the authoratatie engine(agent side).

UKNOWN_ENGINEID_ERR

public static final int UKNOWN_ENGINEID_ERR
Error Code Constant This is set when the Invalid engine Id is sent to the agent.

WRONG_DIGEST_ERR

public static final int WRONG_DIGEST_ERR
Error Code Constant This is set when we specify a wrong MessageDigest(authentication&privacy parameters) in the V3 message.

DECRYPT_ERROR_ERR

public static final int DECRYPT_ERROR_ERR
Error Code Constant This is set when the Decryption fails at the authoratative engine(agent) side.

ASN1_ERROR_ERR

public static final int ASN1_ERROR_ERR
Error Code Constant This is set when a error occurs while parsing the snmp message.

DISCOVERY_FAILED

public static final int DISCOVERY_FAILED
Error Code Constant This is set when the Discovery faile

TIME_SYNC_FAILED

public static final int TIME_SYNC_FAILED
Error Code Constant This is set when the Time Synchronization fails

NOSUCHOBJECTEXP

public static final int NOSUCHOBJECTEXP
Error Code Constant This is set when and SNMP Exception occurs. SNMP NoSuchObjectExp

NOSUCHINSTANCEEXP

public static final int NOSUCHINSTANCEEXP
Error Code Constant This is set when and SNMP Exception occurs. SNMP NoSuchInstanceExp

ENDOFMIBVIEWEXP

public static final int ENDOFMIBVIEWEXP
Error Code Constant This is set when and SNMP Exception occurs. SNMP EndOfMibViewExp

NO_ERR_REGISTERED

public static final int NO_ERR_REGISTERED
Error Code Constant This is the default value of ErrorCode. This is to indicate that no error code is registered.
Constructor Detail

ErrorMessages

public ErrorMessages()
Class to get the actual error messages returned by the low level api if any. If the error is from the high level api then the return value of this is same as that of getErrorString().
Method Detail

getErrorString

public static java.lang.String getErrorString(int index)
Method to get the error string corresponding to the particular error code value.

printToFile

public static void printToFile(java.lang.String filename)


Copyright (c)AdventNet Inc., 1996-2004