|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fossilec.odettej.transport.NetworkAddress
org.fossilec.odettej.transport.tcp.InternetAddress
public class InternetAddress
This class represents the TCP/IP network address used over the API with
Internet transport layer implementation. The address type is
internet
.
In general form it's formed with Hostname (or IP address) and the Port number.
NetworkAddress
,
Serialized FormConstructor Summary | |
---|---|
InternetAddress(java.lang.String address)
Common way of creating an Address object using the String representation of the address. |
|
InternetAddress(java.lang.String host,
int port)
Way of creating the Address object using properly parameters. |
Method Summary | |
---|---|
protected static java.net.InetSocketAddress |
createAddress(java.lang.String address)
|
protected static java.net.InetSocketAddress |
createAddress(java.lang.String host,
int port)
|
java.lang.String |
getHost()
Gets the hostname part of the address. |
int |
getPort()
Return the port number, a non-negative integer. |
java.lang.String |
getType()
Gets address type. |
protected void |
parse(java.lang.String address)
Allow the setting up of subclasses context when invoked created through general constructor NetworkAddress(String) . |
java.lang.String |
toString()
Return the String representation of this address object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InternetAddress(java.lang.String address) throws AddressException
address
- String representation of the network address.
AddressException
- Fail to parse the address.NetworkAddress#Address(String)
public InternetAddress(java.lang.String host, int port) throws AddressException
host
- String
hostname.port
- int
port number.
AddressException
- If fail to create the address.Method Detail |
---|
public final java.lang.String getHost()
public final int getPort()
0
if undefined.public java.lang.String getType()
getType
in class NetworkAddress
internet
".public java.lang.String toString()
toString
in class NetworkAddress
protected void parse(java.lang.String address) throws AddressException
NetworkAddress(String)
.
parse
in class NetworkAddress
address
- String representation of the network address.
AddressException
- Fail to parse the address.NetworkAddress.parse(String)
protected static java.net.InetSocketAddress createAddress(java.lang.String address) throws AddressException
address
-
java.lang.IllegalArgumentException
- If the port parameter is outside the range of valid port
values, of if the hostname parameter is null
.
AddressException
- If failt to create the address.protected static java.net.InetSocketAddress createAddress(java.lang.String host, int port) throws AddressException
host
- port
-
java.lang.IllegalArgumentException
- If the port parameter is outside the range of valid port
values, of if the hostname parameter is null
.
AddressException
- If fail to create the address.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |