|
MySnmpCrawler API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--snmp.message.pdu.SnmpValue
The SnmpValue class represents an ASN.1 syntax of the SNMP value. It encapsulates the MBean attribute value taht maps to the associated object identifier and translates that value to the corresponding ASN.1 syntaxt.
Field Summary | |
private MBeanAttribute |
attr
|
private SnmpOid |
oid
|
private SnmpDatatype |
snmpSyntax
|
private SnmpVariable |
snmpVar
|
private java.lang.Object |
value
|
Constructor Summary | |
SnmpValue()
The default Constructor. |
|
SnmpValue(SnmpOid oid)
Constructs the SnmpValue object with the associated SnmpOId object. |
|
SnmpValue(SnmpVariable snmpVar)
Constructs the SnmpValue object with the SnmpVariable object that contains the SnmpOid and SnmpValue objects. |
Method Summary | |
int |
decode(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.BerEncoder encoder)
Invokes the decodeASN method to decode the SNMP value from the passed buffer. |
int |
decodeASN(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.AsnEncoder encoder)
Gets the SnmpSyntax object and decodes the actual SNMP value from the buffer accordingly. |
org.opennms.protocols.snmp.SnmpSyntax |
duplicate()
Invokded to duplicate the SnmpValue object, but currectly it's not supported. |
int |
encode(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.BerEncoder encoder)
Invokes the encodeASN method to encode the SNMP value into the passed buffer. |
int |
encodeASN(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.AsnEncoder encoder)
Encodes the SNMP value using the passed encoder and stores the results in the passed buffer. |
MBeanAttribute |
getMBeanAttribute()
Gets the MBeanAttribute object. |
org.opennms.protocols.snmp.SnmpSyntax |
getSnmpSyntax()
Gets the SnmpSyntax object that contains the actual SNMP value. |
void |
setMBeanAttribute(MBeanAttribute attr)
Sets the MBeanAttribute object obtained from the MBean and translates the attribute value to the ASN.1 syntax. |
java.lang.String |
toString()
Gets the string representation of the SnmpValue object. |
byte |
typeId()
Gets the ASN.1 type ID. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private SnmpDatatype snmpSyntax
private java.lang.Object value
private SnmpOid oid
private SnmpVariable snmpVar
private MBeanAttribute attr
Constructor Detail |
public SnmpValue()
public SnmpValue(SnmpVariable snmpVar)
snmpVar
- The SnmpVariable object.public SnmpValue(SnmpOid oid)
Method Detail |
public void setMBeanAttribute(MBeanAttribute attr) throws SnmpException
attr
- The MBeanAttribute object.
SnmpException
public MBeanAttribute getMBeanAttribute()
public org.opennms.protocols.snmp.SnmpSyntax getSnmpSyntax()
public int decode(byte[] buf, int offset, org.opennms.protocols.snmp.asn1.BerEncoder encoder) throws org.opennms.protocols.snmp.SnmpPduEncodingException, org.opennms.protocols.snmp.asn1.AsnDecodingException
buf
- The encode bufferoffset
- The offset byte to begin decodingencoder
- The decoder object.
org.opennms.protocols.snmp.asn1.AsnDecodingException
- Thrown by the encoder if an error
occurs trying to decode the data buffer.
org.opennms.protocols.snmp.SnmpPduEncodingException
public int encode(byte[] buf, int offset, org.opennms.protocols.snmp.asn1.BerEncoder encoder) throws org.opennms.protocols.snmp.SnmpPduEncodingException, org.opennms.protocols.snmp.asn1.AsnEncodingException
buf
- The buffer to write the encoded information.offset
- The offset to start writing informationencoder
- The encoder object.
org.opennms.protocols.snmp.asn1.AsnEncodingException
- Thrown if the encoder finds an error in the
buffer.
org.opennms.protocols.snmp.SnmpPduEncodingException
public byte typeId()
typeId
in interface org.opennms.protocols.snmp.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 org.opennms.protocols.snmp.SnmpSyntax
buf
- The buffer to write the encoded information.offset
- The offset to start writing informationencoder
- The encoder object.
org.opennms.protocols.snmp.asn1.AsnEncodingException
- Thrown if the encoder finds an error in the
buffer.public int decodeASN(byte[] buf, int offset, org.opennms.protocols.snmp.asn1.AsnEncoder encoder) throws org.opennms.protocols.snmp.asn1.AsnDecodingException
decodeASN
in interface org.opennms.protocols.snmp.SnmpSyntax
buf
- The encode bufferoffset
- The offset byte to begin decodingencoder
- The decoder object.
org.opennms.protocols.snmp.asn1.AsnDecodingException
- Thrown by the encoder if an error
occurs trying to decode the data buffer.public org.opennms.protocols.snmp.SnmpSyntax duplicate()
duplicate
in interface org.opennms.protocols.snmp.SnmpSyntax
public java.lang.String toString()
toString
in class java.lang.Object
|
MySnmpCrawler API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |