|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.protocols.snmp.SnmpObjectId
Defines the SNMP object identifier class for naming variables. An object identifier is a sequence of numbers that correspond to branches in the Management Information Base (MIB). Each vendor is free to define their own branch of the tree. The SnmpObjectId class provides an interface for naming those tree instances.
Field Summary | |
static byte |
ASNTYPE
Defines the SNMP SMI type for this particular object. |
private int[] |
m_data
The array of object identifiers minimum length for a valid object id is 2 (.0.0) |
(package private) static long |
serialVersionUID
Deifnes the version of the serialization format. |
Constructor Summary | |
SnmpObjectId()
Creates a default empty object identifier. |
|
SnmpObjectId(int[] data)
Creates an object identifier from the passed array of identifiers. |
|
SnmpObjectId(SnmpObjectId second)
Creates a duplicate object. |
|
SnmpObjectId(java.lang.String strOid)
Creates an object identifier from the pased dotted decimal object identifier string. |
Method Summary | |
void |
append(int[] ids)
Appends the specified identifiers to the current object. |
void |
append(SnmpObjectId second)
Appends the passed SnmpObjectId object to self. |
void |
append(java.lang.String strOids)
Converts the passed string to an object identifier and appends them to the current object. |
java.lang.Object |
clone()
Implements the cloneable interface. |
int |
compare(int[] ids)
Lexigraphically compares the object identifer to the array of identifiers. |
int |
compare(int[] ids,
int dist)
Lexigraphically compares the object identifer to the array of identifiers. |
int |
compare(SnmpObjectId cmp)
Lexigraphically compares the object identifer to the passed object identifer. |
private static int[] |
convert(java.lang.String idstr)
Converts a textual object identifier to an array of integer values. |
int |
decodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Decodes the ASN.1 object identifer from the passed buffer. |
SnmpSyntax |
duplicate()
Serves the same purpose as the method clone(). |
int |
encodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Encodes the ASN.1 object identifier using the passed encoder and stores the results in the passed buffer. |
boolean |
equals(java.lang.Object o)
Test for equality. |
int[] |
getIdentifiers()
Gets the array of object identifiers from the object. |
int |
getLastIdentifier()
Returns the value of the last object identifier component value |
int |
getLength()
Gets the number of object identifiers in the object. |
int |
hashCode()
Returns a computed hash code value for the object identifier. |
boolean |
isRootOf(SnmpObjectId leaf)
Compares the passed object identifier against self to determine if self is the root of the passed object. |
void |
prepend(int[] ids)
Prepends the passed set of identifiers to the front of the object. |
void |
prepend(SnmpObjectId second)
Prepends the passed SnmpObjectId object to self. |
void |
prepend(java.lang.String strOids)
Converts the passed string to an object identifier and prepends them to the current object. |
void |
setIdentifiers(int[] data)
Sets the object to the passed object identifier |
void |
setIdentifiers(java.lang.String strOid)
Sets the object to the passed dotted decimal object identifier string. |
java.lang.String |
toString()
Converts the object identifier to a dotted decimal string representation. |
byte |
typeId()
Used to get the ASN.1 type for this particular object. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
private int[] m_data
public static final byte ASNTYPE
Constructor Detail |
public SnmpObjectId()
public SnmpObjectId(int[] data)
data
- The array of object identifierspublic SnmpObjectId(SnmpObjectId second)
second
- The object to copypublic SnmpObjectId(java.lang.String strOid)
strOid
- The dotted decimal object identifier stringMethod Detail |
private static int[] convert(java.lang.String idstr)
idstr
- An object identifier string
public int getLength()
public int getLastIdentifier()
public int[] getIdentifiers()
public void setIdentifiers(int[] data)
data
- The new object identifierpublic void setIdentifiers(java.lang.String strOid)
strOid
- The dotted decimal object identifier.public void append(int[] ids)
ids
- The array of identifiers to appendpublic void append(java.lang.String strOids)
strOids
- The dotted decimal identifiers to appendpublic void append(SnmpObjectId second)
second
- The object to append to selfpublic void prepend(int[] ids)
ids
- The list of identifierspublic void prepend(java.lang.String strOids)
strOids
- The dotted decimal identifiers to prependpublic void prepend(SnmpObjectId second)
second
- The object to prepend to selfpublic int compare(int[] ids)
ids
- The array if identifier to compare
public int compare(int[] ids, int dist)
ids
- The array if identifier to compare.dist
- The maximum number of ids to compare.
public int compare(SnmpObjectId cmp)
cmp
- The object identifier to compare
public boolean isRootOf(SnmpObjectId leaf)
Compares the passed object identifier against self to determine if self is the root of the passed object. If the passed object is in the same root tree as self then a true value is returned. Otherwise a false value is returned from the object.
leaf
- The object to be tested
public boolean equals(java.lang.Object o)
o
- The object to be tested for equality.
public java.lang.String toString()
public int hashCode()
public byte typeId()
typeId
in interface SnmpSyntax
public int encodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnEncodingException
encodeASN
in interface SnmpSyntax
buf
- The buffer to write the encoded information.offset
- The offset to start writing informationencoder
- The encoder object.
AsnEncodingException
- Thrown if the encoder finds an error in the buffer.public int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingException
decodeASN
in interface SnmpSyntax
buf
- The encode bufferoffset
- The offset byte to begin decodingencoder
- The decoder object.
AsnDecodingException
- Thrown by the encoder if an error occurs trying to decode
the data buffer.public SnmpSyntax duplicate()
duplicate
in interface SnmpSyntax
public java.lang.Object clone()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |