All Packages Class Hierarchy This Package Previous Next Index
Class Snmp.SnmpOID
java.lang.Object
|
+----Snmp.SnmpVar
|
+----Snmp.SnmpOID
- public class SnmpOID
- extends SnmpVar
Class of SNMP Object ID - Sub-class of SnmpVar.
This is the important Object ID class. Used widely
to create and interpret Object IDs, use them in SNMP PDUs
to get/set data, and relate SNMP variables to MIB data.
Includes methods for printing, converting, and associating MIB nodes
-
byteValue
-
-
node
- The MIB node corresponding to the OID - automatically populated
by only some of the constructors
-
value
-
-
SnmpOID(String)
- Requires the argument to be a String OID of the form .N.N.N, or
N.N.N in which case the static Standard_Prefix in the SnmpAPI
class is used.
-
SnmpOID(String, MibModule)
- Requires the first argument to be an OID of the form .N.N.N..., or
N.N.N..., in which case the static Standard_Prefix in the SnmpAPI
class is used.
-
SnmpOID(String, SnmpAPI)
- Requires the first argument to be an OID of the form .N.N.N..., or
N.N.N..., in which case the static Standard_Prefix in the SnmpAPI
class is used.
-
getNearestNode(SnmpAPI)
- This does a search of all MIB modules in SnmpAPI specified and
fills in the Nearest MibNode for this SnmpOID instance if found.
-
getNode(MibModule)
- This does a search of the MIB module specified and
fills in the MibNode for this SnmpOID instance if found
-
getNode(SnmpAPI)
- This does a search of all MIB modules in SnmpAPI specified and
fills in the MibNode for this SnmpOID instance if found
-
nodeLabel()
- To get the name (label) of the MIB node this OID corresponds to.
-
toBytes()
- To return the value as raw bytes
-
toShortString()
- To convert the object to a short string label.instance if the
appropriate MIB is loaded.
-
toString()
- To convert the object to a printable string used in printing
If node is not null, i.e.
-
toTagString()
- To convert the object to a printable string tagged with Object ID:
-
toValue()
- Function to return Object ID value as an array of longs
value
protected long value[]
byteValue
protected byte byteValue[]
node
public MibNode node
- The MIB node corresponding to the OID - automatically populated
by only some of the constructors
SnmpOID
public SnmpOID(String s)
- Requires the argument to be a String OID of the form .N.N.N, or
N.N.N in which case the static Standard_Prefix in the SnmpAPI
class is used. This constructor requires N be a number, not a name.
In this case an explicit call to the getNode
method is needed to populate the (MibNode) node
SnmpOID
public SnmpOID(String s,
SnmpAPI api)
- Requires the first argument to be an OID of the form .N.N.N..., or
N.N.N..., in which case the static Standard_Prefix in the SnmpAPI
class is used. N can be a number or a name.
This does the search of MIB modules of the SnmpAPI
specified and fills in the MibNode for the SnmpOID instance.
Also supports simple "label" or "label.N" strings to create OIDs,
where label is the label of a node in the MIB tree (and is a leaf node
in the latter case).
SnmpOID
public SnmpOID(String s,
MibModule module)
- Requires the first argument to be an OID of the form .N.N.N..., or
N.N.N..., in which case the static Standard_Prefix in the SnmpAPI
class is used. N can be a number or a name.
This does search the MIB module specified and
fills in the MibNode for this SnmpOID instance if found
Also supports simple "label" or "label.N" strings to create OIDs,
where label is the label of a node in the MIB tree (and is a leaf node
in the latter case).
getNode
public MibNode getNode(SnmpAPI api)
- This does a search of all MIB modules in SnmpAPI specified and
fills in the MibNode for this SnmpOID instance if found
getNode
public MibNode getNode(MibModule module)
- This does a search of the MIB module specified and
fills in the MibNode for this SnmpOID instance if found
getNearestNode
public MibNode getNearestNode(SnmpAPI api)
- This does a search of all MIB modules in SnmpAPI specified and
fills in the Nearest MibNode for this SnmpOID instance if found.
The mib node need not be a leaf node
toValue
public Object toValue()
- Function to return Object ID value as an array of longs
- Overrides:
- toValue in class SnmpVar
toBytes
public byte[] toBytes()
- To return the value as raw bytes
- Overrides:
- toBytes in class SnmpVar
nodeLabel
public String nodeLabel()
- To get the name (label) of the MIB node this OID corresponds to.
If node is not null, i.e. node has been populated,
the label will be returned, else null will be returned.
toString
public String toString()
- To convert the object to a printable string used in printing
If node is not null, i.e. node has been populated,
the names will be returned
- Overrides:
- toString in class SnmpVar
toTagString
public String toTagString()
- To convert the object to a printable string tagged with Object ID:
- Overrides:
- toTagString in class SnmpVar
toShortString
public String toShortString()
- To convert the object to a short string label.instance if the
appropriate MIB is loaded. Otherwise return the numeric .N.N...
All Packages Class Hierarchy This Package Previous Next Index