com.adventnet.snmp.mibs
Class MibErrorMessages

java.lang.Object
  |
  +--com.adventnet.snmp.mibs.MibErrorMessages

public class MibErrorMessages
extends java.lang.Object

The MibErrorMessages contains the information about the error corresponding to a particular check. All the error in the MIB corresponding to the particular check are stored in a single MibErrorMessages object.

A typical error message will look as follows

ERR-168     The IMPLIED keyword can be associated only with the last object in the INDEX clause.
lineNo     colNo     Error
329 8 The index 'advNumIndex' defined as IMPLIED, is not the last object
1118 12 The index 'advCountIndex' defined as IMPLIED, is not the last object

The MibErrorMessages can be obtained as follows

 Vector errVect = mibops.getErrorMessages("moduleName");
 if(!errVect.isEmpty())
 {
  MibErrorMessages mibErrMesg = (MibErrorMessages)errVect.elementAt(0);
 }
 

The size of the Vector will be the number of grouped error available in the MIB. If there are no error in the MIB then the Vector will be empty.

Since:
AdventNet SNMP API 4

Field Summary
(package private)  java.util.Vector errMsgVect
           
(package private)  java.lang.String errorMessage
           
(package private)  byte errorNo
           
 
Constructor Summary
(package private) MibErrorMessages()
           
(package private) MibErrorMessages(byte errNo, java.lang.String errorMsg)
           
 
Method Summary
 byte getErrorCode()
          Gets the error code in byte.
 java.lang.String getErrorMessage()
          Gets the general error message associated with this error.
(package private)  int getErrorNo()
          Returns the Error number.
 java.util.Vector getErrorObjects()
          Returns a Vector of ErrorObject objects corresponding to this error.
 java.lang.String getType()
          Returns the type of the error.
(package private)  void setErrorNo(byte error)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorNo

byte errorNo

errorMessage

java.lang.String errorMessage

errMsgVect

java.util.Vector errMsgVect
Constructor Detail

MibErrorMessages

MibErrorMessages()

MibErrorMessages

MibErrorMessages(byte errNo,
                 java.lang.String errorMsg)
Method Detail

getErrorNo

int getErrorNo()
Returns the Error number.

getErrorCode

public byte getErrorCode()
Gets the error code in byte.
Returns:
byte - the error code

setErrorNo

void setErrorNo(byte error)

getErrorMessage

public java.lang.String getErrorMessage()
Gets the general error message associated with this error. Considering the example error message given in the introduction of this class this method will return the String "The IMPLIED keyword can be associated only with the last object in the INDEX clause."
Returns:
String - the general error message for this error.

getType

public java.lang.String getType()
Returns the type of the error. The types of error are CRT, ERR and INF. The type CRT denotes that the error is very critical. The MIB will not be loaded if it encounters any critical error.
ERR indicates the next level of errors. INF denotes that the message is an information.

Considering the example error message given in the introduction of this class this method will return the String "ERR-168".

Returns:
the error type as String

getErrorObjects

public java.util.Vector getErrorObjects()
Returns a Vector of ErrorObject objects corresponding to this error.

This ErrorObject contains the line number, column number and the specific error message.

In the example given above, the line number '329' column number '8' and the error String "The index 'advNumIndex' defined as IMPLIED, is not the last object" constitute a single ErrorObject. The size of the Vector returned by this method will be the number of such errors present in the MIB corresponding to the specific check.

Returns:
Vector of ErrorObject objects