|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.snmp4j.smi.AbstractVariable
org.snmp4j.smi.SMIAddress
org.snmp4j.smi.IpAddress
org.snmp4j.smi.TransportIpAddress
public abstract class TransportIpAddress
The TransportIpAddress
is the abstract base class for all
transport addresses on top of IP network addresses.
Field Summary | |
---|---|
protected int |
port
|
Fields inherited from class org.snmp4j.smi.IpAddress |
---|
ANY_IPADDRESS |
Fields inherited from class org.snmp4j.smi.AbstractVariable |
---|
SMISYNTAXES_PROPERTIES |
Constructor Summary | |
---|---|
TransportIpAddress()
|
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
|
void |
decodeBER(BERInputStream inputStream)
Decodes a Variable from an InputStream . |
void |
encodeBER(java.io.OutputStream outputStream)
Encodes a Variable to an OutputStream . |
boolean |
equals(java.lang.Object o)
|
int |
getBERLength()
Returns the length of this Variable in bytes when encoded
according to the Basic Encoding Rules (BER). |
int |
getBERPayloadLength()
Returns the length of the payload of this BERSerializable object
in bytes when encoded according to the Basic Encoding Rules (BER). |
int |
getPort()
|
int |
getSyntax()
Gets the ASN.1 syntax identifier value of this SNMP variable. |
byte[] |
getValue()
Returns the address value as a byte array. |
int |
hashCode()
|
boolean |
isValid()
Checks whether this Address is a valid transport address. |
static Address |
parse(java.lang.String address)
|
boolean |
parseAddress(java.lang.String address)
Parses the address from the supplied string representation. |
void |
setPort(int port)
|
void |
setTransportAddress(OctetString transportAddress)
Sets this transport address from an OcetString containing the address value in format as specified by the TRANSPORT-ADDRESS-MIB. |
java.lang.String |
toString()
Gets a string representation of the variable. |
Methods inherited from class org.snmp4j.smi.IpAddress |
---|
clone, fromSubIndex, getInetAddress, setAddress, setInetAddress, setValue, setValue, toByteArray, toInt, toLong, toSubIndex |
Methods inherited from class org.snmp4j.smi.AbstractVariable |
---|
createFromBER, createFromSyntax, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isException |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int port
Constructor Detail |
---|
public TransportIpAddress()
Method Detail |
---|
public int getPort()
public void setPort(int port)
public boolean isValid()
Address
Address
is a valid transport address.
isValid
in interface Address
isValid
in class IpAddress
true
if the address is valid, false
otherwise.public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
compareTo
in interface Variable
compareTo
in class IpAddress
public boolean equals(java.lang.Object o)
equals
in interface Variable
equals
in class IpAddress
public boolean parseAddress(java.lang.String address)
Address
parseAddress
in interface Address
parseAddress
in class IpAddress
address
- a String representation of this address.
true
if address
could be successfully
parsed and has been assigned to this address object, false
otherwise.public static Address parse(java.lang.String address)
public java.lang.String toString()
AbstractVariable
toString
in interface Variable
toString
in class IpAddress
public int hashCode()
hashCode
in interface Variable
hashCode
in class IpAddress
public void setTransportAddress(OctetString transportAddress) throws java.net.UnknownHostException
transportAddress
- an OctetString containing the IP address bytes and the two port bytes
in network byte order.
java.net.UnknownHostException
- if the address is invalid.public byte[] getValue()
public void decodeBER(BERInputStream inputStream) throws java.io.IOException
AbstractVariable
Variable
from an InputStream
.
decodeBER
in interface BERSerializable
decodeBER
in class IpAddress
inputStream
- an InputStream
containing a BER encoded byte stream.
java.io.IOException
- if the stream could not be decoded by using BER rules.public void encodeBER(java.io.OutputStream outputStream) throws java.io.IOException
AbstractVariable
Variable
to an OutputStream
.
encodeBER
in interface BERSerializable
encodeBER
in class IpAddress
outputStream
- an OutputStream
.
java.io.IOException
- if an error occurs while writing to the stream.public int getBERLength()
AbstractVariable
Variable
in bytes when encoded
according to the Basic Encoding Rules (BER).
getBERLength
in interface BERSerializable
getBERLength
in class IpAddress
public int getBERPayloadLength()
BERSerializable
BERSerializable
object
in bytes when encoded according to the Basic Encoding Rules (BER).
getBERPayloadLength
in interface BERSerializable
getBERPayloadLength
in class AbstractVariable
public int getSyntax()
AbstractVariable
getSyntax
in interface Variable
getSyntax
in class IpAddress
|
Copyright 2005-2010 Frank Fock (SNMP4J.org) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |