Class NetworkService

java.lang.Object
org.elasticsearch.common.network.NetworkService

public final class NetworkService
extends java.lang.Object
  • Field Details

  • Constructor Details

  • Method Details

    • resolveBindHostAddresses

      public java.net.InetAddress[] resolveBindHostAddresses​(java.lang.String[] bindHosts) throws java.io.IOException
      Resolves bindHosts to a list of internet addresses. The list will not contain duplicate addresses.
      Parameters:
      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 fall back to _local_
      Returns:
      unique set of internet addresses
      Throws:
      java.io.IOException
    • resolvePublishHostAddresses

      public java.net.InetAddress resolvePublishHostAddresses​(java.lang.String[] publishHosts) throws java.io.IOException
      Resolves 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

      Parameters:
      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 fall back to _local_
      Returns:
      single internet address
      Throws:
      java.io.IOException