|
|||||||||
| 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.SnmpString
com.adventnet.snmp.snmp2.SnmpIpAddress
public class SnmpIpAddress
Class of SNMP IpAddress Variable - Sub-class of SnmpVar. This class can be used to created a SnmpVar object of type SnmpIpAddress. It also has methods to retrieve the value in different forms(eg. String, byte). Value is stored as String of length 4 with each lower byte corresponding to the raw IP address.
| Field Summary | |
|---|---|
(package private) java.lang.String |
ipAddr
|
| Fields inherited from class com.adventnet.snmp.snmp2.SnmpString |
|---|
byteValue, enc, s_emptyString, value |
| Fields inherited from class com.adventnet.snmp.snmp2.SnmpVar |
|---|
Type, varbindErrorVal |
| Constructor Summary | |
|---|---|
SnmpIpAddress()
Empty constructor |
|
SnmpIpAddress(byte[] b)
Constructs a new SnmpIpAddress by accepting the raw IP address - 4 bytes. |
|
SnmpIpAddress(java.lang.String s)
Constructs a new SnmpIpAddress with the specified host name or IP address as a string. |
|
| Method Summary | |
|---|---|
(package private) int |
encode(byte[] buff,
int space)
ASN encoder |
java.lang.String |
getNumericValueAsString()
This method will throw UnsupportedOperationException since this is not a numeric data type. |
java.lang.Object |
getVarObject()
Returns the values of this SnmpIpAddress as a printable String object. |
static java.lang.String |
netbToString(byte[] rawIpAddr)
A converter from raw IP address (byte[]) to string. |
(package private) static SnmpVar |
newInstance(byte[] b)
Factory method for decode |
java.lang.String |
toHostName()
To convert the object to a host name. |
java.lang.String |
toString()
To convert the value of this SnmpIpAddress object to a printable string. |
java.lang.String |
toTagString()
To convert the value of this SnmpIpAddress object to a printable string where the type is tagged before the value with a tag IpAddress:. |
java.lang.Object |
toValue()
Returns the value of this SnmpIpAddress as a String object. |
| Methods inherited from class com.adventnet.snmp.snmp2.SnmpString |
|---|
equals, toBytes, toByteString |
| Methods inherited from class com.adventnet.snmp.snmp2.SnmpVar |
|---|
createVariable, getError, getType, getTypeString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
java.lang.String ipAddr
| Constructor Detail |
|---|
SnmpIpAddress()
public SnmpIpAddress(java.lang.String s)
s - host name or IP address as a string.public SnmpIpAddress(byte[] b)
b - raw IP address - 4 bytes| Method Detail |
|---|
static SnmpVar newInstance(byte[] b)
public java.lang.Object getVarObject()
getVarObject in class SnmpStringpublic java.lang.Object toValue()
toValue in class SnmpStringSnmpString.toValue(),
SnmpIpAddress(byte[])public java.lang.String toString()
toString in class SnmpStringpublic java.lang.String toTagString()
toTagString in class SnmpStringpublic java.lang.String toHostName()
int encode(byte[] buff,
int space)
throws java.lang.ArrayIndexOutOfBoundsException
encode in class SnmpStringbuff - 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 static java.lang.String netbToString(byte[] rawIpAddr)
rawIpAddr - The IP Address as a byte[].
public java.lang.String getNumericValueAsString()
getNumericValueAsString in class SnmpStringjava.lang.UnsupportedOperationException - Since this
is not a numeric data type.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||