@InterfaceStability.Committed @InterfaceAudience.Public public interface AsyncBucket
Defines operations that can be executed asynchronously against a Couchbase Server bucket.
Note that only a subset of the provided operations are available for “memcached” type buckets. Also, some other operations are only available against specific versions of Couchbase Server.
Always apply a Observable.timeout(long, TimeUnit)
of some form to add a boundary between the SDK as an integration point and the application. Networks are unreliable, servers can fail and the SDK contains bugs. With applying a timeout and reacting to them accordingly, application level code is less likely to fail.
Modifier and Type | Method and Description |
---|---|
<D extends Document<?>> |
append(D document)
Append a
Document s content to an existing one. |
<D extends Document<?>> |
append(D document,
long timeout,
TimeUnit timeUnit)
Append a
Document s content to an existing one. |
<D extends Document<?>> |
append(D document,
PersistTo persistTo)
Append a
Document s content to an existing one. |
<D extends Document<?>> |
append(D document,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Append a
Document s content to an existing one. |
<D extends Document<?>> |
append(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Append a
Document s content to an existing one. |
<D extends Document<?>> |
append(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Append a
Document s content to an existing one. |
<D extends Document<?>> |
append(D document,
ReplicateTo replicateTo)
Append a
Document s content to an existing one. |
<D extends Document<?>> |
append(D document,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Append a
Document s content to an existing one. |
rx.Observable<AsyncBucketManager> |
bucketManager()
Provides access to the
AsyncBucketManager for administrative access. |
rx.Observable<Boolean> |
close()
Closes the
AsyncBucket . |
rx.Observable<ClusterFacade> |
core()
Returns the underlying “core-io” library through its
ClusterFacade . |
rx.Observable<JsonLongDocument> |
counter(String id,
long delta)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry,
PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry,
PersistTo persistTo,
ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry,
ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
int expiry,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
PersistTo persistTo,
ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long initial,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
PersistTo persistTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
PersistTo persistTo,
ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
rx.Observable<JsonLongDocument> |
counter(String id,
long delta,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
|
CouchbaseEnvironment |
environment()
The
CouchbaseEnvironment used. |
<D extends Document<?>> |
exists(D document)
Check whether a document with the given ID does exist in the bucket.
|
<D extends Document<?>> |
exists(D document,
long timeout,
TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket with a custom timeout.
|
rx.Observable<Boolean> |
exists(String id)
Check whether a document with the given ID does exist in the bucket.
|
rx.Observable<Boolean> |
exists(String id,
long timeout,
TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket with a custom timeout.
|
<D extends Document<?>> |
get(D document)
Retrieves any type of
Document by its unique ID. |
<D extends Document<?>> |
get(D document,
long timeout,
TimeUnit timeUnit)
Retrieves any type of
Document by its unique ID with a custom timeout. |
rx.Observable<JsonDocument> |
get(String id)
Retrieves a
JsonDocument by its unique ID. |
<D extends Document<?>> |
get(String id,
Class<D> target)
Retrieves any type of
Document by its unique ID. |
<D extends Document<?>> |
get(String id,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Retrieves any type of
Document by its unique ID with a custom timeout. |
rx.Observable<JsonDocument> |
get(String id,
long timeout,
TimeUnit timeUnit)
Retrieves a
JsonDocument by its unique ID with a custom timeout. |
<D extends Document<?>> |
getAndLock(D document,
int lockTime)
Retrieve and lock a
Document by its unique ID. |
<D extends Document<?>> |
getAndLock(D document,
int lockTime,
long timeout,
TimeUnit timeUnit)
Retrieve and lock a
Document by its unique ID with a custom timeout. |
rx.Observable<JsonDocument> |
getAndLock(String id,
int lockTime)
Retrieve and lock a
JsonDocument by its unique ID. |
<D extends Document<?>> |
getAndLock(String id,
int lockTime,
Class<D> target)
Retrieve and lock a
Document by its unique ID. |
<D extends Document<?>> |
getAndLock(String id,
int lockTime,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Retrieve and lock a
Document by its unique ID with a custom timeout. |
rx.Observable<JsonDocument> |
getAndLock(String id,
int lockTime,
long timeout,
TimeUnit timeUnit)
Retrieve and lock a
JsonDocument by its unique ID with a custom timeout. |
<D extends Document<?>> |
getAndTouch(D document)
Retrieve and touch a
Document by its unique ID. |
<D extends Document<?>> |
getAndTouch(D document,
long timeout,
TimeUnit timeUnit)
Retrieve and touch a
Document by its unique ID with a custom timeout. |
rx.Observable<JsonDocument> |
getAndTouch(String id,
int expiry)
Retrieve and touch a
JsonDocument by its unique ID. |
<D extends Document<?>> |
getAndTouch(String id,
int expiry,
Class<D> target)
Retrieve and touch a
Document by its unique ID. |
<D extends Document<?>> |
getAndTouch(String id,
int expiry,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Retrieve and touch a
Document by its unique ID with a custom timeout. |
rx.Observable<JsonDocument> |
getAndTouch(String id,
int expiry,
long timeout,
TimeUnit timeUnit)
Retrieve and touch a
JsonDocument by its unique ID with a custom timeout. |
<D extends Document<?>> |
getFromReplica(D document,
ReplicaMode type)
Retrieves one or more, possibly stale, representations of a
Document by its unique ID. |
<D extends Document<?>> |
getFromReplica(D document,
ReplicaMode type,
long timeout,
TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a
Document by its unique ID. |
rx.Observable<JsonDocument> |
getFromReplica(String id,
ReplicaMode type)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID. |
<D extends Document<?>> |
getFromReplica(String id,
ReplicaMode type,
Class<D> target)
Retrieves one or more, possibly stale, representations of a
Document by its unique ID. |
<D extends Document<?>> |
getFromReplica(String id,
ReplicaMode type,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a
Document by its unique ID. |
rx.Observable<JsonDocument> |
getFromReplica(String id,
ReplicaMode type,
long timeout,
TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID. |
<D extends Document<?>> |
insert(D document)
Insert a
Document if it does not exist already. |
<D extends Document<?>> |
insert(D document,
long timeout,
TimeUnit timeUnit)
Insert a
Document if it does not exist already. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo)
Insert a
Document if it does not exist already and watch for durability constraints. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Insert a
Document if it does not exist already and watch for durability constraints. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Insert a
Document if it does not exist already and watch for durability constraints. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Insert a
Document if it does not exist already and watch for durability constraints. |
<D extends Document<?>> |
insert(D document,
ReplicateTo replicateTo)
Insert a
Document if it does not exist already and watch for durability constraints. |
<D extends Document<?>> |
insert(D document,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Insert a
Document if it does not exist already and watch for durability constraints. |
rx.Observable<Integer> |
invalidateQueryCache()
Invalidates and clears the internal query cache.
|
boolean |
isClosed()
Returns true if this bucket is already closed, false if it is still open.
|
<E> rx.Observable<Boolean> |
listAppend(String docId,
E element)
Push an element to tail of CouchbaseList
|
<E> rx.Observable<Boolean> |
listAppend(String docId,
E element,
MutationOptionBuilder mutationOptionBuilder)
Push an element to tail of CouchbaseList with additional mutation options provided by
MutationOptionBuilder |
<E> rx.Observable<E> |
listGet(String docId,
int index,
Class<E> elementType)
Get element at an index in the CouchbaseList
|
<E> rx.Observable<Boolean> |
listPrepend(String docId,
E element)
Shift list head to element in CouchbaseList
|
<E> rx.Observable<Boolean> |
listPrepend(String docId,
E element,
MutationOptionBuilder mutationOptionBuilder)
Shift list head to element in CouchbaseList with additional mutation options provided by
MutationOptionBuilder |
rx.Observable<Boolean> |
listRemove(String docId,
int index)
Remove an element from an index in CouchbaseList
|
rx.Observable<Boolean> |
listRemove(String docId,
int index,
MutationOptionBuilder mutationOptionBuilder)
Remove an element from an index in CouchbaseList with additional mutation options provided by
MutationOptionBuilder |
<E> rx.Observable<Boolean> |
listSet(String docId,
int index,
E element)
Add an element at an index in CouchbaseList
|
<E> rx.Observable<Boolean> |
listSet(String docId,
int index,
E element,
MutationOptionBuilder mutationOptionBuilder)
Add an element at an index in CouchbaseList with additional mutation options provided by
MutationOptionBuilder . |
rx.Observable<Integer> |
listSize(String docId)
Returns the number of elements in CouchbaseList
|
AsyncLookupInBuilder |
lookupIn(String docId)
Prepare a sub-document lookup through a
builder API . |
<V> rx.Observable<Boolean> |
mapAdd(String docId,
String key,
V value)
Add a key value pair into CouchbaseMap
|
<V> rx.Observable<Boolean> |
mapAdd(String docId,
String key,
V value,
MutationOptionBuilder mutationOptionBuilder)
Add a key value pair into CouchbaseMap with additional mutation options provided by
MutationOptionBuilder |
<V> rx.Observable<V> |
mapGet(String docId,
String key,
Class<V> valueType)
Get value of a key in the CouchbaseMap
|
rx.Observable<Boolean> |
mapRemove(String docId,
String key)
Remove a key value pair from CouchbaseMap
|
rx.Observable<Boolean> |
mapRemove(String docId,
String key,
MutationOptionBuilder mutationOptionBuilder)
Remove a key value pair from CouchbaseMap with additional mutation options provided by
MutationOptionBuilder |
rx.Observable<Integer> |
mapSize(String docId)
Returns the number key value pairs in CouchbaseMap
|
AsyncMutateInBuilder |
mutateIn(String docId)
Prepare a sub-document mutation through a
builder API . |
String |
name()
The name of the
Bucket . |
rx.Single<PingReport> |
ping(Collection<ServiceType> services,
long timeout,
TimeUnit timeUnit)
Performs a diagnostic active “ping” call on a list of services with a random service id.
|
rx.Single<PingReport> |
ping(long timeout,
TimeUnit timeUnit)
Performs a diagnostic active “ping” call on all services with a random service id.
|
rx.Single<PingReport> |
ping(String reportId,
Collection<ServiceType> services,
long timeout,
TimeUnit timeUnit)
Performs a diagnostic active “ping” call against all the services provided with a custom report id.
|
rx.Single<PingReport> |
ping(String reportId,
long timeout,
TimeUnit timeUnit)
Performs a diagnostic active “ping” call with a custom report ID on all services.
|
<D extends Document<?>> |
prepend(D document)
Prepend a
Document s content to an existing one. |
<D extends Document<?>> |
prepend(D document,
long timeout,
TimeUnit timeUnit)
Prepend a
Document s content to an existing one. |
<D extends Document<?>> |
prepend(D document,
PersistTo persistTo)
Prepend a
Document s content to an existing one. |
<D extends Document<?>> |
prepend(D document,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Prepend a
Document s content to an existing one. |
<D extends Document<?>> |
prepend(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Prepend a
Document s content to an existing one. |
<D extends Document<?>> |
prepend(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Prepend a
Document s content to an existing one. |
<D extends Document<?>> |
prepend(D document,
ReplicateTo replicateTo)
Prepend a
Document s content to an existing one. |
<D extends Document<?>> |
prepend(D document,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Prepend a
Document s content to an existing one. |
rx.Observable<AsyncAnalyticsQueryResult> |
query(AnalyticsQuery query)
Uncommitted: Queries Couchbase Analytics
|
rx.Observable<AsyncAnalyticsQueryResult> |
query(AnalyticsQuery query,
long timeout,
TimeUnit timeUnit)
Uncommitted: Queries Couchbase Analytics
|
rx.Observable<AsyncN1qlQueryResult> |
query(N1qlQuery query)
Queries a N1QL secondary index.
|
rx.Observable<AsyncN1qlQueryResult> |
query(N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Queries a N1QL secondary index with a custom timeout.
|
rx.Observable<AsyncSearchQueryResult> |
query(SearchQuery query)
Queries a Full-Text Index
|
rx.Observable<AsyncSearchQueryResult> |
query(SearchQuery query,
long timeout,
TimeUnit timeUnit)
Queries a Full-Text Index
|
rx.Observable<AsyncSpatialViewResult> |
query(SpatialViewQuery query)
Queries a Couchbase Server Spatial
View . |
rx.Observable<AsyncSpatialViewResult> |
query(SpatialViewQuery query,
long timeout,
TimeUnit timeUnit)
Queries a Couchbase Server Spatial
View . |
rx.Observable<AsyncN1qlQueryResult> |
query(Statement statement)
Queries a N1QL secondary index with a simple
Statement . |
rx.Observable<AsyncViewResult> |
query(ViewQuery query)
Queries a Couchbase Server
View . |
rx.Observable<AsyncViewResult> |
query(ViewQuery query,
long timeout,
TimeUnit timeUnit)
Queries a Couchbase Server
View . |
<E> rx.Observable<E> |
queuePop(String docId,
Class<E> elementType)
Removes the first element from CouchbaseQueue
|
<E> rx.Observable<E> |
queuePop(String docId,
Class<E> elementType,
MutationOptionBuilder mutationOptionBuilder)
Removes the first element from CouchbaseQueue with additional mutation options provided by
MutationOptionBuilder |
<E> rx.Observable<Boolean> |
queuePush(String docId,
E element)
Add an element into CouchbaseQueue
|
<E> rx.Observable<Boolean> |
queuePush(String docId,
E element,
MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseQueue with additional mutation options provided by
MutationOptionBuilder |
rx.Observable<Integer> |
queueSize(String docId)
Returns the number of elements in CouchbaseQueue
|
<D extends Document<?>> |
remove(D document)
Removes a
Document from the Server. |
<D extends Document<?>> |
remove(D document,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo)
Removes a
Document from the Server and apply a durability requirement. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server and apply a durability requirement. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Removes a
Document from the Server and apply a durability requirement. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server and apply a durability requirement. |
<D extends Document<?>> |
remove(D document,
ReplicateTo replicateTo)
Removes a
Document from the Server and apply a durability requirement. |
<D extends Document<?>> |
remove(D document,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server and apply a durability requirement. |
rx.Observable<JsonDocument> |
remove(String id)
Removes a
Document from the Server identified by its ID. |
<D extends Document<?>> |
remove(String id,
Class<D> target)
Removes a
Document from the Server identified by its ID. |
<D extends Document<?>> |
remove(String id,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server identified by its ID. |
rx.Observable<JsonDocument> |
remove(String id,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server identified by its ID. |
rx.Observable<JsonDocument> |
remove(String id,
PersistTo persistTo)
Removes a
Document from the Server by its ID and apply a durability requirement. |
<D extends Document<?>> |
remove(String id,
PersistTo persistTo,
Class<D> target)
Removes a
Document from the Server by its ID and apply a durability requirement. |
<D extends Document<?>> |
remove(String id,
PersistTo persistTo,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement. |
rx.Observable<JsonDocument> |
remove(String id,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement. |
rx.Observable<JsonDocument> |
remove(String id,
PersistTo persistTo,
ReplicateTo replicateTo)
Removes a
Document from the Server by its ID and apply a durability requirement. |
<D extends Document<?>> |
remove(String id,
PersistTo persistTo,
ReplicateTo replicateTo,
Class<D> target)
Removes a
Document from the Server by its ID and apply a durability requirement. |
<D extends Document<?>> |
remove(String id,
PersistTo persistTo,
ReplicateTo replicateTo,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement. |
rx.Observable<JsonDocument> |
remove(String id,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement. |
rx.Observable<JsonDocument> |
remove(String id,
ReplicateTo replicateTo)
Removes a
Document from the Server by its ID and apply a durability requirement. |
<D extends Document<?>> |
remove(String id,
ReplicateTo replicateTo,
Class<D> target)
Removes a
Document from the Server by its ID and apply a durability requirement. |
<D extends Document<?>> |
remove(String id,
ReplicateTo replicateTo,
Class<D> target,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement. |
rx.Observable<JsonDocument> |
remove(String id,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement. |
<D extends Document<?>> |
replace(D document)
Replace a
Document if it does already exist. |
<D extends Document<?>> |
replace(D document,
long timeout,
TimeUnit timeUnit)
Replace a
Document if it does already exist. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo)
Replace a
Document if it does exist and watch for durability constraints. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Replace a
Document if it does exist and watch for durability constraints. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Replace a
Document if it does exist and watch for durability constraints. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Replace a
Document if it does exist and watch for durability constraints. |
<D extends Document<?>> |
replace(D document,
ReplicateTo replicateTo)
Replace a
Document if it does exist and watch for durability constraints. |
<D extends Document<?>> |
replace(D document,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Replace a
Document if it does exist and watch for durability constraints. |
rx.Observable<AsyncRepository> |
repository()
The
Repository provides access to full object document mapping (ODM) capabilities. |
<E> rx.Observable<Boolean> |
setAdd(String docId,
E element)
Add an element into CouchbaseSet
|
<E> rx.Observable<Boolean> |
setAdd(String docId,
E element,
MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseSet with additional mutation options provided by
MutationOptionBuilder |
<E> rx.Observable<Boolean> |
setContains(String docId,
E element)
Check if an element exists in CouchbaseSet
|
<E> rx.Observable<E> |
setRemove(String docId,
E element)
Removes an element from CouchbaseSet
|
<E> rx.Observable<E> |
setRemove(String docId,
E element,
MutationOptionBuilder mutationOptionBuilder)
Removes an element from CouchbaseSet with additional mutation options provided by
MutationOptionBuilder |
rx.Observable<Integer> |
setSize(String docId)
Returns the number of elements in CouchbaseSet
|
FragmentTranscoder |
subdocumentTranscoder()
Returns the transcoder to be used for individual JSON fragments used and returned by the subdocument API.
|
<D extends Document<?>> |
touch(D document)
Renews the expiration time of a
Document . |
<D extends Document<?>> |
touch(D document,
long timeout,
TimeUnit timeUnit)
Renews the expiration time of a
Document . |
rx.Observable<Boolean> |
touch(String id,
int expiry)
Renews the expiration time of a
Document . |
rx.Observable<Boolean> |
touch(String id,
int expiry,
long timeout,
TimeUnit timeUnit)
Renews the expiration time of a
Document . |
<D extends Document<?>> |
unlock(D document)
Unlocks a write-locked
Document . |
<D extends Document<?>> |
unlock(D document,
long timeout,
TimeUnit timeUnit)
Unlocks a write-locked
Document . |
rx.Observable<Boolean> |
unlock(String id,
long cas)
Unlocks a write-locked
Document . |
rx.Observable<Boolean> |
unlock(String id,
long cas,
long timeout,
TimeUnit timeUnit)
Unlocks a write-locked
Document . |
<D extends Document<?>> |
upsert(D document)
Insert or overwrite a
Document . |
<D extends Document<?>> |
upsert(D document,
long timeout,
TimeUnit timeUnit)
Insert or overwrite a
Document . |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo)
Insert or overwrite a
Document and watch for durability constraints. |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo,
long timeout,
TimeUnit timeUnit)
Insert or overwrite a
Document and watch for durability constraints. |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Insert or overwrite a
Document and watch for durability constraints. |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Insert or overwrite a
Document and watch for durability constraints. |
<D extends Document<?>> |
upsert(D document,
ReplicateTo replicateTo)
Insert or overwrite a
Document and watch for durability constraints. |
<D extends Document<?>> |
upsert(D document,
ReplicateTo replicateTo,
long timeout,
TimeUnit timeUnit)
Insert or overwrite a
Document and watch for durability constraints. |
CouchbaseEnvironment environment()
The CouchbaseEnvironment
used.
rx.Observable<ClusterFacade> core()
Returns the underlying “core-io” library through its ClusterFacade
.
Handle with care, with great power comes great responsibility. All additional checks which are normally performed by this library are skipped.
ClusterFacade
from the “core-io” package.FragmentTranscoder subdocumentTranscoder()
Returns the transcoder to be used for individual JSON fragments used and returned by the subdocument API.
FragmentTranscoder
to be used within the subdocument API.lookupIn(String)
,
mutateIn(String)
rx.Observable<JsonDocument> get(String id)
Retrieves a JsonDocument
by its unique ID.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the unique ID of the document.Observable
eventually containing the found JsonDocument
.rx.Observable<JsonDocument> get(String id, long timeout, TimeUnit timeUnit)
Retrieves a JsonDocument
by its unique ID with a custom timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the unique ID of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found JsonDocument
.<D extends Document<?>> rx.Observable<D> get(D document)
Retrieves any type of Document
by its unique ID.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the source document from which the ID is taken and the type is inferred.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> get(D document, long timeout, TimeUnit timeUnit)
Retrieves any type of Document
by its unique ID with a custom timeout.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the source document from which the ID is taken and the type is inferred.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> get(String id, Class<D> target)
Retrieves any type of Document
by its unique ID.
This method differs from get(String)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the unique ID of the document.target
- the target document type to use.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> get(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves any type of Document
by its unique ID with a custom timeout.
This method differs from get(String)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the unique ID of the document.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found Document
.rx.Observable<Boolean> exists(String id)
Check whether a document with the given ID does exist in the bucket.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.rx.Observable<Boolean> exists(String id, long timeout, TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket with a custom timeout.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<Boolean> exists(D document)
Check whether a document with the given ID does exist in the bucket.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document where the ID is extracted from.<D extends Document<?>> rx.Observable<Boolean> exists(D document, long timeout, TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket with a custom timeout.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document where the ID is extracted from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<JsonDocument> getFromReplica(String id, ReplicaMode type)
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
Because this method is considered to be a “last resort” call against the database if a regular get didn’t succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
id
- id the unique ID of the document.type
- the ReplicaMode
to select.Observable
eventually containing zero to N JsonDocument
s.rx.Observable<JsonDocument> getFromReplica(String id, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
Because this method is considered to be a “last resort” call against the database if a regular get didn’t succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
id
- id the unique ID of the document.type
- the ReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing zero to N JsonDocument
s.<D extends Document<?>> rx.Observable<D> getFromReplica(D document, ReplicaMode type)
Retrieves one or more, possibly stale, representations of a Document
by its unique ID.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
Depending on the ReplicaMode
selected, there can be none to four Document
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning Document
responses can come in any order.
The returned Observable
can error under the following conditions:
Because this method is considered to be a “last resort” call against the database if a regular get didn’t succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
document
- the source document from which the ID is taken and the type is inferred.type
- the ReplicaMode
to select.Observable
eventually containing zero to N Document
s.<D extends Document<?>> rx.Observable<D> getFromReplica(D document, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a Document
by its unique ID.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
Depending on the ReplicaMode
selected, there can be none to four Document
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning Document
responses can come in any order.
The returned Observable
can error under the following conditions:
Because this method is considered to be a “last resort” call against the database if a regular get didn’t succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
document
- the source document from which the ID is taken and the type is inferred.type
- the ReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing zero to N Document
s.<D extends Document<?>> rx.Observable<D> getFromReplica(String id, ReplicaMode type, Class<D> target)
Retrieves one or more, possibly stale, representations of a Document
by its unique ID.
This method differs from getFromReplica(String, ReplicaMode)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
Depending on the ReplicaMode
selected, there can be none to four Document
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning Document
responses can come in any order.
The returned Observable
can error under the following conditions:
Because this method is considered to be a “last resort” call against the database if a regular get didn’t succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
id
- id the unique ID of the document.type
- the ReplicaMode
to select.target
- the target document type to use.Observable
eventually containing zero to N Document
s.<D extends Document<?>> rx.Observable<D> getFromReplica(String id, ReplicaMode type, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a Document
by its unique ID.
This method differs from getFromReplica(String, ReplicaMode)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
Depending on the ReplicaMode
selected, there can be none to four Document
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning Document
responses can come in any order.
The returned Observable
can error under the following conditions:
Because this method is considered to be a “last resort” call against the database if a regular get didn’t succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
id
- id the unique ID of the document.type
- the ReplicaMode
to select.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing zero to N Document
s.rx.Observable<JsonDocument> getAndLock(String id, int lockTime)
Retrieve and lock a JsonDocument
by its unique ID.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically.
Detecting an already locked document is done by checking for TemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help.
The returned Observable
can error under the following conditions:
TemporaryLockFailureException
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).Observable
eventually containing the found JsonDocument
.rx.Observable<JsonDocument> getAndLock(String id, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock a JsonDocument
by its unique ID with a custom timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically.
Detecting an already locked document is done by checking for TemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help.
The returned Observable
can error under the following conditions:
TemporaryLockFailureException
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found JsonDocument
.<D extends Document<?>> rx.Observable<D> getAndLock(D document, int lockTime)
Retrieve and lock a Document
by its unique ID.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(Document)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically.
Detecting an already locked document is done by checking for TemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help.
The returned Observable
can error under the following conditions:
TemporaryLockFailureException
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the source document from which the ID is taken and the type is inferred.lockTime
- the time to write lock the document (max. 30 seconds).Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> getAndLock(D document, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock a Document
by its unique ID with a custom timeout.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(Document)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically.
Detecting an already locked document is done by checking for TemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help.
The returned Observable
can error under the following conditions:
TemporaryLockFailureException
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the source document from which the ID is taken and the type is inferred.lockTime
- the time to write lock the document (max. 30 seconds).timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> getAndLock(String id, int lockTime, Class<D> target)
Retrieve and lock a Document
by its unique ID.
This method differs from getAndLock(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically.
Detecting an already locked document is done by checking for TemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help.
The returned Observable
can error under the following conditions: - In case of transient error, most probably because key is already locked: TemporaryLockFailureException
- The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).target
- the target document type to use.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> getAndLock(String id, int lockTime, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and lock a Document
by its unique ID with a custom timeout.
This method differs from getAndLock(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically.
Detecting an already locked document is done by checking for TemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help.
The returned Observable
can error under the following conditions: - In case of transient error, most probably because key is already locked: TemporaryLockFailureException
- The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found Document
.rx.Observable<JsonDocument> getAndTouch(String id, int expiry)
Retrieve and touch a JsonDocument
by its unique ID.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- id the unique ID of the document.expiry
- the new expiration time for the document.Observable
eventually containing the found JsonDocument
.rx.Observable<JsonDocument> getAndTouch(String id, int expiry, long timeout, TimeUnit timeUnit)
Retrieve and touch a JsonDocument
by its unique ID with a custom timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- id the unique ID of the document.expiry
- the new expiration time for the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found JsonDocument
.<D extends Document<?>> rx.Observable<D> getAndTouch(D document)
Retrieve and touch a Document
by its unique ID.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the source document from which the ID and expiry is taken and the type is inferred.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> getAndTouch(D document, long timeout, TimeUnit timeUnit)
Retrieve and touch a Document
by its unique ID with a custom timeout.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the source document from which the ID and expiry is taken and the type is inferred.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> getAndTouch(String id, int expiry, Class<D> target)
Retrieve and touch a Document
by its unique ID.
This method differs from getAndTouch(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- id the unique ID of the document.expiry
- the new expiration time for the document.target
- the target document type to use.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> getAndTouch(String id, int expiry, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and touch a Document
by its unique ID with a custom timeout.
This method differs from getAndTouch(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to get(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- id the unique ID of the document.expiry
- the new expiration time for the document.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Observable
eventually containing the found Document
.<D extends Document<?>> rx.Observable<D> insert(D document)
Insert a Document
if it does not exist already.
If the given Document
(identified by its unique ID) already exists, the observable errors with a DocumentAlreadyExistsException
. If the operation should also override the existing Document
, upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, insert(Document, PersistTo, ReplicateTo)
should be used instead.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.<D extends Document<?>> rx.Observable<D> insert(D document, long timeout, TimeUnit timeUnit)
Insert a Document
if it does not exist already.
If the given Document
(identified by its unique ID) already exists, the observable errors with a DocumentAlreadyExistsException
. If the operation should also override the existing Document
, upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, insert(Document, PersistTo, ReplicateTo)
should be used instead.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.<D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert a Document
if it does not exist already and watch for durability constraints.
This method works exactly like insert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert a Document
if it does not exist already and watch for durability constraints.
This method works exactly like insert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo)
Insert a Document
if it does not exist already and watch for durability constraints.
This method works exactly like insert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert a Document
if it does not exist already and watch for durability constraints.
This method works exactly like insert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> insert(D document, ReplicateTo replicateTo)
Insert a Document
if it does not exist already and watch for durability constraints.
This method works exactly like insert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> insert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert a Document
if it does not exist already and watch for durability constraints.
This method works exactly like insert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> upsert(D document)
Insert or overwrite a Document
.
If the given Document
(identified by its unique ID) already exists, it will be overridden by the current one. The returned Document
contains original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document)
method needs to be used.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, upsert(Document, PersistTo, ReplicateTo)
should be used instead.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.<D extends Document<?>> rx.Observable<D> upsert(D document, long timeout, TimeUnit timeUnit)
Insert or overwrite a Document
.
If the given Document
(identified by its unique ID) already exists, it will be overridden by the current one. The returned Document
contains original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document)
method needs to be used.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, upsert(Document, PersistTo, ReplicateTo)
should be used instead.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.<D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert or overwrite a Document
and watch for durability constraints.
This method works exactly like upsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo, ReplicateTo)
method needs to be used.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite a Document
and watch for durability constraints.
This method works exactly like upsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo, ReplicateTo)
method needs to be used.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo)
Insert or overwrite a Document
and watch for durability constraints.
This method works exactly like upsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo)
method needs to be used.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert or overwrite a Document
and watch for durability constraints.
This method works exactly like upsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo)
method needs to be used.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> upsert(D document, ReplicateTo replicateTo)
Insert or overwrite a Document
and watch for durability constraints.
This method works exactly like upsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document, ReplicateTo)
method needs to be used.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> upsert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite a Document
and watch for durability constraints.
This method works exactly like upsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
Please note that this method will not use the Document.cas()
for optimistic concurrency checks. If this behavior is needed, the replace(Document, ReplicateTo)
method needs to be used.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> replace(D document)
Replace a Document
if it does already exist.
If the given Document
(identified by its unique ID) does not exist already, the method errors with a DocumentDoesNotExistException
. If the operation should also insert the Document
, upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, replace(Document, PersistTo, ReplicateTo)
should be used instead.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.<D extends Document<?>> rx.Observable<D> replace(D document, long timeout, TimeUnit timeUnit)
Replace a Document
if it does already exist.
If the given Document
(identified by its unique ID) does not exist already, the method errors with a DocumentDoesNotExistException
. If the operation should also insert the Document
, upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, replace(Document, PersistTo, ReplicateTo)
should be used instead.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.<D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo, ReplicateTo replicateTo)
Replace a Document
if it does exist and watch for durability constraints.
This method works exactly like replace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
DurabilityException
.CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace a Document
if it does exist and watch for durability constraints.
This method works exactly like replace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
DurabilityException
.CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo)
Replace a Document
if it does exist and watch for durability constraints.
This method works exactly like replace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
DurabilityException
.CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Replace a Document
if it does exist and watch for durability constraints.
This method works exactly like replace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
DurabilityException
.CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> replace(D document, ReplicateTo replicateTo)
Replace a Document
if it does exist and watch for durability constraints.
This method works exactly like replace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
DurabilityException
.CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> replace(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace a Document
if it does exist and watch for durability constraints.
This method works exactly like replace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
RequestTooBigException
DurabilityException
.CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
<D extends Document<?>> rx.Observable<D> remove(D document)
Removes a Document
from the Server.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.<D extends Document<?>> rx.Observable<D> remove(D document, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo, ReplicateTo replicateTo)
Removes a Document
from the Server and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.<D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo)
Removes a Document
from the Server and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.<D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> remove(D document, ReplicateTo replicateTo)
Removes a Document
from the Server and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.replicateTo
- the replication constraint to watch.<D extends Document<?>> rx.Observable<D> remove(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
Document
and it did not match with the server: CASMismatchException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to remove, with the ID extracted.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<JsonDocument> remove(String id)
Removes a Document
from the Server identified by its ID.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.rx.Observable<JsonDocument> remove(String id, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server identified by its ID.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<JsonDocument> remove(String id, PersistTo persistTo, ReplicateTo replicateTo)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.rx.Observable<JsonDocument> remove(String id, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<JsonDocument> remove(String id, PersistTo persistTo)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.rx.Observable<JsonDocument> remove(String id, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<JsonDocument> remove(String id, ReplicateTo replicateTo)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.replicateTo
- the replication constraint to watch.rx.Observable<JsonDocument> remove(String id, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> remove(String id, Class<D> target)
Removes a Document
from the Server identified by its ID.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.target
- the target document type to use.<D extends Document<?>> rx.Observable<D> remove(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server identified by its ID.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.target
- the target document type to use.<D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, Class<D> target)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.target
- the target document type to use.<D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.persistTo
- the persistence constraint to watch.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> remove(String id, ReplicateTo replicateTo, Class<D> target)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.replicateTo
- the replication constraint to watch.target
- the target document type to use.<D extends Document<?>> rx.Observable<D> remove(String id, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes a Document
from the Server by its ID and apply a durability requirement.
The Document
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
DurabilityException
.DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to remove.replicateTo
- the replication constraint to watch.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<AsyncViewResult> query(ViewQuery query)
Queries a Couchbase Server View
.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
ViewDoesNotExistException
query
- the query to perform.rx.Observable<AsyncSpatialViewResult> query(SpatialViewQuery query)
Queries a Couchbase Server Spatial View
.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
ViewDoesNotExistException
query
- the spatial query to perform.rx.Observable<AsyncViewResult> query(ViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase Server View
.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
ViewDoesNotExistException
query
- the query to perform.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<AsyncSpatialViewResult> query(SpatialViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase Server Spatial View
.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
ViewDoesNotExistException
query
- the spatial query to perform.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<AsyncN1qlQueryResult> query(Statement statement)
Queries a N1QL secondary index with a simple Statement
.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
statement
- the statement in a DSL form (start with a static select() import).rx.Observable<AsyncN1qlQueryResult> query(N1qlQuery query)
Queries a N1QL secondary index.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
query
- the full N1qlQuery
.rx.Observable<AsyncN1qlQueryResult> query(N1qlQuery query, long timeout, TimeUnit timeUnit)
Queries a N1QL secondary index with a custom timeout.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
query
- the full N1qlQuery
.timeout
- the custom timeout.timeUnit
- the unit for the timeout.@InterfaceStability.Committed rx.Observable<AsyncSearchQueryResult> query(SearchQuery query)
Queries a Full-Text Index
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
query
- the query builder.@InterfaceStability.Committed rx.Observable<AsyncSearchQueryResult> query(SearchQuery query, long timeout, TimeUnit timeUnit)
Queries a Full-Text Index
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
query
- the query builder.timeout
- the custom timeout.timeUnit
- the unit for the timeout.@InterfaceStability.Uncommitted rx.Observable<AsyncAnalyticsQueryResult> query(AnalyticsQuery query)
Uncommitted: Queries Couchbase Analytics
query
- the query builder.@InterfaceStability.Uncommitted rx.Observable<AsyncAnalyticsQueryResult> query(AnalyticsQuery query, long timeout, TimeUnit timeUnit)
Uncommitted: Queries Couchbase Analytics
query
- the query builder.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<Boolean> unlock(String id, long cas)
Unlocks a write-locked Document
.
The returned Observable
can error under the following conditions:
TemporaryLockFailureException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to unlock.cas
- the CAS value which is mandatory to unlock it.rx.Observable<Boolean> unlock(String id, long cas, long timeout, TimeUnit timeUnit)
Unlocks a write-locked Document
.
The returned Observable
can error under the following conditions:
TemporaryLockFailureException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document to unlock.cas
- the CAS value which is mandatory to unlock it.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<Boolean> unlock(D document)
Unlocks a write-locked Document
.
The returned Observable
can error under the following conditions:
DocumentDoesNotExistException
TemporaryLockFailureException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document where ID and CAS are extracted from.<D extends Document<?>> rx.Observable<Boolean> unlock(D document, long timeout, TimeUnit timeUnit)
Unlocks a write-locked Document
.
The returned Observable
can error under the following conditions:
DocumentDoesNotExistException
TemporaryLockFailureException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document where ID and CAS are extracted from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<Boolean> touch(String id, int expiry)
Renews the expiration time of a Document
.
Compared to getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
The returned Observable
can error under the following conditions:
DocumentDoesNotExistException
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.expiry
- the new expiration time. 0 means no expiry.rx.Observable<Boolean> touch(String id, int expiry, long timeout, TimeUnit timeUnit)
Renews the expiration time of a Document
.
Compared to getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
The returned Observable
can error under the following conditions:
DocumentDoesNotExistException
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.expiry
- the new expiration time. 0 means no expiry.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<Boolean> touch(D document)
Renews the expiration time of a Document
.
Compared to getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to extract the ID and expiry from.<D extends Document<?>> rx.Observable<Boolean> touch(D document, long timeout, TimeUnit timeUnit)
Renews the expiration time of a Document
.
Compared to getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document to extract the ID and expiry from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.rx.Observable<JsonLongDocument> counter(String id, long delta)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DocumentDoesNotExistException
.CouchbaseException
.id
- the id of the document.delta
- the increment or decrement amount.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DocumentDoesNotExistException
.CouchbaseException
.id
- the id of the document.delta
- the increment or decrement amount.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.DocumentDoesNotExistException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.DocumentDoesNotExistException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.DocumentDoesNotExistException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.replicateTo
- the replication constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.DocumentDoesNotExistException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.DocumentDoesNotExistException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.DocumentDoesNotExistException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.persistTo
- the persistence constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.replicateTo
- the replication constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
It is not allowed that the delta value will bring the actual value below zero.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.replicateTo
- the replication constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.Document
containing the resulting value.rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist.
This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero.
Note: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters!
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value to use if the document does not exist yet.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.Document
containing the resulting value.<D extends Document<?>> rx.Observable<D> append(D document)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document, identified by its id, from which the content is appended to the existing one.<D extends Document<?>> rx.Observable<D> append(D document, long timeout, TimeUnit timeUnit)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document, identified by its id, from which the content is appended to the existing one.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.<D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> append(D document, ReplicateTo replicateTo)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is appended to the existing one.replicateTo
- the replication constraint to watch.<D extends Document<?>> rx.Observable<D> append(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is appended to the existing one.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo, ReplicateTo replicateTo)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.<D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the appended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> prepend(D document)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document, identified by its id, from which the content is prepended to the existing one.<D extends Document<?>> rx.Observable<D> prepend(D document, long timeout, TimeUnit timeUnit)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
CouchbaseException
.document
- the document, identified by its id, from which the content is prepended to the existing one.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.<D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> prepend(D document, ReplicateTo replicateTo)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is prepended to the existing one.replicateTo
- the replication constraint to watch.<D extends Document<?>> rx.Observable<D> prepend(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is prepended to the existing one.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.<D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo, ReplicateTo replicateTo)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.<D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend a Document
s content to an existing one.
The Document
returned explicitly has the Document.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how the Document
now looks like. A separate get(Document)
call needs to be issued in order to get the full current content.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
Note that this method does not support expiration on the Document
. If set, it will be ignored.
The returned Observable
can error under the following conditions:
BackpressureException
RequestCancelledException
RequestTooBigException
DocumentDoesNotExistException
TemporaryFailureException
CouchbaseOutOfMemoryException
DurabilityException
.CouchbaseException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.@InterfaceStability.Committed @InterfaceAudience.Public AsyncLookupInBuilder lookupIn(String docId)
Prepare a sub-document lookup through a builder API
. You can use the builder to describe one or several lookup operations inside an existing JsonDocument
, then execute the lookup asynchronously by calling the AsyncLookupInBuilder.execute()
method. Only the paths that you looked up inside the document will be transferred over the wire, limiting the network overhead for large documents.
docId
- the id of the JSON document to lookup in.AsyncLookupInBuilder.execute()
@InterfaceStability.Committed @InterfaceAudience.Public AsyncMutateInBuilder mutateIn(String docId)
Prepare a sub-document mutation through a builder API
. You can use the builder to describe one or several mutation operations inside an existing JsonDocument
, then execute them asynchronously by calling the AsyncMutateInBuilder.execute()
method. Only the values that you want mutated inside the document will be transferred over the wire, limiting the network overhead for large documents. A get followed by a replace of the whole document isn’t needed anymore. Note that you can set the expiry, check the CAS and ask for durability constraints in the builder using methods prefixed by “with”: withExpiry
, withCas
, withDurability
.
docId
- the id of the JSON document to mutate in.AsyncMutateInBuilder.execute()
@InterfaceStability.Committed @InterfaceAudience.Public <V> rx.Observable<Boolean> mapAdd(String docId, String key, V value)
Add a key value pair into CouchbaseMap
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the mapkey
- key to be storedvalue
- value to be stored@InterfaceStability.Committed @InterfaceAudience.Public <V> rx.Observable<Boolean> mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder)
Add a key value pair into CouchbaseMap with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - IllegalStateException
if the map is full (limited by couchbase document size) - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the mapkey
- key to be storedvalue
- value to be storedmutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public <V> rx.Observable<V> mapGet(String docId, String key, Class<V> valueType)
Get value of a key in the CouchbaseMap
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the key is not found in the map PathNotFoundException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the mapkey
- key in the mapvalueType
- value type class@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Boolean> mapRemove(String docId, String key)
Remove a key value pair from CouchbaseMap
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the mapkey
- key to be removed@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Boolean> mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder)
Remove a key value pair from CouchbaseMap with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the mapkey
- key to be removed@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Integer> mapSize(String docId)
Returns the number key value pairs in CouchbaseMap
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the map@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<E> listGet(String docId, int index, Class<E> elementType)
Get element at an index in the CouchbaseList
This method throws under the following conditions: - IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the index is not found in the list PathNotFoundException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listindex
- index in listelementType
- element type class@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> listAppend(String docId, E element)
Push an element to tail of CouchbaseList
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listelement
- element to be pushed into the queue@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Push an element to tail of CouchbaseList with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listelement
- element to be pushed into the queuemutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Boolean> listRemove(String docId, int index)
Remove an element from an index in CouchbaseList
This method throws under the following conditions: - IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listindex
- index of the element in list@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Boolean> listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder)
Remove an element from an index in CouchbaseList with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listindex
- index of the element in listmutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> listPrepend(String docId, E element)
Shift list head to element in CouchbaseList
This method throws under the following conditions: - IllegalStateException
if the list is full (limited by couchbase document size) - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - If the underlying couchbase document does not exist: DocumentDoesNotExistException
- A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listelement
- element to shift as head of list@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Shift list head to element in CouchbaseList with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - If the underlying couchbase document does not exist: DocumentDoesNotExistException
- A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listelement
- element to shift as head of listmutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> listSet(String docId, int index, E element)
Add an element at an index in CouchbaseList
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listindex
- index in the listelement
- element to be added@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element at an index in CouchbaseList with additional mutation options provided by MutationOptionBuilder
.
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - If the underlying couchbase document does not exist: DocumentDoesNotExistException
- A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the listindex
- index in the listelement
- element to be addedmutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Integer> listSize(String docId)
Returns the number of elements in CouchbaseList
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the list@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> setAdd(String docId, E element)
Add an element into CouchbaseSet
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the setelement
- element to be pushed into the set@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseSet with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the setelement
- element to be pushed into the setmutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> setContains(String docId, E element)
Check if an element exists in CouchbaseSet
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the setelement
- element to check for existence@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<E> setRemove(String docId, E element)
Removes an element from CouchbaseSet
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the setelement
- element to be removed@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<E> setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Removes an element from CouchbaseSet with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the setelement
- element to be removedmutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Integer> setSize(String docId)
Returns the number of elements in CouchbaseSet
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the set@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> queuePush(String docId, E element)
Add an element into CouchbaseQueue
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the queueelement
- element to be pushed into the queue@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<Boolean> queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseQueue with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the queueelement
- element to be pushed into the queuemutationOptionBuilder
- mutation options MutationOptionBuilder
@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<E> queuePop(String docId, Class<E> elementType)
Removes the first element from CouchbaseQueue
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the queueelementType
- element type class@InterfaceStability.Committed @InterfaceAudience.Public <E> rx.Observable<E> queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder)
Removes the first element from CouchbaseQueue with additional mutation options provided by MutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException
. - A CAS value was set and it did not match with the server: CASMismatchException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the queueelementType
- element type class@InterfaceStability.Committed @InterfaceAudience.Public rx.Observable<Integer> queueSize(String docId)
Returns the number of elements in CouchbaseQueue
This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
- If the underlying couchbase document does not exist: DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help: TemporaryFailureException
- The server is out of memory: CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a generic CouchbaseException
.
docId
- document id backing the queuerx.Observable<Integer> invalidateQueryCache()
Invalidates and clears the internal query cache.
This method can be used to explicitly clear the internal N1QL query cache. This cache will be filled with non-adhoc query statements (query plans) to speed up those subsequent executions.
Triggering this method will wipe out the complete cache, which will not cause an interruption but rather all queries need to be re-prepared internally. This method is likely to be deprecated in the future once the server side query engine distributes its state throughout the cluster.
The returned Observable
will not error out under any conditions.
rx.Observable<AsyncBucketManager> bucketManager()
Provides access to the AsyncBucketManager
for administrative access.
The manager lets you perform operations such as flushing a bucket or creating and managing design documents.
@InterfaceAudience.Public @InterfaceStability.Experimental rx.Observable<AsyncRepository> repository()
The Repository
provides access to full object document mapping (ODM) capabilities.
It allows you to work with POJO entities only and use annotations to customize the behaviour and mapping characteristics.
rx.Observable<Boolean> close()
Closes the AsyncBucket
.
Observable
eventually containing a new Boolean
after close.boolean isClosed()
Returns true if this bucket is already closed, false if it is still open.
rx.Single<PingReport> ping(String reportId, long timeout, TimeUnit timeUnit)
Performs a diagnostic active “ping” call with a custom report ID on all services.
Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
reportId
- the report ID to use in the report.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.rx.Single<PingReport> ping(long timeout, TimeUnit timeUnit)
Performs a diagnostic active “ping” call on all services with a random service id.
Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.rx.Single<PingReport> ping(Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Performs a diagnostic active “ping” call on a list of services with a random service id.
Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
services
- collection of services which should be included.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.rx.Single<PingReport> ping(String reportId, Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Performs a diagnostic active “ping” call against all the services provided with a custom report id.
Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
reportId
- the report ID to use in the report.services
- collection of services which should be included.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.Copyright © 2015 Couchbase, Inc.