com.adventnet.snmp.beans
Class SnmpResultObject

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

public class SnmpResultObject
extends java.lang.Object
implements java.io.Serializable

This class contains methods to get all valid and errored responses. This also has method to get the status of the SNMP request made (ie) whether the varbinds in the request sent were all correct (SUCCESS) or all errored (NOSUCCESS) or a mixed of both (PARTIAL).

See Also:
Serialized Form

Field Summary
static int NOSUCCESS
           
static int PARTIAL
           
static int SUCCESS
           
 
Constructor Summary
(package private) SnmpResultObject()
          Default Constructor
 
Method Summary
 java.util.Hashtable getErrorResult()
          This will return a Hashtable which will contain a list of elements corresponding to the errored varbinds.
 java.util.Vector getResult()
          This will return a Vector of successful operation string values.
 int getSuccessCode()
          This method will get the success code of this ResultObject.
(package private)  void setErrorResult(java.util.Hashtable errTable)
          Puts a new entry in the hashtable.
(package private)  void setResult(java.util.Vector resultVector)
          This will add the given successful operation string to the vector.
(package private)  void setSuccessCode(int successCode)
          This method will set the success code on this ResultObject.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static int SUCCESS

PARTIAL

public static int PARTIAL

NOSUCCESS

public static int NOSUCCESS
Constructor Detail

SnmpResultObject

SnmpResultObject()
Default Constructor
Method Detail

setSuccessCode

void setSuccessCode(int successCode)
This method will set the success code on this ResultObject.
Parameters:
successCode - The value to be set which can be any one of SUCCESS , PARTIAL , NOSUCCESS .

getSuccessCode

public int getSuccessCode()
This method will get the success code of this ResultObject.
Returns:
The success code corresponding to this ResultObject. It will be any one of SUCCESS , PARTIAL (or) NOSUCCESS .

getResult

public java.util.Vector getResult()
This will return a Vector of successful operation string values.
Returns:
Vector containing string values of the form oid : value corresponding to successful SNMP operation.

setResult

void setResult(java.util.Vector resultVector)
This will add the given successful operation string to the vector.
Parameters:
resultVector - A Vector of elements containing the successful response strings of the form oid : value.

getErrorResult

public java.util.Hashtable getErrorResult()
This will return a Hashtable which will contain a list of elements corresponding to the errored varbinds. The key will be the index of the errored varbind in the varbind list and the value will be the error code corresponding to this index.
Returns:
Hashtable with error index and error code.

setErrorResult

void setErrorResult(java.util.Hashtable errTable)
Puts a new entry in the hashtable. Maps the specified errorIndex to the given errorCode in the hashtable.
Parameters:
errorTable - containing the key as the index where the errored varbind is in the varbind list and value as the corresponding error code.