|
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.SnmpVarBind
This class defined the SNMP variables that are transmitted to and from an agent. A variable is defined by its name (a SnmpObjectId) and its value (SnmpSyntax). The SnmpVarBind is used by the SnmpPduPacket class and uses SnmpObjectId along with any class that implements the SnmpSyntax interface.
SnmpSyntax
,
SnmpPduPacket
,
Serialized FormField Summary | |
static byte |
ASNTYPE
The ASN.1 identifier used to mark SNMP variables |
private SnmpObjectId |
m_name
The object identifier that uniquely identifies the "value". |
private SnmpSyntax |
m_value
The actual value object associated with the object identifier. |
(package private) static long |
serialVersionUID
Allows for evolution of serialization format. |
Constructor Summary | |
SnmpVarBind()
The default class constructor. |
|
SnmpVarBind(SnmpObjectId name)
Constructs a specific variable with the "name" equal to the passed object identifier. |
|
SnmpVarBind(SnmpObjectId name,
SnmpSyntax value)
Constructs a variable with the passed name and value. |
|
SnmpVarBind(SnmpVarBind second)
Class copy constructor. |
|
SnmpVarBind(java.lang.String name)
Constructs a new variable with the give name. |
|
SnmpVarBind(java.lang.String name,
SnmpSyntax value)
Constructs a new variable with the passed name and value. |
Method Summary | |
java.lang.Object |
clone()
Returns a newly created duplicate object to the caller |
int |
decodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Used to recover the encoded variable data from the passed ASN.1 buffer. |
SnmpSyntax |
duplicate()
Returns a newly created duplicate object to the caller |
int |
encodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Encodes the SnmpVarBind object into the passed buffer. |
SnmpObjectId |
getName()
Returns the object identifier that names the variable. |
SnmpSyntax |
getValue()
Retreives the variable's value. |
void |
setName(SnmpObjectId name)
Sets the variable's object identifier name. |
void |
setName(java.lang.String name)
Sets the variable's name to passed value. |
void |
setValue(SnmpSyntax value)
Sets the value for the variable |
java.lang.String |
toString()
Converts the object to a string representation |
byte |
typeId()
Returns the ASN.1 type id for the object. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
private SnmpObjectId m_name
private SnmpSyntax m_value
public static final byte ASNTYPE
Constructor Detail |
public SnmpVarBind()
SnmpObjectId.SnmpObjectId(java.lang.String)
,
SnmpNull.SnmpNull(org.opennms.protocols.snmp.SnmpNull)
public SnmpVarBind(SnmpObjectId name)
name
- The object identifer name for this variable.public SnmpVarBind(SnmpObjectId name, SnmpSyntax value)
name
- The object identifier namevalue
- The syntax object.public SnmpVarBind(java.lang.String name)
name
- Dotted decimal object identifier.SnmpObjectId
public SnmpVarBind(java.lang.String name, SnmpSyntax value)
name
- The dotted decimal object identifer namevalue
- The SnmpSyntax value for the variablepublic SnmpVarBind(SnmpVarBind second)
second
- The variable to copyMethod Detail |
public SnmpObjectId getName()
public void setName(SnmpObjectId name)
name
- The new object id for the variable.public void setName(java.lang.String name)
name
- The dotted decimal object identifier.public SnmpSyntax getValue()
public void setValue(SnmpSyntax value)
value
- The new value for the objectpublic byte typeId()
typeId
in interface SnmpSyntax
public int encodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnEncodingException
encodeASN
in interface SnmpSyntax
buf
- Storeage for the encoded dataoffset
- Offset to start encoding dataencoder
- The encoder used to convert the data
AnsEncodingException
- Thrown if the encoder encounters an error while building
the buffer.
AsnEncodingException
- Thrown if an encoding error occurspublic int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingException
decodeASN
in interface SnmpSyntax
buf
- Encoded ASN.1 dataoffset
- Offset to first byte of encoded dataencoder
- The encoder used to convert the data
AnsDecodingException
- Thrown if an error occurs while attempting to decode the
data. This exception will be thrown byte encoder object.
AsnDecodingException
- Thrown if an encoding error occurspublic SnmpSyntax duplicate()
duplicate
in interface SnmpSyntax
public java.lang.Object clone()
public java.lang.String toString()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |