com.adventnet.snmp.mibs
Class MibNode

java.lang.Object
  extended by com.adventnet.snmp.mibs.MibNode
All Implemented Interfaces:
com.adventnet.snmp.mibs.mibparser.MIBConstants, java.io.Serializable
Direct Known Subclasses:
JdbcMibNode

public class MibNode
extends java.lang.Object
implements java.io.Serializable, com.adventnet.snmp.mibs.mibparser.MIBConstants

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.

See Also:
Serialized Form

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
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 processIpv6AddressValue(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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

impliedNode

java.lang.String impliedNode

importFromModule

java.lang.String importFromModule

defOIDStr

java.lang.String defOIDStr

userObj

java.lang.Object userObj

commentObj

com.adventnet.snmp.mibs.mibparser.CommentClass commentObj

isImported

boolean isImported

subid

int subid
The subid of this MIB Node


childList

java.util.Vector childList
Nodes children as a vector


isAugments

boolean isAugments
Boolean to indicate if this node augments another node (for a table such as ifEntry)


augmentNode

MibNode augmentNode
The node which is being augmented by this node


augmentStr

java.lang.String augmentStr

oid_array

int[] oid_array

oid_string

java.lang.String oid_string
This contains the complete oid string, from .iso.org...


isImplied

boolean isImplied

nextNode

MibNode nextNode

revisions

java.util.Vector revisions
To store a Vector of Revision elements


revisionDescriptions

java.util.Vector revisionDescriptions
To store a Vector of Revision Description elements


objects

java.util.Vector objects
The OBJECT clause names in OBJECT-GROUP and NOTIFICATION_TYPE macro in a Vector


addedForResolving

boolean addedForResolving
Compiled output reader methods. Reads in new elements and adds itself to parent node. The method returns the MibNode object which should be added to the Hashtable This happens when the node which is performing this op should instead use a different node as returned by this method.


m_type

int m_type

remoteParent

MibNode remoteParent

moduleName

java.lang.String moduleName
The name of the module this node is defined


macroType

java.lang.String macroType
The name of the macro-type


label

java.lang.String label
The name of this MIB Node


parent

MibNode parent
Nodes Parent


syntax

LeafSyntax syntax
The syntax associated with this node. Is in module syntaxList if a TC, or basic


access

int access
Access for this node


status

java.lang.String status
Status of this node


node_status

int node_status
The node status


node_access

int node_access
The node access. Note that this returns the types defined in MIBConstants and not SnmpAPI constants.


description

java.lang.String description
Description of node


reference

java.lang.String reference
String reference for the node


indexNames

java.util.Vector indexNames
Index names defined for this node


defval

java.lang.String defval
The defined defval as is defined in the MIB (not parsed).


tableSequence

java.lang.String tableSequence
The name in the SEQUENCE OF "name" item


rowName

java.lang.String rowName
The name of the row sequence


tableItems

java.util.Vector tableItems
The names of the items in the row sequence


units

java.lang.String units
To store UNITS clause in OBJECT-TYPE macro


lastupdated

java.lang.String lastupdated
To Store the LAST-UPDATED clause in MODULE-IDENTITY macro


organization

java.lang.String organization
To store ORGANIZATION clause in MODULE-IDENTITY macro


contactinfo

java.lang.String contactinfo
To store CONTACT-INFO clause in MODULE-IDENTITY macro


revdescription

java.lang.String revdescription

moduleCompliance

java.util.Vector moduleCompliance
The names in MODULE-COMPLIANCE.


agentCap

java.util.Vector agentCap

objectNames

java.lang.String objectNames
The OBJECT clause names in OBJECT-GROUP and NOTIFICATION_TYPE macro


notificationsNames

java.lang.String notificationsNames
The NOTIFICATIONS clause names in NOTIFICATION-GROUP macro


productrelease

java.lang.String productrelease
To store PRODUCT-RELEASE clause in AGENT-CAPABILITIES macro

Constructor Detail

MibNode

MibNode()
Method Detail

getUserObject

java.lang.Object getUserObject()

setUserObject

void setUserObject(java.lang.Object userObject)

getCommentObject

com.adventnet.snmp.mibs.mibparser.CommentClass getCommentObject()

setCommentObject

void setCommentObject(com.adventnet.snmp.mibs.mibparser.CommentClass commObj)

isImportedNode

public boolean isImportedNode()
Used to find whether this is an imported node.

Returns:
true if the node is imported from other MIB Module
false otherwise.

getSubid

public int getSubid()
Deprecated. since 4.0. Instead you can use the method getSubID()

Gets the subid of this MIB Node.
For example, the subid for the node sysName with OID .1.3.6.1.2.1.1.5 will be 5

Returns:
int. The subid for this node.
See Also:
getSubID()

getSubID

public long getSubID()
Gives the sub-identifier of this node's object-identifier. The ObjectIdentifier have the 128 sub-identifiers, each sub-identifier can have the value ranges from 0 to 4294967295.

Returns:
long. The subid of this node.
Since:
AdventNet SNMP API 4

getChildList

public java.util.Vector getChildList()
Gets the child nodes. for example, For the node system in RFC1213-MIB, the childList returned by this method will be the following MibNodes -
sysDescr, sysObjectId, sysUpTime, sysContact, sysName, sysLocation, sysServices.

Returns:
Vector of child nodes
empty Vector if there is no children. or if this is a leaf node.

cloneNode

MibNode cloneNode(java.lang.String modName)

getChild

public MibNode getChild(int subId)
Gets the child node corresponding to the particular sub-id. The child node could be in another MIB. For example, the subId of sysDescr will be 1.
So that getChild on system Node with 1 as input argument will return the sysDescr node.

Parameters:
subId - sub-oid of the child node.
Returns:
the child node corresponding to the sub-id.
null if no node with that sub-id occurs in the child list.

getChild

public MibNode getChild(long subOid)
Gets the child node corresponding to the suboid. The child node could be another MIB. As per the standard, the maximum value of the suboid cannot exceed the 4294967295.

For example, the subId of sysDescr will be 1.
So that getChild on system Node with 1 will return the sysDescr node.

Parameters:
subOid - The sub-oid of the child node.
Returns:
the child node corresponding to the sub-id.
null if no node with that sub-id occurs in the child list.

isAugments

boolean isAugments()
Return true if this table entry is Augmenting another table entry.


getAugments

public MibNode getAugments()
Gets the augmented table entry.

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.

Returns:
the augmented MibNode
null, if the table does not uses augmented table entry or if this node is not a table entry.
See Also:
getIsAugmented()

setAugment

void setAugment(MibNode m)
set the augmented node


setAugment

void setAugment(java.lang.String augments,
                MibModule module)
This method should set the augment node after searching and looking up the corresponding node.


toString

public java.lang.String toString()
Gives the name of this node. Similar to the getLabel() method.

Overrides:
toString in class java.lang.Object
Returns:
String. The name of this node.
See Also:
getLabel()

toTagString

public java.lang.String toTagString()
Gets detailed information about the node, much like the MIB definition itself.

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.

Returns:
the node details

getOID

public int[] getOID()
Gives the numbered OID of the node as an array of ints. For example, for the node sysDescr in the MIB RFC1213-MIB, this method will return int array containing the elements 1,3,6,1,2,1,1,1

Returns:
the int array containing the OID elements.

getOIDString

public java.lang.String getOIDString()
Gives the named OID of the node. For example, for the node sysDescr, in the MIB RFC1213-MIB, this method will return the String ".iso.org.dod.internet.mgmt.mib-2.system.sysDescr"

Returns:
named OID of the node as a String.

getNumberedOIDString

public java.lang.String getNumberedOIDString()
Gives the numbered OID string of the node. For example, for the node sysDescr, in the MIB RFC1213-MIB, this method will return ".1.3.6.1.2.1.1.1"

Returns:
numbered OID of the node as a String.

getNumberedOidString

java.lang.String getNumberedOidString()

getOIDVector

public java.util.Vector getOIDVector()
Gets the named OID of the node as a Vector of String. For example, for the node sysDescr, in the MIB RFC1213-MIB, this method will return the Vector whose elements are iso, org, dod, internet, mgmt, mib-2, system and sysDescr.

Returns:
Vector whose elements form the named OID of the node.

getOIDVectorIds

public java.util.Vector getOIDVectorIds()
Gives the numbered OID of the node as a Vector of Integer objects. For example, for the node sysDescr, in the MIB RFC1213-MIB, this method will return the Vector whose elements are 1, 3, 6, 1, 2, 1, 1 and 1.

Returns:
Vector whose elements form the numbered OID of the node.

printIndex

public java.util.Vector printIndex()
The names of the index nodes can be obtained using this method. This method is same as getIndexNames().

NOTE : This method is supposed to be invoked on a table entry.

Returns:
Vector of the Index Names.
null if the node is not a table entry or if the table entry does not have the INDEX clause.
See Also:
getIndexNames(), getIndexes(com.adventnet.snmp.mibs.MibOperations)

isImplied

public boolean isImplied()
Used to find whether the INDEX clause contains an IMPLIED keyword.

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.

Returns:
true if the IMPLIED keyword is present in the INDEX clause.
false, if the IMPLIED keyword is absent in the INDEX clause or if the node is other than a table entry.

getNextNode

MibNode getNextNode()
Returns the next node wherever that node might be. The node is not necessarily a leaf node.


getNextLeafNode

public MibNode getNextLeafNode()
Gives the next leaf node by searching through the current module.

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.

Returns:
the next node in the tree - if the node exists,
null - if end of the MIB tree is reached.

createSnmpVarBind

public SnmpVarBind createSnmpVarBind(java.util.Vector indexes,
                                     SnmpVar value,
                                     java.util.Vector indexMibNodes)
Creates an SnmpVarBind instance with supplied parameters. Used for creating SNMP OIDs with instance values for tables. Supply the value when using for SNMP set. For the get requests the value is null.

Parameters:
indexes - The ordered list of index values which can be SnmpVar values. this parameter can be null for non-tabular columns
value - The SnmpVar value to be used for creating the SnmpVarBind instance
indexMibNodes - The index nodes for this node's parent
Returns:
the SnmpVarbind instance

isTableColumn

public boolean isTableColumn()
Used to know whether this node is a table column or not.

Returns:
true if this node is a table column
false otherwise.

isInCurrentTable

public boolean isInCurrentTable(java.lang.String nodeLabel)
Used to find whether the given node is a column of the current table.

Parameters:
nodeLabel - the name of the node which is to be checked whether it is in this table.
Returns:
true if the node is a column of the current table.
false otherwise.

isReadable

public boolean isReadable()
Used to know whether this node is readable. A node is considered readable if the ACCESS clause specifies the access to read-only, read-write or read-create.

Returns:
true if the node is readable.
false if not readable or if the node is not a leaf node.
See Also:
isWriteable(), isLeaf()

isWriteable

public boolean isWriteable()
Used to know whether this node is writeable. A mib variable is writeable if the access specifies it to read-write,write-only or read-create type. A writeable access in the MIB does not ensure that a Set will succeed on this variable. Factors contributing to failure could be agent implementation dependent(certain device capabilities) or access control on agent ( which could e.g., be community based )

Returns:
true if this node is writeable.
false if not writable or if the node is not a leaf node.
See Also:
isReadable(), isLeaf()

isScalar

public boolean isScalar()
Using this method we can find whether this node is Scalar or not.

Returns:
true if the node is a Scalar variable.
false otherwise.
See Also:
isLeaf()

isTable

public boolean isTable()
Used to know whether this is a table node. A table is defined in terms of a SEQUENCE of MibNodes forming the table. In case a table AUGMENTS another table the children of the table getting augmented will not be part of the tableItems of this node. A table node will usually have only one child node corresponding to the tableEntry node. A tableEntry node will contain information pertaining to the INDEX columns for the table or the reference to the Augmented tableEntry from which the index for this table can be derived.

Returns:
true if this node is the root of a table.
false otherwise.
See Also:
isTableEntry()

isTableEntry

public boolean isTableEntry()
Used to find whether this node is a table entry. A table entry is identified by the fact that there is an INDEX component defined for it or an AUGMENTS clause defined in it.

Returns:
true if this node is a table entry e.g. ifEntry
false otherwise and also in case of table e.g ifTable.
See Also:
isTable()

isLeaf

public boolean isLeaf()
Used to know whether this is a leaf node. A leaf node is either a scalar object or a columnar object and always associated with a syntax.

Returns:
true if this node is leaf. false otherwise.
See Also:
isScalar()

getIndexes

public java.util.Vector getIndexes(MibOperations mibs)
Gives the indexes as a Vector of MibNodes.

Parameters:
mibs - The MibOperations instance.
Returns:
Vector of Index MibNodes. null if not a table column.
Vector element will be null if the MibNode is not found.

decodeDefval

public SnmpVar decodeDefval()
                     throws MibException,
                            SnmpException
Gives the decoded value of the DEFVAL field. SnmpOID is supported for only numbered format, eg {{N N N}} This method decodes the DEFVAL value that is being defined for this node in the MIB, creates and returns the corresponding SnmpVar object.

Returns:
the Defval as SnmpVar
null if the OID is in label format
empty String if there is no DEFVAL field
Throws:
MibException - is thrown if syntax type is not one of the standard types.
SnmpException - is thrown on format errors.

getRevisions

public java.util.Vector getRevisions()
Gives the revisions as a Vector of String Elements.

Returns:
the revision strings in a Vector. The elements will be null,if setReadDesc(boolean) is set to false.
The size of the Vector denotes the number of revisions. Applicable to module-identity.

getRevisionDescriptions

public java.util.Vector getRevisionDescriptions()
Gives the revision descriptions as a vector of String Elements.

Returns:
the revision descriptions string in a Vector. The elements will be null, if setReadDesc(boolean) is set to false.
The size of the Vector denotes the number of revisions. Applicable to module-identity.

getObjects

public java.util.Vector getObjects()
Gets the OBJECT clause names in OBJECT-GROUP and NOTIFICATION-TYPE macro.

Returns:
Vector containing the String objects.
null, if the macro-type is other than OBJECT-GROUP and NOTIFICATION-TYPE.

readElements

MibNode readElements(java.io.DataInputStream inp,
                     MibNode parent,
                     MibModule module)
               throws java.io.IOException
Throws:
java.io.IOException

readElements

MibNode readElements(com.adventnet.snmp.mibs.mibparser.SyntaxOID synoid,
                     MibNode parent,
                     MibModule module)

addToNodeList

void addToNodeList(MibModule m)
A very lethargic routine for populating the nodeList. There might be load speed gains achievable in optimizing this.


getMacroTypeInt

int getMacroTypeInt()
Should this be made public ?? This returns the macro type corresponding to the syntax. The return types are defined in MIBConstants.


setMacroTypeInt

void setMacroTypeInt(int mtype)

getMacroTypeStr

java.lang.String getMacroTypeStr()

addChild

MibNode addChild(MibNode m)

addChild

MibNode addChild(MibNode n,
                 java.lang.String m)

setRemoteParent

void setRemoteParent(MibNode parent)
Sets the parent of the node to be remote i.e exists in another module


printNodeProperties

java.lang.String printNodeProperties()

updateSyntax

void updateSyntax(LeafSyntax actualSyntaxToUse)

hasChildren

boolean hasChildren()

merge

void merge(MibNode m)
     throws MibException
Throws:
MibException

getModuleName

public java.lang.String getModuleName()
Gets the name of the module this node is defined return the module name e.g. RFC1213-MIB


updateOID

void updateOID(int[] oid)
Updates the oid of self and notifies child oids to do the same.

Parameters:
oid - the oid corresponding to the parent. This node will append its sub-id to this to get at its oid.

updateOID

void updateOID(java.lang.String oid)

getMacroType

public java.lang.String getMacroType()
Gets the macro-type of this node.

Returns:
String corresponding to the type. The values are OBJECT-TYPE,OBJECT-IDENTITY,MODULE-IDENTITY etc.

getLabel

public java.lang.String getLabel()
Gets the name of this MIB Node. This method is same as toString().

See Also:
toString()

getParent

public MibNode getParent()
We can make use this method to get the parent of this node.

See Also:
getChild(int subId), getChildList()

setParent

void setParent(MibNode parent)
Set nodes Parent


getSyntax

public LeafSyntax getSyntax()
Gives the syntax associated with this node.

Returns:
LeafSyntax object, if the syntax is basic.
MibTC object, if the syntax is a TC.

getAccess

public int getAccess()
Gets the access value for this node. The following are the return values, which are mapped as
not-accessible - SnmpAPI.NOACCESS
read-only - SnmpAPI.RONLY
read-write - SnmpAPI.RWRITE
write-only - SnmpAPI.WONLY
read-create - SnmpAPI.RCREATE
accessible-for-notify - SnmpAPI.ACCESSFORNOTIFY


getStatus

public java.lang.String getStatus()
Gets the status value of this node.


getNodeStatus

int getNodeStatus()
Get the status as an integer defined in MIBConstants. Valid only when using compiled modules.

Returns:
the status constant defined in MIBConstants. -1 if not available or if using non-compiled MIBs.

getNodeAccess

int getNodeAccess()
Get the access as an integer defined in MIBConstants. Valid only when using compiled modules.

Returns:
the access constant defined in MIBConstants. -1 if not available or if using non-compiled MIBs.

getNodeAccessStr

java.lang.String getNodeAccessStr()
Get the String corresponding to the access clause Valid only for compiled modules.


getDescription

public java.lang.String getDescription()
Gets the description for this node


getReference

public java.lang.String getReference()
Gets string reference for this node. This clause specifies the source of the definition e.g documents from standards organization or a document for a proprietary system.


getIndexNames

public java.util.Vector getIndexNames()
Gives the index names defined for this node.

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.

Returns:
Vector of the index names.
null, if the node is not a table entry or if the table entry doesnot have the INDEX clause.
See Also:
getIndexes(com.adventnet.snmp.mibs.MibOperations), printIndex()

getDefval

public java.lang.String getDefval()
The defval for this node can be obtained using this method.

Returns:
The defval for the node if present.
empty String if there is no DEFVAL field.

setDefval

public void setDefval(java.lang.String defval)
Sets the defval as defined in the MIB. The value set is not reflected in the MIB. To check whether the value is set, the getDefval() method can be used.

Parameters:
defval - the value to be set.
See Also:
getDefval()

getTableSequence

public java.lang.String getTableSequence()
Gets the name in the SEQUENCE OF "name" item

Returns:
the name of the SEQUENCE.
null, if not a table node.

getRowName

public java.lang.String getRowName()
Gets the name of the row sequence.

Returns:
the name of the SEQUENCE.
null, if not a table entry

getTableItems

public java.util.Vector getTableItems()
Will give the names of the items in the row sequence.

Returns:
the columnar fields of the table as a Vector.
null, if not a table node.

getIsAugmented

public boolean getIsAugmented()
Used to know whether the entry node contains the AUGMENTS clause.

Returns:
true if the AUGMENTS clause is present in the entry node.
false otherwise.

getUnits

public java.lang.String getUnits()
Gets the value of UNITS clause in OBJECT-TYPE macro

Returns:
the value present in the UNITS clause
empty String if the UNITS clause is not present.

getLastupdated

public java.lang.String getLastupdated()
Gets the value of the LAST-UPDATED clause in MODULE-IDENTITY macro

Returns:
the value of LAST-UPDATED clause
null if the macro-type is not MODULE-IDENTITY

getOrganization

public java.lang.String getOrganization()
Gets the value of ORGANIZATION clause in MODULE-IDENTITY macro

Returns:
the value of ORGANIZATION clause
null, if the macro-type is not MODULE-IDENTITY

getContactinfo

public java.lang.String getContactinfo()
Gets the value of CONTACT-INFO clause in MODULE-IDENTITY macro

Returns:
the value of the CONTACT-INFO clause
null, if the macro-type is not MODULE-IDENTITY

getRevision

public java.lang.String getRevision()
Deprecated. since 4.0. Instead you can use the method getRevisions()

Gets the value of REVISION clause in MODULE-IDENTITY macro

Returns:
the value of REVISION clause
null, if the macro-type is not MODULE-IDENTITY
See Also:
getRevisions()

getRevdescription

public java.lang.String getRevdescription()
Deprecated. since 4.0. Instead you can use the method getRevisionDescriptions()

Gets the value of DESCRIPTION field under REVISION clause in MODULE-IDENTITY macro

Returns:
the DESCRIPTION value
null, if the macro-type is not MODULE-IDENTITY
See Also:
getRevisionDescriptions()

getModuleCompliance

public java.util.Vector getModuleCompliance()
Gets the various clauses in MODULE-COMPLIANCE macro. The Vector contains all the clauses in the MODULE-COMPLIANCE macro (MODULE, OBJECTS, GROUPS etc.)

Returns:
Vector of MibModuleCompliance object
empty vector, if the macro-type is not MODULE-COMPLIANCE

getAgentCapabilities

public java.util.Vector getAgentCapabilities()
Gets the various clauses in AGENT-CAPABILITIES as a Vector of AgentCapabilitiesModule

Returns:
Vector of AgentCapabilities object
empty Vector if the macro-type is not AGENT-CAPABILITIES

getObjectNames

public java.lang.String getObjectNames()
Deprecated. use the getObjects method instead.

Gets the OBJECT clause names in OBJECT-GROUP and NOTIFICATION-TYPE macro

See Also:
getObjects()

getNotificationsNames

public java.lang.String getNotificationsNames()
Gets the NOTIFICATIONS clause names in NOTIFICATION-GROUP macro

Returns:
the value present in the NOTIFICATIONS clause.
null, if the macro-type is not NOTIFICATION-GROUP

getProductrelease

public java.lang.String getProductrelease()
Get the value of PRODUCT-RELEASE clause in AGENT-CAPABILITIES macro

Returns:
the value of PRODUCT-RELEASE clause.
null, if the macro-type is not AGENT-CAPABILITIES.

isAncestorOf

public boolean isAncestorOf(MibNode node)
Used to know whether this node is an ancestor of the specified node.

Parameters:
node - the MibNode object.
Returns:
true if the node is ancestor of the specified node.
false otherwise.

isDescendentOf

public boolean isDescendentOf(MibNode node)
Using this method we can find whether this node is descendent of the specified node.

Parameters:
node - the MibNode object
Returns:
true if this node is descendent of the specified node.
false otherwise.

getCommonAncestorWith

public MibNode getCommonAncestorWith(MibNode node)
Gives the common ancestor node for this node and the specified node.

Parameters:
node - the MibNode object
Returns:
the parent node which is common to both the nodes.
null, if there are no common ancestor
eg: for the nodes one under iso root and the other under ccitt root, this method will return null.

compare

int compare(int[] a,
            int[] b,
            int len)
A comparison routine. Returns -1 if a less than b. +1 if b is greater than A. 0 if a and b are same. Checks only till len ints or b's length whichever is smaller. This does not properly handle oid arrays containing negative integers.


printAccess

public java.lang.String printAccess()
Gives the access value as a string.

Returns:
the access string (read-only, write-only, read-write, not-accessible, read-create, accessible-for-notify)
null, if none of these.

printStatus

public java.lang.String printStatus()
Returns the status value as a string.


printDescription

public java.lang.String printDescription()
Returns the Description string


printReference

public java.lang.String printReference()
Returns the Reference string


getImpliedNode

public java.lang.String getImpliedNode()
Gives the implied node name present in the INDEX list of this MIB node.

Returns:
The implied node name, if the IMPLIED keyword is present
null otherwise.

isIndex

public boolean isIndex()
Using this method we can find whether this is an index node.

Returns:
true if this is an index node
false otherwise.

getExternalIndices

public java.util.Vector getExternalIndices()
Gets the external indices present in the table entry

Returns:
Vector of node names which is imported from the other table entry
empty vector if not a tableEntry or if the node doesn't contain external indices.

getImportedModuleName

public java.lang.String getImportedModuleName()
Gets the name of the module from where this node is imported. The standard nodes and TCs are not imported since they are predefined.


getIndexModuleName

java.lang.String getIndexModuleName(java.lang.String indexName,
                                    MibOperations mibs)

processStringValue

SnmpVar processStringValue(java.lang.String value)
                     throws MibException,
                            SnmpException
Throws:
MibException
SnmpException

processIPAddressValue

SnmpVar processIPAddressValue(java.lang.String value)
                        throws MibException,
                               SnmpException
Throws:
MibException
SnmpException

processObjectIDValue

SnmpVar processObjectIDValue(java.lang.String value)
                       throws MibException,
                              SnmpException
Throws:
MibException
SnmpException

processIpv6AddressValue

SnmpVar processIpv6AddressValue(java.lang.String value)
                          throws MibException,
                                 SnmpException
Throws:
MibException
SnmpException

getDefOIDStr

java.lang.String getDefOIDStr()