|
|||||||||
| 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 Form| Field Summary | |
static byte |
ASNTYPE
The ASN.1 identifier used to mark SNMP variables |
| 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,
org.opennms.protocols.snmp.asn1.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,
org.opennms.protocols.snmp.asn1.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 |
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 copy| Method 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,
org.opennms.protocols.snmp.asn1.AsnEncoder encoder)
throws org.opennms.protocols.snmp.asn1.AsnEncodingException
encodeASN in interface SnmpSyntaxbuf - 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.
org.opennms.protocols.snmp.asn1.AsnEncodingException - Thrown if an encoding error occurs
public int decodeASN(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.AsnEncoder encoder)
throws org.opennms.protocols.snmp.asn1.AsnDecodingException
decodeASN in interface SnmpSyntaxbuf - 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.
org.opennms.protocols.snmp.asn1.AsnDecodingException - Thrown if an encoding error occurspublic SnmpSyntax duplicate()
duplicate in interface SnmpSyntaxpublic java.lang.Object clone()
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||