|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.snmp.mibs.LeafSyntax | +--com.adventnet.snmp.mibs.MibTC
This class represents a TEXTUAL-CONVENTION macro in a MIB module. As it is a subclass of LeafSyntax, we can create new SNMP variables with the given syntax. We can also check syntax rules on variables, and get more information on the syntax.
The TEXTUAL-CONVENTION macro is present only in an SMIv2 MIB.
The MibTC object can be obtained in any one of the following methods after loading the MIB file containg the TC
MibOperations mibOps = new MibOperations(); mibOps.loadMibModules("mibFile");Method 1 MibModule module = mibops.getMibModule("TC1-MIB"); MibTC tc = module.getMibTC("tcName");
Method 2 MibModule module = mibOps.getMibModule("moduleName"); Enumeration en = module.getDefinedTCs(); while(en.hasMoreElements()) { MibTC tc = (MibTC)en.nextElement(); }
Method 3 If the syntax of the node is a TC, MibNode node = mibOps.getMibNode("nodeLabel"); MibTC tc = (MibTC)node.getSyntax();
Method 4 MibOperations mibOps = new MibOperations(); mibOps.loadMibModule("mibFile"); MibTC tc = (MibTC)mibOps.getSyntaxByName("tcName");
The following table list the fields present in a TEXTUAL-CONVENTION macro and the methods for retreiving the corresponding field values.
Fields | Methods for retreving the values |
DISPLAY-HINT | getDisplayHint() |
STATUS | getStatus() |
DESCRIPTION | getDescription() |
REFERENCE | getReference() |
Example for a TEXTUAL-CONVENTION defined in an SMIv2 MIB.
PhysAddress ::= TEXTUAL-CONVENTION DISPLAY-HINT "1x:" STATUS current DESCRIPTION "Represents media- or physical-level addresses." SYNTAX OCTET STRING
In SMIv2 the equivalent for TEXTUAL-CONVENTION is Type Assignment
Example for a Type Assignment defined in an SMIv1 MIB.
PhysAddress ::= OCTET STRING
In case of an SMIv1 TC, the DISPLAY-HINT, STATUS, DESCRIPTION and the REFERENCE clause values are empty string.
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 | |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
java.lang.String |
getDisplayHint()
Gets the DISPLAY-HINT field in this TC. |
java.lang.String |
getName()
Returns the name of this TEXTUAL-CONVENTION. |
java.lang.String |
getReference()
Gets the REFERENCE string for this TC. |
java.lang.String |
getStatus()
Gets the STATUS field value for this TC. |
LeafSyntax |
getSyntax()
Gets the syntax associated with this TC. |
java.lang.String |
getTCDescription()
Gets the DESCRIPTION string for this TC. |
java.lang.String |
toString()
Returns the name of this TEXTUAL-CONVENTION. |
Methods inherited from class com.adventnet.snmp.mibs.LeafSyntax |
checkValue, checkValue, createVariable, createVariable, decodeInstanceString, encodeInstanceString, getDescription, getEnumint, getEnumlabels, getEquivname, getInt, getLabel, getMax, getMin, getRangeItems, getSize, getType, isConstrained, isEnumerated, isRanged, toTagString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public LeafSyntax getSyntax()
For example, if the syntax of the TC "LevelA" is OCTET STRING, then this method will return OCTET STRING as a LeafSyntax object.
getSyntax
in class LeafSyntax
public java.lang.String getDisplayHint()
MibOperations.enableDisplayHint(boolean)
public java.lang.String toString()
toString
in class LeafSyntax
getName()
public java.lang.String getName()
getName
in class LeafSyntax
toString()
public java.lang.String getStatus()
public java.lang.String getTCDescription()
public java.lang.String getReference()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class LeafSyntax
java.lang.CloneNotSupportedException
- is thrown if the object's class
does not support the interface which could be cloned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |