|
MySnmpCrawler API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--snmp.mibdb.MibDatabase | +--snmp.mibdb.MibDatabaseImpl
This class reads the MIB file and loads the mib tree into a link list. Each node in the link list represents a object variable in the MIB file. Each object variable contains a reference to its parent variable and a list of child variables. In order to access the object variable efficiently, it also contains a hash map that can access the variable object group directly.
Field Summary | |
private java.util.HashMap |
indexList
|
private static MibDatabaseImpl |
instance
|
private OidEntity |
root
|
Constructor Summary | |
private |
MibDatabaseImpl(java.lang.String mibFile)
Constructs the MIB database using the passed mib file name. |
Method Summary | |
(package private) void |
addIndex(OidEntity node)
Adds the OidEntity node into the index list. |
static MibDatabase |
create(java.lang.String mibFile)
Creates the singleton MibDatabase instance from the passed MIB file. |
private void |
createDB(net.percederberg.mib.Mib mib)
|
private void |
createDB(net.percederberg.mib.symbol.Symbol symbol)
|
static MibDatabase |
getInstance()
Gets the singleton MibDatabase instance. |
OidEntity |
getOidGroup(java.lang.String oid)
Retrieves the OidEntity object that matches to the passed OID string in the MIB database. |
OidRecord |
getOidRecord(java.lang.String oid)
Retrieves the OidRecord that matches to the passed OID string in the MIB database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static MibDatabaseImpl instance
private java.util.HashMap indexList
private OidEntity root
Constructor Detail |
private MibDatabaseImpl(java.lang.String mibFile) throws SnmpException
mibFile
- The MIB file name.Method Detail |
public OidRecord getOidRecord(java.lang.String oid) throws SnmpException
getOidRecord
in class MibDatabase
oid
- OID string
SnmpException
- Thrown if there is no such OID record.public OidEntity getOidGroup(java.lang.String oid) throws SnmpException
oid
- OID string
SnmpException
- Thrown if there is no such OID group.private void createDB(net.percederberg.mib.Mib mib) throws SnmpException
SnmpException
private void createDB(net.percederberg.mib.symbol.Symbol symbol) throws SnmpException
SnmpException
void addIndex(OidEntity node)
node
- The OidEntity node.public static MibDatabase create(java.lang.String mibFile) throws SnmpException
mibFile
- The MIB file name.
SnmpException
- Thrown when any error occurs during
the MIB database creation.public static MibDatabase getInstance() throws SnmpException
SnmpException
- Thrown when there is no instance of
the MibDatabase existed.
|
MySnmpCrawler API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |