MySnmpCrawler API

snmp.mibdb
Class OidEntity

java.lang.Object
  |
  +--snmp.mibdb.OidEntity
All Implemented Interfaces:
OidRecord

class OidEntity
extends java.lang.Object
implements OidRecord

This class represents the object variable managed in the MIB file. It encapsulates the information including: name, data type, permission, and description of the object variable. Each OidEntity object is also a link list node that contains a references to its parent object variable and a list of child variables.

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:55 $
Author:
Scott Cheng

Nested Class Summary
private  class OidEntity.OidEntityMeta
           
 
Field Summary
private  java.util.ArrayList children
           
private  OidEntity.OidEntityMeta meta
           
private  OidEntity parent
           
private static java.lang.String UNKNOWN
           
 
Fields inherited from interface snmp.mibdb.OidRecord
CURRENT_STATUS, DEPRECATED_STATUS, MANDATORY_STATUS, NO_ACCESS, NOTIFY_ACCESS, OBSOLETE_STATUS, OPTIONAL_STATUS, READ_ACCESS, READ_CREATE_ACCESS, READ_WRITE_ACCESS, WRITE_ACCESS
 
Constructor Summary
(package private) OidEntity(OidEntity parent, net.percederberg.mib.symbol.Symbol symbol, MibDatabaseImpl db)
          Constructs the OidEntity object with the parent Symbol object, the Symbol object, and the MibDatabaseImpl object.
(package private) OidEntity(net.percederberg.mib.symbol.Symbol symbol, MibDatabaseImpl db)
          Constructs the OidEntity object with the Symbol object and MibDatabaseImpl object.
 
Method Summary
 boolean checkPermission(int accessCode)
          Checks the passed permission with the permission of the object variable in the MIB database.
 java.lang.String getAccess()
          Gets the access description of the object variable.
 byte getAsnType()
          Gets the ASN.1 type of the object variable.
 OidEntity getChild(java.lang.String oid)
          Gets the object variable matched to the passed OID string.
 java.util.ArrayList getChildren()
          Gets the children list of the object variable.
 java.lang.String getDescription()
          Gets the description text of the object variable.
 java.lang.String getName()
          Gets the object variable name.
 java.lang.String getOid()
          Gets the object identifier (OID) string.
 OidRecord getOidGroup()
          Gets the parent object variable.
(package private) static java.lang.String getParentOid(java.lang.String oid)
          Gets the OID string of the parent variable.
 java.lang.String getType()
          Gets the text description of the object type.
private static void setASNtypeInfo(net.percederberg.mib.symbol.Symbol symbol, OidEntity.OidEntityMeta meta)
          Converts Snmp datatype in the passed symbol to the ASN.1 type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

private static final java.lang.String UNKNOWN
See Also:
Constant Field Values

parent

private OidEntity parent

children

private java.util.ArrayList children

meta

private OidEntity.OidEntityMeta meta
Constructor Detail

OidEntity

OidEntity(net.percederberg.mib.symbol.Symbol symbol,
          MibDatabaseImpl db)
    throws SnmpException
Constructs the OidEntity object with the Symbol object and MibDatabaseImpl object. This constructor is invoked to create the root OidEntity object.

Parameters:
symbol - The symbol node.
db - The MIB database implementation object.
Throws:
TypeOfException - Thrown when ...
SnmpException

OidEntity

OidEntity(OidEntity parent,
          net.percederberg.mib.symbol.Symbol symbol,
          MibDatabaseImpl db)
    throws SnmpException
Constructs the OidEntity object with the parent Symbol object, the Symbol object, and the MibDatabaseImpl object.

Parameters:
parent - The parent symbol node.
symbol - The symbol node.
db - The MIB database implementation object.
Throws:
TypeOfException - Thrown when ...
SnmpException
Method Detail

getOid

public java.lang.String getOid()
Gets the object identifier (OID) string.

Specified by:
getOid in interface OidRecord
Returns:
The OID string.

getName

public java.lang.String getName()
Gets the object variable name.

Specified by:
getName in interface OidRecord
Returns:
The object variable name.

getType

public java.lang.String getType()
Gets the text description of the object type.

Specified by:
getType in interface OidRecord
Returns:
The text description of the object type.

getAsnType

public byte getAsnType()
Gets the ASN.1 type of the object variable.

Specified by:
getAsnType in interface OidRecord
Returns:
The ASN.1 type of the variable.

checkPermission

public boolean checkPermission(int accessCode)
Checks the passed permission with the permission of the object variable in the MIB database.

Specified by:
checkPermission in interface OidRecord
Returns:
True if the permission is valid, otherwise false.
Throws:
TypeOfException - Thrown when ...

getAccess

public java.lang.String getAccess()
Gets the access description of the object variable.

Specified by:
getAccess in interface OidRecord
Returns:
The access description of the object variable.

getDescription

public java.lang.String getDescription()
Gets the description text of the object variable.

Specified by:
getDescription in interface OidRecord
Returns:
The description text of the object variable.

getOidGroup

public OidRecord getOidGroup()
Gets the parent object variable.

Specified by:
getOidGroup in interface OidRecord
Returns:
The parent object variable.

getChildren

public java.util.ArrayList getChildren()
Gets the children list of the object variable.

Returns:
The list of object variable children.

getChild

public OidEntity getChild(java.lang.String oid)
Gets the object variable matched to the passed OID string.

Returns:
The matched OidEntity object.

getParentOid

static final java.lang.String getParentOid(java.lang.String oid)
Gets the OID string of the parent variable.

Returns:
The OID string of the parent variable.

setASNtypeInfo

private static void setASNtypeInfo(net.percederberg.mib.symbol.Symbol symbol,
                                   OidEntity.OidEntityMeta meta)
                            throws SnmpException
Converts Snmp datatype in the passed symbol to the ASN.1 type.

Parameters:
symbol - The symbol containing the type to be converted.
meta - The OidEntityMeta object where ASN.1 type will be set to.
SnmpException

MySnmpCrawler API