public class TcpConnectionInfo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
hostname
The host name.
|
private int |
port
The port number.
|
| Constructor and Description |
|---|
TcpConnectionInfo(java.lang.String connectString)
Creates a TCP connection information object.
|
TcpConnectionInfo(java.lang.String host,
int port)
Creates a TCP connection information object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getHostname()
Returns the host name.
|
int |
getPort()
Returns the port number.
|
void |
setHostPort(java.lang.String hostname,
int port)
Changes the TCP connection information.
|
private java.lang.String hostname
private int port
public TcpConnectionInfo(java.lang.String host,
int port)
throws java.lang.IllegalArgumentException
host - the host nameport - the port namejava.lang.IllegalArgumentException - if host/port are not validpublic TcpConnectionInfo(java.lang.String connectString)
throws java.lang.IllegalArgumentException
connectString - a string containing host and port in format host:portjava.lang.IllegalArgumentException - if the connect string or contained host/port are not validpublic void setHostPort(java.lang.String hostname,
int port)
throws java.lang.IllegalArgumentException
hostname - the host nameport - the port namejava.lang.IllegalArgumentException - if host/port are not validpublic java.lang.String getHostname()
public int getPort()