|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.snmp.snmp2.SnmpVar
com.adventnet.snmp.snmp2.SnmpIpv6Address
public class SnmpIpv6Address
Class of SNMP Ipv6Address Variable - Sub-class of SnmpVar. This class can be used to created a SnmpVar object of OCTET STRING TC such as Ipv6Address, InetAddress and InetAddressIPv6. It also has methods to retrieve the value in different forms(eg. String, byte). Value is stored as String of length 16 with each lower byte corresponding to the raw IPV6 address.
| Field Summary | |
|---|---|
(package private) java.lang.String |
address
|
(package private) byte[] |
byteValue
|
(package private) int |
count
|
static java.lang.String |
enc
The Standard encoding string on which all encoding will be done. |
(package private) int |
indexCounter
|
(package private) java.lang.String[] |
octetsValue
Variabe Declration |
(package private) static byte[] |
s_emptyString
|
(package private) java.lang.String |
value
|
(package private) java.lang.String |
zeroValue
|
| Fields inherited from class com.adventnet.snmp.snmp2.SnmpVar |
|---|
Type, varbindErrorVal |
| Constructor Summary | |
|---|---|
SnmpIpv6Address(byte[] address)
Constructs a new SnmpIpv6Address by accepting the raw IP address - 16 bytes or 4 bytes for Ipv6Adderess/InetAddress datatype. |
|
SnmpIpv6Address(java.lang.String ipv6Address)
Constructs a new SnmpIpv6Address with the specified host name or IP address as a string. |
|
SnmpIpv6Address(java.lang.String ipv6Address,
java.lang.String enc)
Constructs a new SnmpIpv6Address with the specified host name or IP address as a string. |
|
| Method Summary | |
|---|---|
static SnmpVar |
createVariable(java.lang.String value,
byte type)
Creates a new SnmpVar object with the specified value and of type SnmpAPI.STRING. |
(package private) int |
encode(byte[] buff,
int space)
ASN encoder |
java.lang.Object |
getVarObject()
Returns the value of this SnmpIpv6Address object as a printable string object. |
static java.lang.String |
Ipv6bToString(byte[] byteValue)
A converter from raw IP address (byte[]) to string. |
(package private) static SnmpVar |
newInstance(byte[] b)
Factory method for decode |
byte[] |
toBytes()
To return the value of this SnmpString object as raw bytes. |
java.lang.String |
toString()
To convert the value of this SnmpString object to a printable ipv6Address format |
java.lang.String |
toTagString()
To convert the value of this SnmpString object to a printable string where the type is tagged before the value with a tag STRING:. |
java.lang.Object |
toValue()
Returns the value of this SnmpString object as a printable string object. |
| Methods inherited from class com.adventnet.snmp.snmp2.SnmpVar |
|---|
getError, getNumericValueAsString, getType, getTypeString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final byte[] s_emptyString
java.lang.String value
byte[] byteValue
public static java.lang.String enc
java.lang.String[] octetsValue
java.lang.String zeroValue
int indexCounter
int count
java.lang.String address
| Constructor Detail |
|---|
public SnmpIpv6Address(java.lang.String ipv6Address)
ipv6Address - host name or IP address as a string.
public SnmpIpv6Address(java.lang.String ipv6Address,
java.lang.String enc)
ipv6Address - host name or IP address as a string.enc - The string for the encoding scheme to be used.public SnmpIpv6Address(byte[] address)
address - raw IPv6 address - 16 bytes/ 4 bytes| Method Detail |
|---|
static SnmpVar newInstance(byte[] b)
b - The bytearray
return The snmp variablepublic java.lang.Object getVarObject()
getVarObject in class SnmpVarpublic java.lang.Object toValue()
toValue in class SnmpVarpublic byte[] toBytes()
toBytes in class SnmpVar
int encode(byte[] buff,
int space)
throws java.lang.ArrayIndexOutOfBoundsException
encode in class SnmpVarbuff - The buffer into which the value is to be encodedspace - The number of free bytes in the buffer
java.lang.ArrayIndexOutOfBoundsException - When there is
insufficient space in bufferpublic java.lang.String toString()
toString in class SnmpVarpublic static java.lang.String Ipv6bToString(byte[] byteValue)
rawIpAddr - The IP Address as a byte[].
public java.lang.String toTagString()
toTagString in class SnmpVar
public static SnmpVar createVariable(java.lang.String value,
byte type)
throws SnmpException
value - String value for creating a new SnmpVar object.type - SnmpAPI.STRING type (a constant from SnmpAPI) for creating a
new SnmpVar object.
SnmpException - is thrown when the type is other than SnmpAPI.STRING.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||