public class CouchbaseNode extends AbstractStateMachine<LifecycleState> implements Node
The general implementation of a 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(NetworkAddress hostname,
CoreContext ctx) |
CouchbaseNode(NetworkAddress hostname,
CoreContext ctx,
NetworkAddress 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() |
NetworkAddress |
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(NetworkAddress hostname, CoreContext ctx)
public CouchbaseNode(NetworkAddress hostname, CoreContext ctx, NetworkAddress alternate)
public void send(CouchbaseRequest request)
Node
Sends a CouchbaseRequest
into the node and eventually returns a CouchbaseResponse
.
The CouchbaseResponse
is not returned directly, but is wrapped into a Observable
.
public NetworkAddress hostname()
Node
Returns the configured hostname for the Node
.
public rx.Observable<LifecycleState> connect()
Node
Connects all currently enabled Service
s.
public rx.Observable<LifecycleState> disconnect()
Node
Disconnects all currently enabled 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
Returns endpoint health information for all endpoints this node is currently associated with.
diagnostics
in interface Node
public boolean serviceEnabled(ServiceType type)
Node
True if the given ServiceType
is currently enabled on this node, false otherwise.
serviceEnabled
in interface Node
Copyright © 2018 Couchbase, Inc.. All rights reserved.