com.sun.jaw.snmp.manager
Class MibStore

java.lang.Object
  |
  +--com.sun.jaw.snmp.manager.MibStore

public class MibStore
extends java.lang.Object
implements MibStoreIfSrv, SnmpDataTypeEnums

This class maintains a database of management information base (MIB) variables. Each entry in database contains a name, a dot-separated OID string, and the corresponding SMI type of the variable. A name can be resolved against the database. If the variable is not found an exception is raised.


Constructor Summary
MibStore()
          Default constructor.
 
Method Summary
static void addMib(MibStoreIfSrv aStore)
          This method loads all of the MIB entries of object which supports the MibStoreIfSrv.
 SnmpOid getSysUpTimeOid()
          Gets the object identifier corresponding to SysUpTimeOid as defined in MIBII.
 SnmpOid getSysUpTimeOid0()
          Gets the object identifier corresponding to SysUpTimeOid variable instance.
static void loadMib(java.lang.String[][] mibs)
          Loads a list of variables into the storage area, which is kept in memory.
 int mapNameToType(java.lang.String s)
          Returns the type code as defined in SnmpDataTypeEnums if it is given the code name of a type (as stored in a MibStoreIfSrv).
 java.lang.String mapTypeToName(int type)
          Returns the string representation of a type if it is given the type code.
 java.util.Vector mibElements()
          Returns a list that can be used to traverse the MIB database currently loaded in MIB store house.
 java.lang.String[] resolveMibVariable(java.lang.String name)
          Searches for the variable or the OID and returns the array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MibStore

public MibStore()
         throws SnmpStatusException
Default constructor.
Throws:
SnmpStatusException - An error occurred while accessing a MIB node.
Method Detail

mibElements

public java.util.Vector mibElements()
Returns a list that can be used to traverse the MIB database currently loaded in MIB store house.
Specified by:
mibElements in interface MibStoreIfSrv
Returns:
Vector for the MIB elements. A MIB element is an array of Strings. A MIB element contains a name, a dot-separated OID String, and the corresponding SMI type of the variable.

resolveMibVariable

public java.lang.String[] resolveMibVariable(java.lang.String name)
                                      throws SnmpStatusException
Searches for the variable or the OID and returns the array. The method allows to query the metadata. One can retrieve metadata information associated to a SNMP variable, an object identifier, or an object identifier prefixed with '.' (ala CMU).
Specified by:
resolveMibVariable in interface MibStoreIfSrv
Parameters:
name - The name of the MIB variable.
Returns:
Array of a string containing parameters.
Throws:
SnmpStatusException - If a variable is not found.

loadMib

public static void loadMib(java.lang.String[][] mibs)
Loads a list of variables into the storage area, which is kept in memory. If you have new MIB variables, this method can be called to load them.
Parameters:
mibs - The list of variables to load.

addMib

public static void addMib(MibStoreIfSrv aStore)
                   throws SnmpStatusException
This method loads all of the MIB entries of object which supports the MibStoreIfSrv. If there are any MIB variables which have the same name as previous loaded variables the previously loaded variables will be overwritten.
Parameters:
aStore - The MibStoreIfSrv.
Throws:
SnmpStatusException - An error occurred while accessing a MIB node.

mapTypeToName

public java.lang.String mapTypeToName(int type)
Returns the string representation of a type if it is given the type code. The names returned can be one of:

mapNameToType

public int mapNameToType(java.lang.String s)
Returns the type code as defined in SnmpDataTypeEnums if it is given the code name of a type (as stored in a MibStoreIfSrv).
Specified by:
mapNameToType in interface MibStoreIfSrv
Parameters:
s - The code name of a type.
Returns:
The type code.

getSysUpTimeOid

public SnmpOid getSysUpTimeOid()
                        throws SnmpStatusException
Gets the object identifier corresponding to SysUpTimeOid as defined in MIBII.
Returns:
The corresponding object identifier.
Throws:
SnmpStatusException - If SysUpTimeOid is not definied in the repository.
See Also:
getSysUpTimeOid0()

getSysUpTimeOid0

public SnmpOid getSysUpTimeOid0()
                         throws SnmpStatusException
Gets the object identifier corresponding to SysUpTimeOid variable instance.
Returns:
The corresponding object identifier.
Throws:
SnmpStatusException - If SysUpTimeOid is not definied in the repository.
See Also:
getSysUpTimeOid()