public class ServerNameUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT
The default MongoDB port.
|
static int |
IPV6_LENGTH
The length of an IPv6 address in bytes.
|
Modifier and Type | Method and Description |
---|---|
static String |
normalize(InetSocketAddress address)
Creates a normalized form of the
InetSocketAddress in the form
'[server]:[port]'. |
static String |
normalize(String server)
Normalizes the name into a '[server]:[port]' string.
|
static InetSocketAddress |
parse(String server)
Parse the name into a
InetSocketAddress . |
public static final int DEFAULT_PORT
public static final int IPV6_LENGTH
public static String normalize(InetSocketAddress address)
InetSocketAddress
in the form
'[server]:[port]'.address
- The address to generate a normalized form for.public static String normalize(String server)
server
- The server[:port] string.public static InetSocketAddress parse(String server)
InetSocketAddress
. If a port component is
not provided then port 27017 is assumed.server
- The server[:port] string.InetSocketAddress
parsed from the server string.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.