public class CouchbaseNode extends AbstractStateMachine<LifecycleState> implements Node
Node
.
A Node
manages one or more Service
s. When a node gets connected, all currently configured
Service
s are connected. Those can and will also be added and removed on demand. On disconnect, all
services will be shut down asynchronously and then the node is determined to be shutdown.
A Node
s states is composed exclusively of the underlying Service
states.Constructor and Description |
---|
CouchbaseNode(String hostname,
CoreContext ctx) |
CouchbaseNode(String hostname,
CoreContext ctx,
String alternate) |
Modifier and Type | Method and Description |
---|---|
rx.Observable<Service> |
addService(AddServiceRequest request) |
rx.Observable<LifecycleState> |
connect()
Connects all currently enabled
Service s. |
rx.Observable<EndpointHealth> |
diagnostics()
Returns endpoint health information for all endpoints this node is currently associated with.
|
rx.Observable<LifecycleState> |
disconnect()
Disconnects all currently enabled
Service s. |
boolean |
equals(Object o) |
int |
hashCode() |
String |
hostname()
Returns the configured hostname for the
Node . |
rx.Observable<Service> |
removeService(RemoveServiceRequest request) |
void |
send(CouchbaseRequest request)
Sends a
CouchbaseRequest into the node and eventually returns a CouchbaseResponse . |
boolean |
serviceEnabled(ServiceType type)
True if the given
ServiceType is currently enabled on this node, false otherwise. |
String |
toString() |
hasSubscribers, isState, state, states, transitionState
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasSubscribers, isState, state, states
public CouchbaseNode(String hostname, CoreContext ctx)
public CouchbaseNode(String hostname, CoreContext ctx, String alternate)
public void send(CouchbaseRequest request)
Node
CouchbaseRequest
into the node and eventually returns a CouchbaseResponse
.
The CouchbaseResponse
is not returned directly, but is wrapped into a Observable
.public String hostname()
Node
Node
.public rx.Observable<LifecycleState> connect()
Node
Service
s.public rx.Observable<LifecycleState> disconnect()
Node
Service
s.disconnect
in interface Node
Node
after the disconnect process for all enabled Service
s.public rx.Observable<Service> addService(AddServiceRequest request)
addService
in interface Node
public rx.Observable<Service> removeService(RemoveServiceRequest request)
removeService
in interface Node
public rx.Observable<EndpointHealth> diagnostics()
Node
diagnostics
in interface Node
public boolean serviceEnabled(ServiceType type)
Node
ServiceType
is currently enabled on this node, false otherwise.serviceEnabled
in interface Node
Copyright © 2019 Couchbase, Inc.. All rights reserved.