Class SeedNode

java.lang.Object
com.couchbase.client.core.env.SeedNode

public class SeedNode extends Object
The SeedNode represents a combination of hostname/ip and port that is used during the SDK bootstrap.

Note that this class is used mostly internally but can be used during bootstrap to override the default ports on a per-node basis. Most of the time you want to use the connection string bootstrap instead.

  • Field Details Link icon

    • LOCALHOST Link icon

      public static final Set<SeedNode> LOCALHOST
      Seed node set pointing to localhost with default ports.
  • Method Details Link icon

    • create Link icon

      public static SeedNode create(String address)
      Creates a seed node from a hostname and the default ports.
      Parameters:
      address - the hostname or IP of the seed node.
      Returns:
      the created SeedNode.
    • create Link icon

      public static SeedNode create(String address, Optional<Integer> kvPort, Optional<Integer> clusterManagerPort)
      Creates a seed node from a hostname and custom ports.
      Parameters:
      address - the hostname or IP of the seed node.
      Returns:
      the created SeedNode.
    • withKvPort Link icon

      public SeedNode withKvPort(@Nullable Integer port)
      Returns a copy of this seed node, with the given KV port.
      Parameters:
      port - (nullable) null means absent KV port.
    • withManagerPort Link icon

      public SeedNode withManagerPort(@Nullable Integer port)
      Returns a copy of this seed node, with the given Manager port.
      Parameters:
      port - (nullable) null means absent Manager port.
    • withProtostellarPort Link icon

      @Volatile public SeedNode withProtostellarPort(@Nullable Integer port)
      Returns a copy of this seed node, with the given Protostellar port.
      Parameters:
      port - (nullable) null means absent Protostellar port.
    • address Link icon

      public String address()
      The ip address or hostname of this seed node.
    • kvPort Link icon

      public Optional<Integer> kvPort()
      If present, the kv port.
    • clusterManagerPort Link icon

      public Optional<Integer> clusterManagerPort()
      If present, the cluster manager port.
    • protostellarPort Link icon

      @Volatile public Optional<Integer> protostellarPort()
      If present, the Protostellar port.
    • toString Link icon

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object