Modifier | Constructor and Description |
---|---|
protected |
Node(CoreContext ctx,
NodeIdentifier identifier,
Optional<String> alternateAddress) |
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
addService(ServiceType type,
int port,
Optional<String> bucket)
|
static Node |
create(CoreContext ctx,
NodeIdentifier identifier,
Optional<String> alternateAddress) |
protected Service |
createService(ServiceType serviceType,
int port,
Optional<String> bucket)
Helper method to create the
Service based on the service type provided. |
Stream<EndpointDiagnostics> |
diagnostics() |
Mono<Void> |
disconnect()
Instruct this
Node to disconnect. |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
hasServicesEnabled() |
NodeIdentifier |
identifier()
Returns the node identifier.
|
Mono<Void> |
removeService(ServiceType type,
Optional<String> bucket)
|
<R extends Request<? extends Response>> |
send(R request)
Sends the request into this
Node . |
protected <R extends Request<? extends Response>> |
sendIntoRetry(R request)
Retries the request.
|
boolean |
serviceEnabled(ServiceType type)
If a given
ServiceType is enabled on this node. |
NodeState |
state()
Returns the current state of the stateful component.
|
Flux<NodeState> |
states()
Returns a stream of states for this component as they change.
|
String |
toString() |
protected Node(CoreContext ctx, NodeIdentifier identifier, Optional<String> alternateAddress)
public static Node create(CoreContext ctx, NodeIdentifier identifier, Optional<String> alternateAddress)
public Mono<Void> disconnect()
Node
to disconnect.
This method is async and will return immediately. Use the other methods available to inspect the current state of the node, signaling potential successful disconnection attempts.
public Mono<Void> addService(ServiceType type, int port, Optional<String> bucket)
type
- the type of the service.port
- the port of the service.bucket
- the bucket name (if present).Mono
that completes once the service is added.public Mono<Void> removeService(ServiceType type, Optional<String> bucket)
type
- the type of service.bucket
- the bucket name if present.public Flux<NodeState> states()
Stateful
public NodeState state()
Stateful
public <R extends Request<? extends Response>> void send(R request)
Node
.
Note that there is no guarantee that the request will actually dispatched, based on the state this node is in.
request
- the request to send.protected <R extends Request<? extends Response>> void sendIntoRetry(R request)
This is a separate method because in test it is overridden to do easy assertions.
request
- the request to retry.public NodeIdentifier identifier()
public boolean serviceEnabled(ServiceType type)
ServiceType
is enabled on this node.type
- the service type to check.public boolean hasServicesEnabled()
protected Service createService(ServiceType serviceType, int port, Optional<String> bucket)
Service
based on the service type provided.serviceType
- the type of service to create.port
- the port for that service.bucket
- optionally the bucket name.public Stream<EndpointDiagnostics> diagnostics()
Copyright © 2020 Couchbase, Inc.. All rights reserved.