public class CouchbaseNode extends AbstractStateMachine<LifecycleState> implements Node
The general implementation of a Node.
A Node manages one or more Services. When a node gets connected, all currently configured Services 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 Nodes states is composed exclusively of the underlying Service states.
| Constructor and Description |
|---|
CouchbaseNode(InetAddress hostname,
CoreEnvironment environment,
com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer) |
| Modifier and Type | Method and Description |
|---|---|
Observable<Service> |
addService(AddServiceRequest request) |
Observable<LifecycleState> |
connect()
Connects all currently enabled
Services. |
Observable<LifecycleState> |
disconnect()
Disconnects all currently enabled
Services. |
boolean |
equals(Object o) |
int |
hashCode() |
InetAddress |
hostname()
Returns the configured hostname for the
Node. |
protected static String |
logIdent(InetAddress hostname)
Simple log helper to give logs a common prefix.
|
Observable<Service> |
removeService(RemoveServiceRequest request) |
void |
send(CouchbaseRequest request)
Sends a
CouchbaseRequest into the node and eventually returns a CouchbaseResponse. |
String |
toString() |
hasSubscribers, isState, state, states, transitionStateclone, finalize, getClass, notify, notifyAll, wait, wait, waithasSubscribers, isState, state, statespublic CouchbaseNode(InetAddress hostname, CoreEnvironment environment, com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer)
public void send(CouchbaseRequest request)
NodeSends a CouchbaseRequest into the node and eventually returns a CouchbaseResponse.
The CouchbaseResponse is not returned directly, but is wrapped into a Observable.
public InetAddress hostname()
NodeReturns the configured hostname for the Node.
public Observable<LifecycleState> connect()
NodeConnects all currently enabled Services.
public Observable<LifecycleState> disconnect()
NodeDisconnects all currently enabled Services.
disconnect in interface NodeNode after the disconnect process for all enabled Services.public Observable<Service> addService(AddServiceRequest request)
addService in interface Nodepublic Observable<Service> removeService(RemoveServiceRequest request)
removeService in interface Nodeprotected static String logIdent(InetAddress hostname)
Simple log helper to give logs a common prefix.
hostname - the address.Copyright © 2016 Couchbase, Inc.. All rights reserved.