Package com.couchbase.client.core
Class CouchbaseCore
- java.lang.Object
-
- com.couchbase.client.core.CouchbaseCore
-
- All Implemented Interfaces:
ClusterFacade
public class CouchbaseCore extends Object implements ClusterFacade
The general implementation of aClusterFacade
.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
-
Field Summary
Fields Modifier and Type Field Description static BackpressureException
BACKPRESSURE_EXCEPTION
A preconstructedBackpressureException
.
-
Constructor Summary
Constructors Constructor Description CouchbaseCore()
Creates a newCouchbaseCore
.CouchbaseCore(CoreEnvironment environment)
Creates a newCouchbaseCore
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoreContext
ctx()
Exposes the currently used environment.long
id()
The core id is unique per core instance.<R extends CouchbaseResponse>
rx.Observable<R>send(CouchbaseRequest request)
Sends aCouchbaseRequest
into the cluster and eventually returns aCouchbaseResponse
.
-
-
-
Field Detail
-
BACKPRESSURE_EXCEPTION
public static final BackpressureException BACKPRESSURE_EXCEPTION
A preconstructedBackpressureException
.
-
-
Constructor Detail
-
CouchbaseCore
public CouchbaseCore()
Creates a newCouchbaseCore
.
-
CouchbaseCore
public CouchbaseCore(CoreEnvironment environment)
Creates a newCouchbaseCore
.
-
-
Method Detail
-
send
public <R extends CouchbaseResponse> rx.Observable<R> send(CouchbaseRequest request)
Description copied from interface:ClusterFacade
Sends aCouchbaseRequest
into the cluster and eventually returns aCouchbaseResponse
. TheCouchbaseResponse
is not returned directly, but is wrapped into aObservable
.- Specified by:
send
in interfaceClusterFacade
- Type Parameters:
R
- the generic response type.- Parameters:
request
- the request to send.- Returns:
- the
CouchbaseResponse
wrapped into aObservable
.
-
id
public long id()
Description copied from interface:ClusterFacade
The core id is unique per core instance.- Specified by:
id
in interfaceClusterFacade
- Returns:
- returns the ID for this core.
-
ctx
public CoreContext ctx()
Description copied from interface:ClusterFacade
Exposes the currently used environment.- Specified by:
ctx
in interfaceClusterFacade
- Returns:
- the environment used.
-
-