NetUtil#createByteArrayFromIpAddressString utility method and the
InetSocketAddress instances will be created in a way that these instances are resolved
initially. This removes the need to do unnecessary reverse DNS lookups.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static InetAddress | |
| pack-priv static InetSocketAddress | |
| public static InetSocketAddress | Returns: InetSocketAddress for given parametersip-address or hostname hostname, int port number port, boolean when true, resolve given hostname at instance creation time resolve)Creates InetSocketAddress instance. |
| public static InetSocketAddress | Returns: InetSocketAddress for given parametersip-address or hostname hostname, int port number port)Creates InetSocketAddress that is always resolved. |
| public static InetSocketAddress | Returns: InetSocketAddress for given parametersip-address or hostname hostname, int port number port)Creates unresolved InetSocketAddress. |
| public static InetSocketAddress | Returns: InetSocketAddress for given parameters, only numeric IP addresses will be resolvedip-address or hostname address, int the default port defaultPort)Parse unresolved InetSocketAddress. |
| public static InetSocketAddress | Returns: InetSocketAddress for given parameters, only numeric IP addresses will be resolvedip-address or hostname address, int is used if the address does not contain a port,
or if the port cannot be parsed in non-strict mode defaultPort, boolean if true throws an exception when the address cannot be parsed,
otherwise an unresolved strict)InetSocketAddress is returned. It can include the case of the host
having been parsed but not the port (replaced by defaultPort)Parse unresolved InetSocketAddress. |
| public static InetSocketAddress | Returns: processed socket address instancesocket address instance to process inetSocketAddress)Replaces an unresolved InetSocketAddress with a resolved instance in the case that the passed address is a numeric IP address (both IPv4 and IPv6 are supported). |
| public static InetSocketAddress | Returns: resolved instance with same host string and portsocket address instance to process inetSocketAddress)Replaces an unresolved InetSocketAddress with a resolved instance in the case that the passed address is unresolved. |
| public static SocketAddress | Returns: the updated addressthe address supplier address, String the new host string host)Update the provided address with the new host string. |
| public static SocketAddress | Returns: the updated addressthe address supplier address, int the new port port)Update the provided address with the new port. |
| AddressUtils | back to summary |
|---|---|
| private AddressUtils() | |
| attemptParsingIpString | back to summary |
|---|---|
pack-priv static InetAddress attemptParsingIpString(String hostname)
| |
| createForIpString | back to summary |
|---|---|
pack-priv static InetSocketAddress createForIpString(String hostname, int port)
| |
| createInetSocketAddress | back to summary |
|---|---|
| public static InetSocketAddress createInetSocketAddress(String hostname, int port, boolean resolve) Creates InetSocketAddress instance. Numeric IP addresses will be detected and resolved without doing reverse DNS lookups.
| |
| createResolved | back to summary |
|---|---|
| public static InetSocketAddress createResolved(String hostname, int port) Creates InetSocketAddress that is always resolved. Numeric IP addresses will be detected and resolved without doing reverse DNS lookups.
| |
| createUnresolved | back to summary |
|---|---|
| public static InetSocketAddress createUnresolved(String hostname, int port) Creates unresolved InetSocketAddress. Numeric IP addresses will be detected and resolved.
| |
| parseAddress | back to summary |
|---|---|
| public static InetSocketAddress parseAddress(String address, int defaultPort) Parse unresolved InetSocketAddress. Numeric IP addresses will be detected and resolved.
| |
| parseAddress | back to summary |
|---|---|
| public static InetSocketAddress parseAddress(String address, int defaultPort, boolean strict) Parse unresolved InetSocketAddress. Numeric IP addresses will be detected and resolved.
| |
| replaceUnresolvedNumericIp | back to summary |
|---|---|
| public static InetSocketAddress replaceUnresolvedNumericIp(InetSocketAddress inetSocketAddress) Replaces an unresolved InetSocketAddress with a resolved instance in the case that the passed address is a numeric IP address (both IPv4 and IPv6 are supported).
| |
| replaceWithResolved | back to summary |
|---|---|
| public static InetSocketAddress replaceWithResolved(InetSocketAddress inetSocketAddress) Replaces an unresolved InetSocketAddress with a resolved instance in the case that the passed address is unresolved.
| |
| updateHost | back to summary |
|---|---|
| public static SocketAddress updateHost(Supplier<? extends SocketAddress> address, String host) Update the provided address with the new host string.
| |
| updatePort | back to summary |
|---|---|
| public static SocketAddress updatePort(Supplier<? extends SocketAddress> address, int port) Update the provided address with the new port.
| |