All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.jaw.snmp.common.SnmpOid
java.lang.Object
|
+----com.sun.jaw.snmp.common.SnmpValue
|
+----com.sun.jaw.snmp.common.SnmpOid
- public class SnmpOid
- extends SnmpValue
The SnmpOid class represents an SNMP oid.
-
meta
- Reference to a mib store service.
-
SnmpOid()
- Constructs a new SnmpOid with no components.
-
SnmpOid(long)
- Constructs a new SnmpOid containing one component with the
specified value.
-
SnmpOid(long, long, long, long)
- Constructs a new SnmpOid containing four components with the
specified value.
-
SnmpOid(long[])
- Constructs a new SnmpOid with the specified components.
-
SnmpOid(String)
- Constructs a new
SnmpOid from a dot-formatted string or a MIB variable
name.
-
addToOid(long[])
- Adds a array of integers to end an
oidDots of an SnmpOid.
-
addToOid(String)
- Adds a dot-formatted OID string to an existing
SnmpOid.
-
append(long)
- Append the specified SnmpOid to the end of this one.
-
append(SnmpOid)
- Append the specified SnmpOid to the end of this one.
-
appendToOid(SnmpOid, SnmpOid)
- Append an SnmpOid representing an SnmpOid to another Oid.
-
clone()
- Clones the
SnmpOid object, making a copy of its data.
-
compareTo(SnmpOid)
- Compare to OIDs lexicographically.
-
duplicate()
- Performs a clone action.
-
equals(Object)
- Check if two oids are equal.
-
getLength()
- Return the number of components in this Oid.
-
getTypeName()
- Returns a textual description of the object.
-
hashCode()
- Returns a hashcode for this SnmpOid.
-
insert(int)
- Same as previous but with an int as argument.
-
insert(long)
- Insert an subid at the beginning of this SnmpOid.
-
isValid()
- Check the validity of the oid.
-
longValue()
- Convert the oid to a long array.
-
nextOid(long[], int)
- Scan an index oid, skip the oid value and returns the position
of the next value.
-
resolveVarName(String)
- Resolves a MIB variable with the MIB database.
-
toBoolean()
-
-
toByte()
-
-
toInteger()
-
-
toLong()
-
-
toOid()
- Convert the oid to its oid form.
-
toOid(long[], int)
- Extract the oid from an index oid and returns its
value converted as an Oid.
-
toString()
- Return the string form of the oid.
meta
public static MibStoreIfSrv meta
- Reference to a mib store service. If no mib store service is available,
the class will not be able to resolved named contained in Object identifier.
SnmpOid
public SnmpOid()
- Constructs a new SnmpOid with no components.
SnmpOid
public SnmpOid(long oidComponents[])
- Constructs a new SnmpOid with the specified components.
- Parameters:
- v - The component array.
SnmpOid
public SnmpOid(long id)
- Constructs a new SnmpOid containing one component with the
specified value.
- Parameters:
- id - The component value.
SnmpOid
public SnmpOid(long id1,
long id2,
long id3,
long id4)
- Constructs a new SnmpOid containing four components with the
specified value.
- Parameters:
- idx - The component values.
SnmpOid
public SnmpOid(String s) throws IllegalArgumentException
- Constructs a new
SnmpOid from a dot-formatted string or a MIB variable
name. It generates an exception if the variable name cannot be resolved or
if the dot-formatted string has invalid subidentifier.
This constructor helps build an OID object with a string like .1.2.3.4 or 1.2.3.4
or ifInOctets or ifInOctets.0 .
- Parameters:
- name - Variable name of the form .1.2.3 or 1.2.3 or
ifInOctets.
- Throws: IllegalArgumentException
- If the subidentifier is not numeric string.
getLength
public int getLength()
- Return the number of components in this Oid.
- Returns:
- The number of components
insert
public void insert(long id)
- Insert an subid at the beginning of this SnmpOid.
- Parameters:
- id - The subid to insert.
insert
public void insert(int id)
- Same as previous but with an int as argument.
- Parameters:
- id - The subid to insert.
append
public void append(SnmpOid oid)
- Append the specified SnmpOid to the end of this one.
- Parameters:
- oid - The OID to append.
append
public void append(long id)
- Append the specified SnmpOid to the end of this one.
- Parameters:
- oid - The OID to append.
addToOid
public void addToOid(String s) throws SnmpStatusException
- Adds a dot-formatted OID string to an existing
SnmpOid.
The subidentifiers can be expressed as a dot-formatted string or a
MIB variable name.
- Parameters:
- s - Variable name of the form .1.2.3 or 1.2.3 or
ifInOctets.
- Throws: SnmpStatusException
- An error occurred while accessing a MIB node.
addToOid
public void addToOid(long oid[]) throws SnmpStatusException
- Adds a array of integers to end an
oidDots of an SnmpOid.
(For example, snmpoid.addToOid(arrayOfInt) ;.)
- Parameters:
- oid - An array of integers separated by dots.
- Throws: SnmpStatusException
- An error occurred while accessing a MIB node.
isValid
public boolean isValid()
- Check the validity of the oid.
- Returns:
- true if the oid is valid.
hashCode
public int hashCode()
- Returns a hashcode for this SnmpOid.
- Returns:
- a hashcode for this SnmpOid.
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object o)
- Check if two oids are equal.
- Returns:
- true if o is an SnmpOid instance and equals to this.
- Overrides:
- equals in class Object
compareTo
public int compareTo(SnmpOid other)
- Compare to OIDs lexicographically.
- Parameters:
- other - the OID to be compared
- Returns:
- the value 0 if the argument other is equal to this oid
a value less than 0 if this oid is lexicographically less than other
a value greater than 0 if this oid is lexicographically greater than other.
toString
public String toString()
- Return the string form of the oid.
- Returns:
- The oid expressed with dot notation.
- Overrides:
- toString in class Object
toInteger
public Integer toInteger()
toLong
public Long toLong()
toBoolean
public Boolean toBoolean()
toByte
public Byte[] toByte()
toOid
public SnmpOid toOid()
- Convert the oid to its oid form.
- Returns:
- The oid form
- Overrides:
- toOid in class SnmpValue
longValue
public long[] longValue()
- Convert the oid to a long array.
- Returns:
- The array
toOid
public static SnmpOid toOid(long index[],
int start) throws SnmpStatusException
- Extract the oid from an index oid and returns its
value converted as an Oid.
- Returns:
- The SnmpOid representing the oid value
- Throws: SnmpStatusException
- There is no oid value
available at start position
nextOid
public static int nextOid(long index[],
int start) throws SnmpStatusException
- Scan an index oid, skip the oid value and returns the position
of the next value.
- Returns:
- The position of the next value
- Throws: SnmpStatusException
- There is no oid value
available at start position
appendToOid
public static void appendToOid(SnmpOid source,
SnmpOid dest)
- Append an SnmpOid representing an SnmpOid to another Oid.
- Parameters:
- source - An Oid representing an SnmpOid value.
- dest - Where source should be appened.
getTypeName
public String getTypeName()
- Returns a textual description of the object.
- Returns:
- ASN.1 textual description.
- Overrides:
- getTypeName in class SnmpValue
resolveVarName
public String resolveVarName(String s) throws SnmpStatusException
- Resolves a MIB variable with the MIB database.
- Parameters:
- name - The variable name to resolve.
- Throws: SnmpStatusException
- If the variable is not found in MIB database.
duplicate
public final synchronized SnmpValue duplicate()
- Performs a clone action. This provides a workaround for the
SnmpValue interface.
- Overrides:
- duplicate in class SnmpValue
clone
public Object clone()
- Clones the
SnmpOid object, making a copy of its data.
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index