public abstract class TransportIpAddress extends IpAddress
TransportIpAddress is the abstract base class for all
transport addresses on top of IP network addresses.| Modifier and Type | Field and Description |
|---|---|
protected int |
port |
ANY_IPADDRESSSMISYNTAXES_PROPERTIES| Constructor and Description |
|---|
TransportIpAddress() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Variable o) |
void |
decodeBER(BERInputStream inputStream)
Decodes a
Variable from an InputStream. |
void |
encodeBER(OutputStream outputStream)
Encodes a
Variable to an OutputStream. |
boolean |
equals(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(String address) |
boolean |
parseAddress(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.
|
String |
toString()
Gets a string representation of the variable.
|
clone, fromSubIndex, getInetAddress, setAddress, setInetAddress, setValue, setValue, toByteArray, toInt, toLong, toSubIndexcreateFromBER, createFromSyntax, equal, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isExceptionpublic int getPort()
public void setPort(int port)
public boolean isValid()
AddressAddress is a valid transport address.public int compareTo(Variable o)
public boolean equals(Object o)
public boolean parseAddress(String address)
AddressparseAddress in interface AddressparseAddress in class IpAddressaddress - a String representation of this address.true if address could be successfully
parsed and has been assigned to this address object, false
otherwise.public String toString()
AbstractVariablepublic int hashCode()
public void setTransportAddress(OctetString transportAddress) throws UnknownHostException
transportAddress - an OctetString containing the IP address bytes and the two port bytes
in network byte order.UnknownHostException - if the address is invalid.public byte[] getValue()
public void decodeBER(BERInputStream inputStream) throws IOException
AbstractVariableVariable from an InputStream.decodeBER in interface BERSerializabledecodeBER in class IpAddressinputStream - an InputStream containing a BER encoded byte stream.IOException - if the stream could not be decoded by using BER rules.public void encodeBER(OutputStream outputStream) throws IOException
AbstractVariableVariable to an OutputStream.encodeBER in interface BERSerializableencodeBER in class IpAddressoutputStream - an OutputStream.IOException - if an error occurs while writing to the stream.public int getBERLength()
AbstractVariableVariable in bytes when encoded
according to the Basic Encoding Rules (BER).getBERLength in interface BERSerializablegetBERLength in class IpAddresspublic int getBERPayloadLength()
BERSerializableBERSerializable object
in bytes when encoded according to the Basic Encoding Rules (BER).getBERPayloadLength in interface BERSerializablegetBERPayloadLength in class AbstractVariablepublic int getSyntax()
AbstractVariableCopyright © 2016 SNMP4J.org. All Rights Reserved.