|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.snmp.mibs.MibNode
This class represents an MIB node in the MIB module tree. Using the methods available in this class, we can get the Node information of different MacroTypes.
The MibNode instance can be obtained using any one of the following methods after loading the corresponding MIB files.
MibOperations mibOps = new MibOperations();
mibOps.loadMibModules("mibFile");
Method 1
MibNode node = mibOps.getMibNode("nodeName");
Method 2
SnmpOID oid = mibOps.getSnmpOID("nodeName");
MibNode node = mibOps.getSnmpOID(oid);
Method 3
MibModule module = mibOps.getMibModule("moduleName");
MibNode mn = module.getMibNode("nodeName");
Method 4
MibModule module = mibOps.getMibModule("moduleName");
SnmpOID oid = mibOps.getSnmpOID("nodeName");
MibNode node = module.getMibNode(oid);
Getting MibNode from MibOperations class can be used, only
if we don't know the ModuleName.
It is better to avoid getting the MibNode using the methods getMibNode() present in the MibOperations class because
It is derived from parsing an MIB module which contains references to its parents,children and the dependents.
| Field Summary | |
(package private) int |
access
Access for this node |
(package private) boolean |
addedForResolving
Compiled output reader methods. |
(package private) java.util.Vector |
agentCap
|
(package private) MibNode |
augmentNode
The node which is being augmented by this node |
(package private) java.lang.String |
augmentStr
|
(package private) java.util.Vector |
childList
Nodes children as a vector |
(package private) com.adventnet.snmp.mibs.mibparser.CommentClass |
commentObj
|
(package private) java.lang.String |
contactinfo
To store CONTACT-INFO clause in MODULE-IDENTITY macro |
(package private) java.lang.String |
defOIDStr
|
(package private) java.lang.String |
defval
The defined defval as is defined in the MIB (not parsed). |
(package private) java.lang.String |
description
Description of node |
(package private) java.lang.String |
impliedNode
|
(package private) java.lang.String |
importFromModule
|
(package private) java.util.Vector |
indexNames
Index names defined for this node |
(package private) boolean |
isAugments
Boolean to indicate if this node augments another node (for a table such as ifEntry) |
(package private) boolean |
isImplied
|
(package private) boolean |
isImported
|
(package private) java.lang.String |
label
The name of this MIB Node |
(package private) java.lang.String |
lastupdated
To Store the LAST-UPDATED clause in MODULE-IDENTITY macro |
(package private) int |
m_type
|
(package private) java.lang.String |
macroType
The name of the macro-type |
(package private) java.util.Vector |
moduleCompliance
The names in MODULE-COMPLIANCE. |
(package private) java.lang.String |
moduleName
The name of the module this node is defined |
(package private) MibNode |
nextNode
|
(package private) int |
node_access
The node access. |
(package private) int |
node_status
The node status |
(package private) java.lang.String |
notificationsNames
The NOTIFICATIONS clause names in NOTIFICATION-GROUP macro |
(package private) java.lang.String |
objectNames
The OBJECT clause names in OBJECT-GROUP and NOTIFICATION_TYPE macro |
(package private) java.util.Vector |
objects
The OBJECT clause names in OBJECT-GROUP and NOTIFICATION_TYPE macro in a Vector |
(package private) int[] |
oid_array
|
(package private) java.lang.String |
oid_string
This contains the complete oid string, from .iso.org... |
(package private) java.lang.String |
organization
To store ORGANIZATION clause in MODULE-IDENTITY macro |
(package private) MibNode |
parent
Nodes Parent |
(package private) java.lang.String |
productrelease
To store PRODUCT-RELEASE clause in AGENT-CAPABILITIES macro |
(package private) java.lang.String |
reference
String reference for the node |
(package private) MibNode |
remoteParent
|
(package private) java.lang.String |
revdescription
|
(package private) java.util.Vector |
revisionDescriptions
To store a Vector of Revision Description elements |
(package private) java.util.Vector |
revisions
To store a Vector of Revision elements |
(package private) java.lang.String |
rowName
The name of the row sequence |
(package private) java.lang.String |
status
Status of this node |
(package private) int |
subid
The subid of this MIB Node |
(package private) LeafSyntax |
syntax
The syntax associated with this node. |
(package private) java.util.Vector |
tableItems
The names of the items in the row sequence |
(package private) java.lang.String |
tableSequence
The name in the SEQUENCE OF "name" item |
(package private) java.lang.String |
units
To store UNITS clause in OBJECT-TYPE macro |
(package private) java.lang.Object |
userObj
|
| Fields inherited from interface com.adventnet.snmp.mibs.mibparser.MIBConstants |
ACCESS_ACCESSIBLE_FOR_NOTIFY,
ACCESS_NOT_ACCESSIBLE,
ACCESS_NOT_IMPLEMENTED,
ACCESS_READ_CREATE,
ACCESS_READ_ONLY,
ACCESS_READ_WRITE,
ACCESS_WRITE_ONLY,
accessStr,
AGENT_CAPABILITIES,
alphaStr,
BITSTRING,
COUNTER,
COUNTER32,
COUNTER64,
GAUGE,
GAUGE32,
INTEGER,
INTEGER32,
IPADDRESS,
macroStr,
MODULE_COMPLIANCE,
MODULE_IDENTITY,
NETWORKADDRESS,
NOTIFICATION_GROUP,
NOTIFICATION_TYPE,
NULL,
numericStr,
OBJECT_GROUP,
OBJECT_IDENTIFIER,
OBJECT_IDENTITY,
OBJECT_TYPE,
OCTETSTRING,
OPAQUE,
SEQUENCE,
STATUS_CURRENT,
STATUS_DEPRECATED,
STATUS_MANDATORY,
STATUS_OBSOLETE,
STATUS_OPTIONAL,
statusStr,
TEXTUAL_CONVENTION,
TIMETICKS,
TRAP_TYPE,
UNSIGNED32 |
| Constructor Summary | |
(package private) |
MibNode()
|
| Method Summary | |
(package private) MibNode |
addChild(MibNode m)
|
(package private) MibNode |
addChild(MibNode n,
java.lang.String m)
|
(package private) void |
addToNodeList(MibModule m)
A very lethargic routine for populating the nodeList. |
(package private) MibNode |
cloneNode(java.lang.String modName)
|
(package private) int |
compare(int[] a,
int[] b,
int len)
A comparison routine. |
SnmpVarBind |
createSnmpVarBind(java.util.Vector indexes,
SnmpVar value,
java.util.Vector indexMibNodes)
Creates an SnmpVarBind instance with supplied parameters. |
SnmpVar |
decodeDefval()
Gives the decoded value of the DEFVAL field. |
int |
getAccess()
Gets the access value for this node. |
java.util.Vector |
getAgentCapabilities()
Gets the various clauses in AGENT-CAPABILITIES as a Vector of AgentCapabilitiesModule |
MibNode |
getAugments()
Gets the augmented table entry. |
MibNode |
getChild(int subId)
Gets the child node corresponding to the particular sub-id. |
MibNode |
getChild(long subOid)
Gets the child node corresponding to the suboid. |
java.util.Vector |
getChildList()
Gets the child nodes. |
(package private) com.adventnet.snmp.mibs.mibparser.CommentClass |
getCommentObject()
|
MibNode |
getCommonAncestorWith(MibNode node)
Gives the common ancestor node for this node and the specified node. |
java.lang.String |
getContactinfo()
Gets the value of CONTACT-INFO clause in MODULE-IDENTITY macro |
(package private) java.lang.String |
getDefOIDStr()
|
java.lang.String |
getDefval()
The defval for this node can be obtained using this method. |
java.lang.String |
getDescription()
Gets the description for this node |
java.util.Vector |
getExternalIndices()
Gets the external indices present in the table entry |
java.lang.String |
getImpliedNode()
Gives the implied node name present in the INDEX list of this MIB node. |
java.lang.String |
getImportedModuleName()
Gets the name of the module from where this node is imported. |
java.util.Vector |
getIndexes(MibOperations mibs)
Gives the indexes as a Vector of MibNodes. |
(package private) java.lang.String |
getIndexModuleName(java.lang.String indexName,
MibOperations mibs)
|
java.util.Vector |
getIndexNames()
Gives the index names defined for this node. |
boolean |
getIsAugmented()
Used to know whether the entry node contains the AUGMENTS clause. |
java.lang.String |
getLabel()
Gets the name of this MIB Node. |
java.lang.String |
getLastupdated()
Gets the value of the LAST-UPDATED clause in MODULE-IDENTITY macro |
java.lang.String |
getMacroType()
Gets the macro-type of this node. |
(package private) int |
getMacroTypeInt()
Should this be made public ?? This returns the macro type corresponding to the syntax. |
(package private) java.lang.String |
getMacroTypeStr()
|
java.util.Vector |
getModuleCompliance()
Gets the various clauses in MODULE-COMPLIANCE macro. |
java.lang.String |
getModuleName()
Gets the name of the module this node is defined return the module name e.g. |
MibNode |
getNextLeafNode()
Gives the next leaf node by searching through the current module. |
(package private) MibNode |
getNextNode()
Returns the next node wherever that node might be. |
(package private) int |
getNodeAccess()
Get the access as an integer defined in MIBConstants. |
(package private) java.lang.String |
getNodeAccessStr()
Get the String corresponding to the access clause Valid only for compiled modules. |
(package private) int |
getNodeStatus()
Get the status as an integer defined in MIBConstants. |
java.lang.String |
getNotificationsNames()
Gets the NOTIFICATIONS clause names in NOTIFICATION-GROUP macro |
(package private) java.lang.String |
getNumberedOidString()
|
java.lang.String |
getNumberedOIDString()
Gives the numbered OID string of the node. |
java.lang.String |
getObjectNames()
Deprecated. use the getObjects method instead. |
java.util.Vector |
getObjects()
Gets the OBJECT clause names in OBJECT-GROUP and NOTIFICATION-TYPE macro. |
int[] |
getOID()
Gives the numbered OID of the node as an array of ints. |
java.lang.String |
getOIDString()
Gives the named OID of the node. |
java.util.Vector |
getOIDVector()
Gets the named OID of the node as a Vector of String. |
java.util.Vector |
getOIDVectorIds()
Gives the numbered OID of the node as a Vector of Integer objects. |
java.lang.String |
getOrganization()
Gets the value of ORGANIZATION clause in MODULE-IDENTITY macro |
MibNode |
getParent()
We can make use this method to get the parent of this node. |
java.lang.String |
getProductrelease()
Get the value of PRODUCT-RELEASE clause in AGENT-CAPABILITIES macro |
java.lang.String |
getReference()
Gets string reference for this node. |
java.lang.String |
getRevdescription()
Deprecated. since 4.0. Instead you can use the method getRevisionDescriptions() |
java.lang.String |
getRevision()
Deprecated. since 4.0. Instead you can use the method getRevisions() |
java.util.Vector |
getRevisionDescriptions()
Gives the revision descriptions as a vector of String Elements. |
java.util.Vector |
getRevisions()
Gives the revisions as a Vector of String Elements. |
java.lang.String |
getRowName()
Gets the name of the row sequence. |
java.lang.String |
getStatus()
Gets the status value of this node. |
int |
getSubid()
Deprecated. since 4.0. Instead you can use the method getSubID() |
long |
getSubID()
Gives the sub-identifier of this node's object-identifier. |
LeafSyntax |
getSyntax()
Gives the syntax associated with this node. |
java.util.Vector |
getTableItems()
Will give the names of the items in the row sequence. |
java.lang.String |
getTableSequence()
Gets the name in the SEQUENCE OF "name" item |
java.lang.String |
getUnits()
Gets the value of UNITS clause in OBJECT-TYPE macro |
(package private) java.lang.Object |
getUserObject()
|
(package private) boolean |
hasChildren()
|
boolean |
isAncestorOf(MibNode node)
Used to know whether this node is an ancestor of the specified node. |
(package private) boolean |
isAugments()
Return true if this table entry is Augmenting another table entry. |
boolean |
isDescendentOf(MibNode node)
Using this method we can find whether this node is descendent of the specified node. |
boolean |
isImplied()
Used to find whether the INDEX clause contains an IMPLIED keyword. |
boolean |
isImportedNode()
Used to find whether this is an imported node. |
boolean |
isInCurrentTable(java.lang.String nodeLabel)
Used to find whether the given node is a column of the current table. |
boolean |
isIndex()
Using this method we can find whether this is an index node. |
boolean |
isLeaf()
Used to know whether this is a leaf node. |
boolean |
isReadable()
Used to know whether this node is readable. |
boolean |
isScalar()
Using this method we can find whether this node is Scalar or not. |
boolean |
isTable()
Used to know whether this is a table node. |
boolean |
isTableColumn()
Used to know whether this node is a table column or not. |
boolean |
isTableEntry()
Used to find whether this node is a table entry. |
boolean |
isWriteable()
Used to know whether this node is writeable. |
(package private) void |
merge(MibNode m)
|
java.lang.String |
printAccess()
Gives the access value as a string. |
java.lang.String |
printDescription()
Returns the Description string |
java.util.Vector |
printIndex()
The names of the index nodes can be obtained using this method. |
(package private) java.lang.String |
printNodeProperties()
|
java.lang.String |
printReference()
Returns the Reference string |
java.lang.String |
printStatus()
Returns the status value as a string. |
(package private) SnmpVar |
processIPAddressValue(java.lang.String value)
|
(package private) SnmpVar |
processObjectIDValue(java.lang.String value)
|
(package private) SnmpVar |
processStringValue(java.lang.String value)
|
(package private) MibNode |
readElements(java.io.DataInputStream inp,
MibNode parent,
MibModule module)
|
(package private) MibNode |
readElements(com.adventnet.snmp.mibs.mibparser.SyntaxOID synoid,
MibNode parent,
MibModule module)
|
(package private) void |
setAugment(MibNode m)
set the augmented node |
(package private) void |
setAugment(java.lang.String augments,
MibModule module)
This method should set the augment node after searching and looking up the corresponding node. |
(package private) void |
setCommentObject(com.adventnet.snmp.mibs.mibparser.CommentClass commObj)
|
void |
setDefval(java.lang.String defval)
Sets the defval as defined in the MIB. |
(package private) void |
setMacroTypeInt(int mtype)
|
(package private) void |
setParent(MibNode parent)
Set nodes Parent |
(package private) void |
setRemoteParent(MibNode parent)
Sets the parent of the node to be remote i.e exists in another module |
(package private) void |
setUserObject(java.lang.Object userObject)
|
java.lang.String |
toString()
Gives the name of this node. |
java.lang.String |
toTagString()
Gets detailed information about the node, much like the MIB definition itself. |
(package private) void |
updateOID(int[] oid)
Updates the oid of self and notifies child oids to do the same. |
(package private) void |
updateOID(java.lang.String oid)
|
(package private) void |
updateSyntax(LeafSyntax actualSyntaxToUse)
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
java.lang.String impliedNode
java.lang.String importFromModule
java.lang.String defOIDStr
java.lang.Object userObj
com.adventnet.snmp.mibs.mibparser.CommentClass commentObj
boolean isImported
int subid
java.util.Vector childList
boolean isAugments
MibNode augmentNode
java.lang.String augmentStr
int[] oid_array
java.lang.String oid_string
boolean isImplied
MibNode nextNode
java.util.Vector revisions
java.util.Vector revisionDescriptions
java.util.Vector objects
boolean addedForResolving
int m_type
MibNode remoteParent
java.lang.String moduleName
java.lang.String macroType
java.lang.String label
MibNode parent
LeafSyntax syntax
int access
java.lang.String status
int node_status
int node_access
java.lang.String description
java.lang.String reference
java.util.Vector indexNames
java.lang.String defval
java.lang.String tableSequence
java.lang.String rowName
java.util.Vector tableItems
java.lang.String units
java.lang.String lastupdated
java.lang.String organization
java.lang.String contactinfo
java.lang.String revdescription
java.util.Vector moduleCompliance
java.util.Vector agentCap
java.lang.String objectNames
java.lang.String notificationsNames
java.lang.String productrelease
| Constructor Detail |
MibNode()
| Method Detail |
java.lang.Object getUserObject()
void setUserObject(java.lang.Object userObject)
com.adventnet.snmp.mibs.mibparser.CommentClass getCommentObject()
void setCommentObject(com.adventnet.snmp.mibs.mibparser.CommentClass commObj)
public boolean isImportedNode()
public int getSubid()
getSubID()public long getSubID()
public java.util.Vector getChildList()
MibNode cloneNode(java.lang.String modName)
public MibNode getChild(int subId)
subId - sub-oid of the child node.public MibNode getChild(long subOid)
For example, the subId of sysDescr will be 1.
So that getChild on system Node with 1 will
return the sysDescr node.
subOid - The sub-oid of the child node.boolean isAugments()
public MibNode getAugments()
If you want to know whether a table entry is augmented, then the method getIsAugmented() can be used.
NOTE : This method is supposed to be invoked on a table entry.
getIsAugmented()void setAugment(MibNode m)
void setAugment(java.lang.String augments,
MibModule module)
public java.lang.String toString()
getLabel()public java.lang.String toTagString()
This method gives the node information such as the OIDString, syntax, access, status, description, reference. The index nodes are also printed, if this is a table entry.
If this a table node, then table items are also printed in addition to the above information.
public int[] getOID()
public java.lang.String getOIDString()
public java.lang.String getNumberedOIDString()
java.lang.String getNumberedOidString()
public java.util.Vector getOIDVector()
public java.util.Vector getOIDVectorIds()
public java.util.Vector printIndex()
NOTE : This method is supposed to be invoked on a table entry.
getIndexNames(),
getIndexes(com.adventnet.snmp.mibs.MibOperations)public boolean isImplied()
The IMPLIED keyword can only be present for a node having a variable-length syntax i.e. OCTET STRING with variable length or OBJECT IDENTIFIER. Also the IMPLIED keyword can be associated only with the last object in the INDEX clause. NOTE : This method is supposed to be invoked on a table entry.
MibNode getNextNode()
public MibNode getNextLeafNode()
This is useful for agents looking for the OID or label for the next MIB node for the getnext requests. This assumes the MIB module file objects were defined in the desired order. And, it also it spans multiple modules.
public SnmpVarBind createSnmpVarBind(java.util.Vector indexes,
SnmpVar value,
java.util.Vector indexMibNodes)
indexes - The ordered list of index values which can be
SnmpVar values. this parameter can be null for
non-tabular columnsvalue - The SnmpVar value to be used for creating the
SnmpVarBind instanceindexMibNodes - The index nodes for this node's parentpublic boolean isTableColumn()
public boolean isInCurrentTable(java.lang.String nodeLabel)
nodeLabel - the name of the node which is to be checked whether it is in this table.public boolean isReadable()
isWriteable(),
isLeaf()public boolean isWriteable()
isReadable(),
isLeaf()public boolean isScalar()
isLeaf()public boolean isTable()
isTableEntry()public boolean isTableEntry()
isTable()public boolean isLeaf()
isScalar()public java.util.Vector getIndexes(MibOperations mibs)
mibs - The MibOperations instance.
public SnmpVar decodeDefval()
throws MibException,
SnmpException
public java.util.Vector getRevisions()
public java.util.Vector getRevisionDescriptions()
public java.util.Vector getObjects()
MibNode readElements(java.io.DataInputStream inp,
MibNode parent,
MibModule module)
throws java.io.IOException
MibNode readElements(com.adventnet.snmp.mibs.mibparser.SyntaxOID synoid,
MibNode parent,
MibModule module)
void addToNodeList(MibModule m)
int getMacroTypeInt()
void setMacroTypeInt(int mtype)
java.lang.String getMacroTypeStr()
MibNode addChild(MibNode m)
MibNode addChild(MibNode n,
java.lang.String m)
void setRemoteParent(MibNode parent)
java.lang.String printNodeProperties()
void updateSyntax(LeafSyntax actualSyntaxToUse)
boolean hasChildren()
void merge(MibNode m)
throws MibException
public java.lang.String getModuleName()
void updateOID(int[] oid)
oid - the oid corresponding to the parent. This node will append
its sub-id to this to get at its oid.void updateOID(java.lang.String oid)
public java.lang.String getMacroType()
public java.lang.String getLabel()
toString()public MibNode getParent()
getChild(int subId),
getChildList()void setParent(MibNode parent)
public LeafSyntax getSyntax()
public int getAccess()
public java.lang.String getStatus()
int getNodeStatus()
int getNodeAccess()
java.lang.String getNodeAccessStr()
public java.lang.String getDescription()
public java.lang.String getReference()
public java.util.Vector getIndexNames()
As per the standard, every table entry should have either an INDEX clause or an AUGMENTS clause.
This method return the names that are defined in the INDEX clause of table entry node.
The elements of the Vector returned by this method are String. If you need the indexes as Vector of MibNodes, the method getIndexes(MibOperations) can be used.
getIndexes(com.adventnet.snmp.mibs.MibOperations),
printIndex()public java.lang.String getDefval()
public void setDefval(java.lang.String defval)
defval - the value to be set.getDefval()public java.lang.String getTableSequence()
public java.lang.String getRowName()
public java.util.Vector getTableItems()
public boolean getIsAugmented()
public java.lang.String getUnits()
public java.lang.String getLastupdated()
public java.lang.String getOrganization()
public java.lang.String getContactinfo()
public java.lang.String getRevision()
getRevisions()public java.lang.String getRevdescription()
getRevisionDescriptions()public java.util.Vector getModuleCompliance()
public java.util.Vector getAgentCapabilities()
public java.lang.String getObjectNames()
getObjects()public java.lang.String getNotificationsNames()
public java.lang.String getProductrelease()
public boolean isAncestorOf(MibNode node)
node - the MibNode object.public boolean isDescendentOf(MibNode node)
node - the MibNode objectpublic MibNode getCommonAncestorWith(MibNode node)
node - the MibNode object
int compare(int[] a,
int[] b,
int len)
public java.lang.String printAccess()
public java.lang.String printStatus()
public java.lang.String printDescription()
public java.lang.String printReference()
public java.lang.String getImpliedNode()
public boolean isIndex()
public java.util.Vector getExternalIndices()
public java.lang.String getImportedModuleName()
java.lang.String getIndexModuleName(java.lang.String indexName,
MibOperations mibs)
SnmpVar processStringValue(java.lang.String value)
throws MibException,
SnmpException
SnmpVar processIPAddressValue(java.lang.String value)
throws MibException,
SnmpException
SnmpVar processObjectIDValue(java.lang.String value)
throws MibException,
SnmpException
java.lang.String getDefOIDStr()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||