Package com.couchbase.client.core.env
Class SeedNode
java.lang.Object
com.couchbase.client.core.env.SeedNode
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddress()
The ip address or hostname of this seed node.If present, the cluster manager port.static SeedNode
Creates a seed node from a hostname and the default ports.static SeedNode
Creates a seed node from a hostname and custom ports.boolean
int
hashCode()
kvPort()
If present, the kv port.If present, the Protostellar port.toString()
withKvPort
(Integer port) Returns a copy of this seed node, with the given KV port.withManagerPort
(Integer port) Returns a copy of this seed node, with the given Manager port.withProtostellarPort
(Integer port) Returns a copy of this seed node, with the given Protostellar port.
-
Field Details
-
LOCALHOST
Seed node set pointing to localhost with default ports.
-
-
Method Details
-
create
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
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
Returns a copy of this seed node, with the given KV port.- Parameters:
port
- (nullable) null means absent KV port.
-
withManagerPort
Returns a copy of this seed node, with the given Manager port.- Parameters:
port
- (nullable) null means absent Manager port.
-
withProtostellarPort
Returns a copy of this seed node, with the given Protostellar port.- Parameters:
port
- (nullable) null means absent Protostellar port.
-
address
The ip address or hostname of this seed node. -
kvPort
If present, the kv port. -
clusterManagerPort
If present, the cluster manager port. -
protostellarPort
If present, the Protostellar port. -
toString
-
equals
-
hashCode
public int hashCode()
-