|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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");Getting MibNode from MibOperations class can be used, only if we don't know the ModuleName.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);
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 |
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 |
Method Summary | |
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. |
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 |
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. |
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. |
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. |
java.lang.String |
getNotificationsNames()
Gets the NOTIFICATIONS clause names in NOTIFICATION-GROUP macro |
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 |
boolean |
isAncestorOf(MibNode node)
Used to know whether this node is an ancestor of the specified node. |
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. |
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. |
java.lang.String |
printReference()
Returns the Reference string |
java.lang.String |
printStatus()
Returns the status value as a string. |
void |
setDefval(java.lang.String defval)
Sets the defval as defined in the MIB. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public boolean isImportedNode()
public int getSubid()
getSubID()
public long getSubID()
public java.util.Vector getChildList()
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.
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()
public java.lang.String toString()
toString
in class java.lang.Object
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()
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.
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 parent
public 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
MibException
- is thrown if syntax type is not one of the standard types.
SnmpException
- is thrown on format errors.public java.util.Vector getRevisions()
public java.util.Vector getRevisionDescriptions()
public java.util.Vector getObjects()
public java.lang.String getModuleName()
public java.lang.String getMacroType()
public java.lang.String getLabel()
toString()
public MibNode getParent()
getChild(int subId)
,
getChildList()
public LeafSyntax getSyntax()
public int getAccess()
public java.lang.String getStatus()
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 object
public MibNode getCommonAncestorWith(MibNode node)
node
- the MibNode object
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |