com.sun.jaw.snmp.agent
Class SnmpMib

java.lang.Object
  |
  +--com.sun.jaw.snmp.agent.SnmpMibAgent
        |
        +--com.sun.jaw.snmp.agent.SnmpMib

public abstract class SnmpMib
extends SnmpMibAgent
implements java.io.Serializable

The SnmpMib is an abstract class for representing a SNMP MIB. When compiling a SNMP MIB, among all the classes generated by mibgen, there is one which extends SnmpMib for representing a whole MIB.
The class is used by the SNMP adaptor as the entry point in the MIB.

See Also:
Serialized Form

Field Summary
protected  com.sun.jaw.snmp.agent.internal.SnmpMibOid root
          The top element in the Mib tree.
 
Fields inherited from class com.sun.jaw.snmp.agent.SnmpMibAgent
cmf, mibName
 
Constructor Summary
SnmpMib()
          Default constructor.
 
Method Summary
 void check(java.util.Vector list)
          Checks if a set operation can be performed.
 void get(java.util.Vector list, int version)
          Processes a get operation.
 void getBulk(java.util.Vector list, int nonRepeat, int maxRepeat, int version)
          Processes a getBulk operation.
 void getNext(java.util.Vector list, int version)
          Processes a getNext operation.
 long[] getRootOid()
          Gets the root Object identifier of the MIB.
 void set(java.util.Vector list, int version)
          Processes a set operation.
 
Methods inherited from class com.sun.jaw.snmp.agent.SnmpMibAgent
getBindingState, getBulkWithGetNext, getFramework, getMibName, getSnmpAdaptor, getSnmpAdaptorName, init, initCmf, setSnmpAdaptor, setSnmpAdaptorName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected com.sun.jaw.snmp.agent.internal.SnmpMibOid root
The top element in the Mib tree.
Constructor Detail

SnmpMib

public SnmpMib()
Default constructor. It initializes the oid tree.
Method Detail

get

public void get(java.util.Vector list,
                int version)
         throws SnmpStatusException
Processes a get operation.
Parameters:
list - The variable list to be retrieved. The list is a vector of SnmpVarBind object.
version - The version of the protocol for the requested operation.
Returns:
The list variable should be updated with the result of the operation.
Throws:
SnmpStatusException - An error occured during the operation.
Overrides:
get in class SnmpMibAgent
See Also:
SnmpVarBind

set

public void set(java.util.Vector list,
                int version)
         throws SnmpStatusException
Processes a set operation.
Parameters:
list - The variable list to be set. The list is a vector of SnmpVarBind object.
version - The version of the protocol for the requested operation.
Returns:
The list variable should be updated with the result of the operation.
Throws:
SnmpStatusException - An error occured during the operation.
Overrides:
set in class SnmpMibAgent
See Also:
SnmpVarBind

getNext

public void getNext(java.util.Vector list,
                    int version)
             throws SnmpStatusException
Processes a getNext operation.
Parameters:
list - The variable list to be retrieved. The list is a vector of SnmpVarBind object.
version - The version of the protocol for the requested operation.
Returns:
The list variable should be updated with the result of the operation.
Throws:
SnmpStatusException - An error occured during the operation.
Overrides:
getNext in class SnmpMibAgent
See Also:
SnmpVarBind

getBulk

public void getBulk(java.util.Vector list,
                    int nonRepeat,
                    int maxRepeat,
                    int version)
             throws SnmpStatusException
Processes a getBulk operation. The method implements the getBulk operation by calling appropriately the getNext method.
Parameters:
list - The variable list to be retrieved. A vector of SnmpVarBind objects.
nonRepeat - The number of variables, starting with the dirst variable in the variable-bindings, for which a single lexicographic successor is requested.
maxRepeat - The number of lexicographic successors requested for each of the last R variables. R is the number of variables following the first nonRepeat variables for which multiple lexicographic successors are requested.
version - The version of the protocol for the requested operation.
Returns:
The list variable should be updated with the result of the operation.
Throws:
SnmpStatusException - An error occured during the operation.
Overrides:
getBulk in class SnmpMibAgent
See Also:
SnmpVarBind

check

public void check(java.util.Vector list)
           throws SnmpStatusException
Checks if a set operation can be performed. If the operation can not be performed, the method should emit a SnmpStatusException.
Parameters:
list - The variable list to be set. The list is a vector of SnmpVarBind object.
Throws:
SnmpStatusException - An error occured during the operation.
Overrides:
check in class SnmpMibAgent
See Also:
SnmpVarBind

getRootOid

public long[] getRootOid()
Gets the root Object identifier of the MIB. In order to be accurate, the method should be called once the MIB is fully initialized (i.e. after a call to init or initCmf).
Returns:
The root object identifier.
Overrides:
getRootOid in class SnmpMibAgent