| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.adventnet.snmp.mibs.LeafSyntax
This class represents the syntax of a leaf node in a MIB module. If the appropriate MIB is loaded, the LeafSyntax instance for an ObjectID could be obtained from the MibOperations object using the following method.
          mibOperations.getLeafSyntax(SnmpOID);
  
  The LeafSyntax instance for a MIB Node can be obtained from the 
  MibNode instance using the following method.
  
          mibNode.getSyntax();
  
  Once you have the LeafSyntax instance for a node, you can create new SNMP variables with the given syntax, check syntax rules on variables, and get more information on the syntax.
| Method Summary | |
 boolean | 
checkValue(int i)
Checks to see if the integer value argument is in the defined range for this syntax definition.  | 
 boolean | 
checkValue(java.lang.String s)
Checks to see if the String value argument is in the defined range for this syntax definition.  | 
 java.lang.Object | 
clone()
Creates and returns a copy of this object.  | 
 SnmpVar | 
createVariable(java.lang.String value)
Instantiates and returns an SnmpVar of type specified by this Syntax.  | 
 SnmpVar | 
createVariable(java.lang.String value,
               java.lang.String enc)
Instantiates and returns an SnmpVar of type specified by this Syntax with respect to the encoding scheme.  | 
 java.util.Vector | 
decodeInstanceString(java.lang.String instance,
                     java.util.Vector indexMibNodes)
Decodes an instance string based on the instance and indexMibNodes.  | 
 int[] | 
encodeInstanceString(java.util.Vector indexVector,
                     java.util.Vector indexMibNodes)
Encodes an instance string based on the indexVector and indexMibNodes.  | 
 java.lang.String | 
getDescription()
Returns the description of the syntax.  | 
 int[] | 
getEnumint()
Gets the values for each of the enumerated integer values  | 
 java.lang.String[] | 
getEnumlabels()
Gets the labels for each of the enumerated integer values  | 
 java.lang.String | 
getEquivname()
Gets the equivalent SNMP type name.  | 
 int | 
getInt(java.lang.String s)
Gets the int value of the label argument.  | 
 java.lang.String | 
getLabel(int val)
Gets the label corresponding to the integer value argument.  | 
 long | 
getMax()
Gives the maximum value allowed for integer type syntaxes  | 
 long | 
getMin()
Gives the minimum value allowed for integer type syntaxes  | 
 java.lang.String | 
getName()
Returns the name of this LeafSyntax instance.  | 
 java.lang.String[] | 
getRangeItems()
Gets the range constraints available for this syntax.  | 
 int | 
getSize()
Gives the maximum Size restriction for this syntax.  | 
 LeafSyntax | 
getSyntax()
Gives the syntax for this leafSyntax Object.  | 
 byte | 
getType()
Retrieves the SNMP ASN.1 tag value for this syntax.  | 
 boolean | 
isConstrained()
Checks to see if the syntax has some range/size limitations explicitly defined in the MIB.  | 
 boolean | 
isEnumerated()
Checks to see if the syntax is enumerated.  | 
 boolean | 
isRanged()
Checks to see if this syntax has size or value limitations.  | 
 java.lang.String | 
toString()
Returns the syntax name for display purposes.  | 
 java.lang.String | 
toTagString()
Gives the detailed description of this syntax.  | 
| Method Detail | 
public java.lang.String getName()
public java.lang.String getDescription()
public byte getType()
public java.lang.String getEquivname()
public java.lang.String[] getEnumlabels()
getLabel(int)public int[] getEnumint()
getInt(java.lang.String)public int getSize()
getMin(), 
getMax()public long getMin()
public long getMax()
public SnmpVar createVariable(java.lang.String value,
                              java.lang.String enc)
                       throws SnmpException
value - the string representation of the value.enc - the string for the encoding scheme to be used.SnmpException - is thrown on format errors.
public SnmpVar createVariable(java.lang.String value)
                       throws SnmpException
value - the string representation of the value.SnmpException - is thrown on format errors.public java.lang.String toString()
getName()public java.lang.String toTagString()
public java.lang.String getLabel(int val)
val - the integer value which ought to be one of the enumerations.public int getInt(java.lang.String s)
s - the string value which should be one of the enumerations.public boolean checkValue(int i)
i - the integer value.public boolean checkValue(java.lang.String s)
s - the string value.public boolean isConstrained()
public boolean isEnumerated()
public boolean isRanged()
isEnumerated()
public int[] encodeInstanceString(java.util.Vector indexVector,
                                  java.util.Vector indexMibNodes)
                           throws java.lang.NumberFormatException
| tcpConnState | tcpConnLocalAddress | tcpConnLocalPort | tcpConnRemAddress | tcpConnRemPort | 
| established(5) | 128.253.154.64 | 23 | 128.253.154.3 | 1111 | 
SnmpIpAddress corresponding to 128.253.154.64 . SnmpInt corresponding to port 23 . SnmpIpAddress corresponding to 128.253.154.3 and. SnmpInt corresponding to port 1111 . These should be in this very order.
The return value in this case will contain the int array containing 128.253.154.64.23.128.253.154.3.1111 , the subids forming components of the array.
indexVector - Vector of SnmpVar instances. Each instance should 
                    correspond to the index component value.indexMibNodes - Vector containing the nodes corresponding to the 
                    index MibNodes.
public java.util.Vector decodeInstanceString(java.lang.String instance,
                                             java.util.Vector indexMibNodes)
                                      throws java.lang.NumberFormatException
instance - the encoded instance StringindexMibNodes - Vector containing the nodes corresponding to the index MibNodes.public LeafSyntax getSyntax()
public java.lang.String[] getRangeItems()
public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException - is thrown if the object's class does not support the 
 Cloneable interface.
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||