@InterfaceAudience.Private public class Addressing extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
HOSTNAME_PORT_SEPARATOR |
static String |
VALID_PORT_REGEX |
| Constructor and Description |
|---|
Addressing() |
| Modifier and Type | Method and Description |
|---|---|
static String |
createHostAndPortStr(String hostname,
int port) |
static InetSocketAddress |
createInetSocketAddressFromHostAndPortStr(String hostAndPort) |
static String |
parseHostname(String hostAndPort) |
static int |
parsePort(String hostAndPort) |
public static final String VALID_PORT_REGEX
public static final String HOSTNAME_PORT_SEPARATOR
public static InetSocketAddress createInetSocketAddressFromHostAndPortStr(String hostAndPort)
hostAndPort - Formatted as <hostname> ':' <port>public static String createHostAndPortStr(String hostname, int port)
hostname - Server hostnameport - Server porthostname and
port in following
form: <hostname> ':' <port>. For example, if hostname
is example.org and port is 1234, this method will return
example.org:1234public static String parseHostname(String hostAndPort)
hostAndPort - Formatted as <hostname> ':' <port>hostAndPortpublic static int parsePort(String hostAndPort)
hostAndPort - Formatted as <hostname> ':' <port>hostAndPortCopyright © 2014 The Apache Software Foundation. All rights reserved.