public class SeedNode extends Object
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.
Modifier and Type | Field and Description |
---|---|
static Set<SeedNode> |
LOCALHOST
Seed node set pointing to localhost with default ports.
|
Modifier and Type | Method and Description |
---|---|
String |
address()
The ip address or hostname of this seed node.
|
Optional<Integer> |
clusterManagerPort()
If present, the cluster manager port.
|
static SeedNode |
create(String address)
Creates a seed node from a hostname and the default ports.
|
static SeedNode |
create(String address,
Optional<Integer> kvPort,
Optional<Integer> clusterManagerPort)
Creates a seed node from a hostname and custom ports.
|
boolean |
equals(Object o) |
int |
hashCode() |
Optional<Integer> |
kvPort()
If present, the kv port.
|
Optional<Integer> |
protostellarPort()
If present, the Protostellar port.
|
String |
toString() |
SeedNode |
withKvPort(Integer port)
Returns a copy of this seed node, with the given KV port.
|
SeedNode |
withManagerPort(Integer port)
Returns a copy of this seed node, with the given Manager port.
|
SeedNode |
withProtostellarPort(Integer port)
Returns a copy of this seed node, with the given Protostellar port.
|
public static SeedNode create(String address)
address
- the hostname or IP of the seed node.SeedNode
.public static SeedNode create(String address, Optional<Integer> kvPort, Optional<Integer> clusterManagerPort)
address
- the hostname or IP of the seed node.SeedNode
.public SeedNode withKvPort(@Nullable Integer port)
port
- (nullable) null means absent KV port.public SeedNode withManagerPort(@Nullable Integer port)
port
- (nullable) null means absent Manager port.@Stability.Volatile public SeedNode withProtostellarPort(@Nullable Integer port)
port
- (nullable) null means absent Protostellar port.public String address()
public Optional<Integer> clusterManagerPort()
@Stability.Volatile public Optional<Integer> protostellarPort()
Copyright © 2024 Couchbase, Inc.. All rights reserved.