public class NetworkService extends AbstractComponent
Modifier and Type | Class and Description |
---|---|
static interface |
NetworkService.CustomNameResolver
A custom name resolver can support custom lookup keys (my_net_key:ipv4) and also change
the default inet address used in case no settings is provided.
|
static class |
NetworkService.TcpSettings |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NETWORK_HOST
By default, we bind to loopback interfaces
|
static Setting<java.util.List<java.lang.String>> |
GLOBAL_NETWORK_BINDHOST_SETTING |
static Setting<java.util.List<java.lang.String>> |
GLOBAL_NETWORK_HOST_SETTING |
static Setting<java.util.List<java.lang.String>> |
GLOBAL_NETWORK_PUBLISHHOST_SETTING |
static Setting<java.lang.Boolean> |
NETWORK_SERVER |
deprecationLogger, logger, settings
Constructor and Description |
---|
NetworkService(Settings settings,
java.util.List<NetworkService.CustomNameResolver> customNameResolvers) |
Modifier and Type | Method and Description |
---|---|
java.net.InetAddress[] |
resolveBindHostAddresses(java.lang.String[] bindHosts)
Resolves
bindHosts to a list of internet addresses. |
java.net.InetAddress |
resolvePublishHostAddresses(java.lang.String[] publishHosts)
Resolves
publishHosts to a single publish address. |
logDeprecatedSetting, logRemovedSetting, nodeName
public static final java.lang.String DEFAULT_NETWORK_HOST
public static final Setting<java.util.List<java.lang.String>> GLOBAL_NETWORK_HOST_SETTING
public static final Setting<java.util.List<java.lang.String>> GLOBAL_NETWORK_BINDHOST_SETTING
public static final Setting<java.util.List<java.lang.String>> GLOBAL_NETWORK_PUBLISHHOST_SETTING
public static final Setting<java.lang.Boolean> NETWORK_SERVER
public NetworkService(Settings settings, java.util.List<NetworkService.CustomNameResolver> customNameResolvers)
public java.net.InetAddress[] resolveBindHostAddresses(java.lang.String[] bindHosts) throws java.io.IOException
bindHosts
to a list of internet addresses. The list will
not contain duplicate addresses.bindHosts
- list of hosts to bind to. this may contain special pseudo-hostnames
such as _local_ (see the documentation). if it is null, it will be populated
based on global default settings.java.io.IOException
public java.net.InetAddress resolvePublishHostAddresses(java.lang.String[] publishHosts) throws java.io.IOException
publishHosts
to a single publish address. The fact that it returns
only one address is just a current limitation.
If publishHosts
resolves to more than one address, then one is selected with magic
publishHosts
- list of hosts to publish as. this may contain special pseudo-hostnames
such as _local_ (see the documentation). if it is null, it will be populated
based on global default settings.java.io.IOException