Class TransportHttpClient.Node

java.lang.Object
co.elastic.clients.transport.http.TransportHttpClient.Node
Enclosing interface:
TransportHttpClient

public static class TransportHttpClient.Node extends Object
A node/host to send requests to.
  • Constructor Details

    • Node

      public Node(URI uri, @Nullable String name, @Nullable String version, @Nullable Set<String> roles, @Nullable Map<String,String> attributes)
      Create a node with its URI, roles and attributes.

      If the URI doesn't end with a '/', then one is added.

      Parameters:
      uri - the node's URI
      name - the node name/identifier
      version - the node's version, if known
      roles - the node's roles, such as "master", "ingest", etc.
      attributes - the node's attributes. This can be used for routing decisions by multi-node implementations.
    • Node

      public Node(URI uri)
    • Node

      public Node(String uri)
  • Method Details

    • uri

      public URI uri()
      The URI of this node. This is an absolute URL with a path ending with a "/".
    • name

      @Nullable public String name()
      The node name/identifier
    • version

      @Nullable public String version()
    • roles

      @Nullable public Set<String> roles()
    • attributes

      @Nullable public Map<String,String> attributes()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Two nodes are considered equal if their URIs are equal. Other properties are ignored.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      A node's hash code is that of its URI. Other properties are ignored.
      Overrides:
      hashCode in class Object