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.


Variable Index

 o meta
Reference to a mib store service.

Constructor Index

 o SnmpOid()
Constructs a new SnmpOid with no components.
 o SnmpOid(long)
Constructs a new SnmpOid containing one component with the specified value.
 o SnmpOid(long, long, long, long)
Constructs a new SnmpOid containing four components with the specified value.
 o SnmpOid(long[])
Constructs a new SnmpOid with the specified components.
 o SnmpOid(String)
Constructs a new SnmpOid from a dot-formatted string or a MIB variable name.

Method Index

 o addToOid(long[])
Adds a array of integers to end an oidDots of an SnmpOid.
 o addToOid(String)
Adds a dot-formatted OID string to an existing SnmpOid.
 o append(long)
Append the specified SnmpOid to the end of this one.
 o append(SnmpOid)
Append the specified SnmpOid to the end of this one.
 o appendToOid(SnmpOid, SnmpOid)
Append an SnmpOid representing an SnmpOid to another Oid.
 o clone()
Clones the SnmpOid object, making a copy of its data.
 o compareTo(SnmpOid)
Compare to OIDs lexicographically.
 o duplicate()
Performs a clone action.
 o equals(Object)
Check if two oids are equal.
 o getLength()
Return the number of components in this Oid.
 o getTypeName()
Returns a textual description of the object.
 o hashCode()
Returns a hashcode for this SnmpOid.
 o insert(int)
Same as previous but with an int as argument.
 o insert(long)
Insert an subid at the beginning of this SnmpOid.
 o isValid()
Check the validity of the oid.
 o longValue()
Convert the oid to a long array.
 o nextOid(long[], int)
Scan an index oid, skip the oid value and returns the position of the next value.
 o resolveVarName(String)
Resolves a MIB variable with the MIB database.
 o toBoolean()
 o toByte()
 o toInteger()
 o toLong()
 o toOid()
Convert the oid to its oid form.
 o toOid(long[], int)
Extract the oid from an index oid and returns its value converted as an Oid.
 o toString()
Return the string form of the oid.

Variables

 o 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.

Constructors

 o SnmpOid
 public SnmpOid()
Constructs a new SnmpOid with no components.

 o SnmpOid
 public SnmpOid(long oidComponents[])
Constructs a new SnmpOid with the specified components.

Parameters:
v - The component array.
 o SnmpOid
 public SnmpOid(long id)
Constructs a new SnmpOid containing one component with the specified value.

Parameters:
id - The component value.
 o 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.
 o 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.

Methods

 o getLength
 public int getLength()
Return the number of components in this Oid.

Returns:
The number of components
 o insert
 public void insert(long id)
Insert an subid at the beginning of this SnmpOid.

Parameters:
id - The subid to insert.
 o insert
 public void insert(int id)
Same as previous but with an int as argument.

Parameters:
id - The subid to insert.
 o append
 public void append(SnmpOid oid)
Append the specified SnmpOid to the end of this one.

Parameters:
oid - The OID to append.
 o append
 public void append(long id)
Append the specified SnmpOid to the end of this one.

Parameters:
oid - The OID to append.
 o 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.
 o 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.
 o isValid
 public boolean isValid()
Check the validity of the oid.

Returns:
true if the oid is valid.
 o hashCode
 public int hashCode()
Returns a hashcode for this SnmpOid.

Returns:
a hashcode for this SnmpOid.
Overrides:
hashCode in class Object
 o 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
 o 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.
 o toString
 public String toString()
Return the string form of the oid.

Returns:
The oid expressed with dot notation.
Overrides:
toString in class Object
 o toInteger
 public Integer toInteger()
 o toLong
 public Long toLong()
 o toBoolean
 public Boolean toBoolean()
 o toByte
 public Byte[] toByte()
 o toOid
 public SnmpOid toOid()
Convert the oid to its oid form.

Returns:
The oid form
Overrides:
toOid in class SnmpValue
 o longValue
 public long[] longValue()
Convert the oid to a long array.

Returns:
The array
 o 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
 o 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
 o 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.
 o getTypeName
 public String getTypeName()
Returns a textual description of the object.

Returns:
ASN.1 textual description.
Overrides:
getTypeName in class SnmpValue
 o 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.
 o duplicate
 public final synchronized SnmpValue duplicate()
Performs a clone action. This provides a workaround for the SnmpValue interface.

Overrides:
duplicate in class SnmpValue
 o 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