|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jaw.snmp.common.SnmpValue | +--com.sun.jaw.snmp.common.SnmpOid
The SnmpOid
class represents an SNMP oid.
Field Summary | |
protected int |
componentCount
The length of the components array. |
protected long[] |
components
The components array. |
static MibStoreIfSrv |
meta
Reference to a mib store service. |
Constructor Summary | |
SnmpOid()
Constructs a new SnmpOid with no components. |
|
SnmpOid(long id)
Constructs a new SnmpOid containing one component with the
specified value. |
|
SnmpOid(long[] oidComponents)
Constructs a new SnmpOid from the specified component array. |
|
SnmpOid(long id1,
long id2,
long id3,
long id4)
Constructs a new SnmpOid containing four components with the
specified values. |
|
SnmpOid(java.lang.String s)
Constructs a new SnmpOid from a dot-formatted String or a MIB variable
name. |
Method Summary | |
void |
addToOid(long[] oid)
Adds the specified array of longs to the end of this SnmpOid . |
void |
addToOid(java.lang.String s)
Adds the specified dot-formatted oid String to the end of this SnmpOid . |
void |
append(long id)
Appends the specified long to the end of this SnmpOid . |
void |
append(SnmpOid oid)
Appends the specified SnmpOid to the end of this SnmpOid . |
static void |
appendToOid(SnmpOid source,
SnmpOid dest)
Appends an SnmpOid representing an SnmpOid to another oid. |
java.lang.Object |
clone()
Clones the SnmpOid object, making a copy of its data. |
int |
compareTo(SnmpOid other)
Compares two oids lexicographically. |
SnmpValue |
duplicate()
Performs a clone action. |
protected void |
enlargeIfNeeded(int n)
Checks if there is enough space in the components array to insert n new subids. |
boolean |
equals(java.lang.Object o)
Checks if the specified Object is equal to this SnmpOid . |
int |
getLength()
Gets the number of components in this oid. |
java.lang.String |
getTypeName()
Returns a textual description of the type object. |
int |
hashCode()
Returns a hashcode for this SnmpOid . |
void |
insert(int id)
Inserts a subid at the beginning of this SnmpOid . |
void |
insert(long id)
Inserts a subid at the beginning of this SnmpOid . |
boolean |
isValid()
Checks the validity of the oid. |
long[] |
longValue()
Returns a copy of the components array of this SnmpOid . |
static int |
nextOid(long[] index,
int start)
Scans an index oid, skips the oid value and returns the position of the next value. |
java.lang.String |
resolveVarName(java.lang.String s)
Resolves a MIB variable String with the MIB database. |
java.lang.Boolean |
toBoolean()
Converts the oid value to its Boolean form. |
java.lang.Byte[] |
toByte()
Converts the oid value to its array of Bytes form. |
java.lang.Integer |
toInteger()
Converts the oid value to its Integer form. |
java.lang.Long |
toLong()
Converts the oid value to its Long form. |
SnmpOid |
toOid()
Converts the oid value to its SnmpOid form. |
static SnmpOid |
toOid(long[] index,
int start)
Extracts the oid from an index oid and returns its value converted as an SnmpOid . |
java.lang.String |
toString()
Converts the oid value to its String form. |
Methods inherited from class com.sun.jaw.snmp.common.SnmpValue |
toAsn1String |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected long[] components
protected int componentCount
public static MibStoreIfSrv meta
Constructor Detail |
public SnmpOid()
SnmpOid
with no components.public SnmpOid(long[] oidComponents)
SnmpOid
from the specified component array.oidComponents
- The initialization component array.public SnmpOid(long id)
SnmpOid
containing one component with the
specified value.id
- The initialization component value.public SnmpOid(long id1, long id2, long id3, long id4)
SnmpOid
containing four components with the
specified values.idx
- The initialization component values.public SnmpOid(java.lang.String s) throws java.lang.IllegalArgumentException
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.s
- String
or MIB variable of the form .1.2.3 or 1.2.3 or ifInOctets
.String
nor a String
of the MIB database.Method Detail |
public int getLength()
public long[] longValue()
SnmpOid
.public java.lang.Long toLong()
Long
form.Long
representation of the value.public java.lang.Integer toInteger()
Integer
form.Integer
representation of the value.public java.lang.String toString()
String
form.String
representation of the value.public java.lang.Boolean toBoolean()
Boolean
form.Boolean
representation of the value.public java.lang.Byte[] toByte()
Bytes
form.Bytes
representation of the value.public SnmpOid toOid()
SnmpOid
form.public int hashCode()
SnmpOid
.public static SnmpOid toOid(long[] index, int start) throws SnmpStatusException
SnmpOid
.index
- The index array.start
- The position in the index array.public static int nextOid(long[] index, int start) throws SnmpStatusException
index
- The index array.start
- The position in the index array.public static void appendToOid(SnmpOid source, SnmpOid dest)
SnmpOid
representing an SnmpOid
to another oid.source
- An oid representing an SnmpOid
value.dest
- Where source should be appened.public final SnmpValue duplicate()
SnmpValue
interface.public java.lang.Object clone()
SnmpOid
object, making a copy of its data.public void insert(long id)
SnmpOid
.id
- The long subid to insert.public void insert(int id)
SnmpOid
.id
- The integer subid to insert.public void append(SnmpOid oid)
SnmpOid
to the end of this SnmpOid
.oid
- The oid to append.public void append(long id)
SnmpOid
.id
- The long to append.public void addToOid(java.lang.String s) throws SnmpStatusException
String
to the end of this SnmpOid
.
The subidentifiers can be expressed as a dot-formatted String
or a
MIB variable name.s
- Variable name of the form .1.2.3 or 1.2.3 or
ifInOctets
.public void addToOid(long[] oid) throws SnmpStatusException
SnmpOid
.oid
- An array of longs.public boolean isValid()
public boolean equals(java.lang.Object o)
Object
is equal to this SnmpOid
.o
- The Object
to be compared.o
is an SnmpOid
instance and equals to this; false otherwise.public int compareTo(SnmpOid other)
other
- The oid to be compared.other
is equal to this SnmpOid
.
A value smaller than 0 if this SnmpOid
is lexicographically smaller than other
.
A value larger than 0 if this SnmpOid
is lexicographically larger than other
.public java.lang.String resolveVarName(java.lang.String s) throws SnmpStatusException
String
with the MIB database.s
- The variable name to resolve.public java.lang.String getTypeName()
protected void enlargeIfNeeded(int n)
n
- The number of subids to insert.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |