org.elasticsearch.common.network
Class NetworkService

java.lang.Object
  extended by org.elasticsearch.common.component.AbstractComponent
      extended by org.elasticsearch.common.network.NetworkService

public class NetworkService
extends AbstractComponent


Nested Class Summary
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
           
 
Field Summary
static String LOCAL
           
 
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
componentSettings, logger, settings
 
Constructor Summary
NetworkService(Settings settings)
           
 
Method Summary
 void addCustomNameResolver(NetworkService.CustomNameResolver customNameResolver)
          Add a custom name resolver.
 InetAddress resolveBindHostAddress(String bindHost)
           
 InetAddress resolveBindHostAddress(String bindHost, String defaultValue2)
           
 InetAddress resolveInetAddress(String host, String defaultValue1, String defaultValue2)
           
 InetAddress resolvePublishHostAddress(String publishHost)
           
 InetAddress resolvePublishHostAddress(String publishHost, String defaultValue2)
           
 
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
nodeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL

public static final String LOCAL
See Also:
Constant Field Values
Constructor Detail

NetworkService

@Inject
public NetworkService(Settings settings)
Method Detail

addCustomNameResolver

public void addCustomNameResolver(NetworkService.CustomNameResolver customNameResolver)
Add a custom name resolver.


resolveBindHostAddress

public InetAddress resolveBindHostAddress(String bindHost)
                                   throws IOException
Throws:
IOException

resolveBindHostAddress

public InetAddress resolveBindHostAddress(String bindHost,
                                          String defaultValue2)
                                   throws IOException
Throws:
IOException

resolvePublishHostAddress

public InetAddress resolvePublishHostAddress(String publishHost)
                                      throws IOException
Throws:
IOException

resolvePublishHostAddress

public InetAddress resolvePublishHostAddress(String publishHost,
                                             String defaultValue2)
                                      throws IOException
Throws:
IOException

resolveInetAddress

public InetAddress resolveInetAddress(String host,
                                      String defaultValue1,
                                      String defaultValue2)
                               throws UnknownHostException,
                                      IOException
Throws:
UnknownHostException
IOException


Copyright © 2009-2012. All Rights Reserved.