Package com.couchbase.client.java
Class CouchbaseAsyncBucket
- java.lang.Object
-
- com.couchbase.client.java.CouchbaseAsyncBucket
-
- All Implemented Interfaces:
AsyncBucket
public class CouchbaseAsyncBucket extends Object implements AsyncBucket
-
-
Field Summary
Fields Modifier and Type Field Description static BinaryTranscoder
BINARY_TRANSCODER
static ByteArrayTranscoder
BYTE_ARRAY_TRANSCODER
static int
COUNTER_NOT_EXISTS_EXPIRY
static String
CURRENT_BUCKET_IDENTIFIER
static JsonArrayTranscoder
JSON_ARRAY_TRANSCODER
static JsonBooleanTranscoder
JSON_BOOLEAN_TRANSCODER
static JsonDoubleTranscoder
JSON_DOUBLE_TRANSCODER
static JsonLongTranscoder
JSON_LONG_TRANSCODER
static JsonTranscoder
JSON_OBJECT_TRANSCODER
static JsonStringTranscoder
JSON_STRING_TRANSCODER
static LegacyTranscoder
LEGACY_TRANSCODER
static RawJsonTranscoder
RAW_JSON_TRANSCODER
static SerializableTranscoder
SERIALIZABLE_TRANSCODER
static StringTranscoder
STRING_TRANSCODER
-
Constructor Summary
Constructors Constructor Description CouchbaseAsyncBucket(ClusterFacade core, CouchbaseEnvironment environment, String name, String username, String password, List<Transcoder<? extends Document,?>> customTranscoders)
CouchbaseAsyncBucket(ClusterFacade core, CouchbaseEnvironment environment, String name, String password, List<Transcoder<? extends Document,?>> customTranscoders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <D extends Document<?>>
rx.Observable<D>append(D document)
Append aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>append(D document, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>append(D document, PersistTo persistTo)
Append aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>append(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>append(D document, PersistTo persistTo, ReplicateTo replicateTo)
Append aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>append(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>append(D document, ReplicateTo replicateTo)
Append aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>append(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one.rx.Observable<AsyncBucketManager>
bucketManager()
Provides access to theAsyncBucketManager
for administrative access.rx.Observable<Boolean>
close()
Closes theAsyncBucket
.rx.Observable<ClusterFacade>
core()
Returns the underlying "core-io" library through itsClusterFacade
.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()
TheCouchbaseEnvironment
used.<D extends Document<?>>
rx.Observable<Boolean>exists(D document)
Check whether a document with the given ID does exist in the bucket.<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.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<?>>
rx.Observable<D>get(D document)
Retrieves any type ofDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>get(D document, long timeout, TimeUnit timeUnit)
Retrieves any type ofDocument
by its unique ID with a custom timeout.rx.Observable<JsonDocument>
get(String id)
Retrieves aJsonDocument
by its unique ID.rx.Observable<JsonDocument>
get(String id, long timeout, TimeUnit timeUnit)
Retrieves aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
rx.Observable<D>get(String id, Class<D> target)
Retrieves any type ofDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>get(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves any type ofDocument
by its unique ID with a custom timeout.<D extends Document<?>>
rx.Observable<D>getAndLock(D document, int lockTime)
Retrieve and lock aDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>getAndLock(D document, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock aDocument
by its unique ID with a custom timeout.rx.Observable<JsonDocument>
getAndLock(String id, int lockTime)
Retrieve and lock aJsonDocument
by its unique ID.rx.Observable<JsonDocument>
getAndLock(String id, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
rx.Observable<D>getAndLock(String id, int lockTime, Class<D> target)
Retrieve and lock aDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>getAndLock(String id, int lockTime, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and lock aDocument
by its unique ID with a custom timeout.<D extends Document<?>>
rx.Observable<D>getAndTouch(D document)
Retrieve and touch aDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>getAndTouch(D document, long timeout, TimeUnit timeUnit)
Retrieve and touch aDocument
by its unique ID with a custom timeout.rx.Observable<JsonDocument>
getAndTouch(String id, int expiry)
Retrieve and touch aJsonDocument
by its unique ID.rx.Observable<JsonDocument>
getAndTouch(String id, int expiry, long timeout, TimeUnit timeUnit)
Retrieve and touch aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
rx.Observable<D>getAndTouch(String id, int expiry, Class<D> target)
Retrieve and touch aDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>getAndTouch(String id, int expiry, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and touch aDocument
by its unique ID with a custom timeout.<D extends Document<?>>
rx.Observable<D>getFromReplica(D document, ReplicaMode type)
Retrieves one or more, possibly stale, representations of aDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>getFromReplica(D document, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aDocument
by its unique ID.rx.Observable<JsonDocument>
getFromReplica(String id, ReplicaMode type)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID.rx.Observable<JsonDocument>
getFromReplica(String id, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>getFromReplica(String id, ReplicaMode type, Class<D> target)
Retrieves one or more, possibly stale, representations of aDocument
by its unique ID.<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 aDocument
by its unique ID.<D extends Document<?>>
rx.Observable<D>insert(D document)
Insert aDocument
if it does not exist already.<D extends Document<?>>
rx.Observable<D>insert(D document, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already.<D extends Document<?>>
rx.Observable<D>insert(D document, PersistTo persistTo)
Insert aDocument
if it does not exist already and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>insert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>insert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert aDocument
if it does not exist already and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>insert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>insert(D document, ReplicateTo replicateTo)
Insert aDocument
if it does not exist already and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>insert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert aDocument
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 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 genericCouchbaseException
.<E> rx.Observable<Boolean>
listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Push an element to tail of CouchbaseList with additional mutation options provided byMutationOptionBuilder
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
.<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 listPathNotFoundException
- 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 genericCouchbaseException
.<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
.<E> rx.Observable<Boolean>
listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Shift list head to element in CouchbaseList with additional mutation options provided byMutationOptionBuilder
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
.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 genericCouchbaseException
.rx.Observable<Boolean>
listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder)
Remove an element from an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
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
.<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 genericCouchbaseException
.<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 byMutationOptionBuilder
.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 genericCouchbaseException
.AsyncLookupInBuilder
lookupIn(String docId)
Prepare a sub-document lookup through abuilder API
.<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 genericCouchbaseException
.<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 byMutationOptionBuilder
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
.<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 mapPathNotFoundException
- 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 genericCouchbaseException
.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 genericCouchbaseException
.rx.Observable<Boolean>
mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder)
Remove a key value pair from CouchbaseMap with additional mutation options provided byMutationOptionBuilder
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
.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 genericCouchbaseException
.AsyncMutateInBuilder
mutateIn(String docId)
Prepare a sub-document mutation through abuilder API
.protected N1qlQueryExecutor
n1qlQueryExecutor()
Returns the underlyingN1qlQueryExecutor
used to perform N1QL queries.String
name()
The name of theBucket
.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, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call with a custom report ID on all services.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(Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call on a list of services with a random service id.<D extends Document<?>>
rx.Observable<D>prepend(D document)
Prepend aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>prepend(D document, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>prepend(D document, PersistTo persistTo)
Prepend aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>prepend(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>prepend(D document, PersistTo persistTo, ReplicateTo replicateTo)
Prepend aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>prepend(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>prepend(D document, ReplicateTo replicateTo)
Prepend aDocument
s content to an existing one.<D extends Document<?>>
rx.Observable<D>prepend(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one.rx.Observable<AsyncAnalyticsQueryResult>
query(AnalyticsQuery query)
Queries Couchbase Analyticsrx.Observable<AsyncAnalyticsQueryResult>
query(AnalyticsQuery query, long timeout, TimeUnit timeUnit)
Queries Couchbase Analyticsrx.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<AsyncN1qlQueryResult>
query(Statement statement)
Queries a N1QL secondary index with a simpleStatement
.rx.Observable<AsyncSearchQueryResult>
query(SearchQuery query)
Queries a Full-Text Index The returnedObservable
can error 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
rx.Observable<AsyncSearchQueryResult>
query(SearchQuery query, long timeout, TimeUnit timeUnit)
Queries a Full-Text Index The returnedObservable
can error 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
rx.Observable<AsyncSpatialViewResult>
query(SpatialViewQuery query)
Queries a Couchbase Server SpatialView
.rx.Observable<AsyncSpatialViewResult>
query(SpatialViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase Server SpatialView
.rx.Observable<AsyncViewResult>
query(ViewQuery query)
Queries a Couchbase ServerView
.rx.Observable<AsyncViewResult>
query(ViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase ServerView
.<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 genericCouchbaseException
.<E> rx.Observable<E>
queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder)
Removes the first element from CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
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
.<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 genericCouchbaseException
.<E> rx.Observable<Boolean>
queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
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
.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 genericCouchbaseException
.<D extends Document<?>>
rx.Observable<D>remove(D document)
Removes aDocument
from the Server.<D extends Document<?>>
rx.Observable<D>remove(D document, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server.<D extends Document<?>>
rx.Observable<D>remove(D document, PersistTo persistTo)
Removes aDocument
from the Server and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(D document, PersistTo persistTo, ReplicateTo replicateTo)
Removes aDocument
from the Server and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(D document, ReplicateTo replicateTo)
Removes aDocument
from the Server and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement.rx.Observable<JsonDocument>
remove(String id)
Removes aDocument
from the Server identified by its ID.rx.Observable<JsonDocument>
remove(String id, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server identified by its ID.rx.Observable<JsonDocument>
remove(String id, PersistTo persistTo)
Removes aDocument
from the Server by its ID and apply a durability requirement.rx.Observable<JsonDocument>
remove(String id, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement.rx.Observable<JsonDocument>
remove(String id, PersistTo persistTo, ReplicateTo replicateTo)
Removes aDocument
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 aDocument
from the Server by its ID and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(String id, PersistTo persistTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(String id, PersistTo persistTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement.rx.Observable<JsonDocument>
remove(String id, ReplicateTo replicateTo)
Removes aDocument
from the Server by its ID and apply a durability requirement.rx.Observable<JsonDocument>
remove(String id, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(String id, ReplicateTo replicateTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(String id, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement.<D extends Document<?>>
rx.Observable<D>remove(String id, Class<D> target)
Removes aDocument
from the Server identified by its ID.<D extends Document<?>>
rx.Observable<D>remove(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server identified by its ID.<D extends Document<?>>
rx.Observable<D>replace(D document)
Replace aDocument
if it does already exist.<D extends Document<?>>
rx.Observable<D>replace(D document, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does already exist.<D extends Document<?>>
rx.Observable<D>replace(D document, PersistTo persistTo)
Replace aDocument
if it does exist and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>replace(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>replace(D document, PersistTo persistTo, ReplicateTo replicateTo)
Replace aDocument
if it does exist and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>replace(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>replace(D document, ReplicateTo replicateTo)
Replace aDocument
if it does exist and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>replace(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints.rx.Observable<AsyncRepository>
repository()
TheRepository
provides access to full object document mapping (ODM) capabilities.<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 genericCouchbaseException
.<E> rx.Observable<Boolean>
setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseSet with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.<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 genericCouchbaseException
.<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 genericCouchbaseException
.<E> rx.Observable<E>
setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Removes an element from CouchbaseSet with additional mutation options provided byMutationOptionBuilder
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
.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 genericCouchbaseException
.FragmentTranscoder
subdocumentTranscoder()
Returns the transcoder to be used for individual JSON fragments used and returned by the subdocument API.String
toString()
<D extends Document<?>>
rx.Observable<Boolean>touch(D document)
Renews the expiration time of aDocument
.<D extends Document<?>>
rx.Observable<Boolean>touch(D document, long timeout, TimeUnit timeUnit)
Renews the expiration time of aDocument
.rx.Observable<Boolean>
touch(String id, int expiry)
Renews the expiration time of aDocument
.rx.Observable<Boolean>
touch(String id, int expiry, long timeout, TimeUnit timeUnit)
Renews the expiration time of aDocument
.<D extends Document<?>>
rx.Observable<Boolean>unlock(D document)
Unlocks a write-lockedDocument
.<D extends Document<?>>
rx.Observable<Boolean>unlock(D document, long timeout, TimeUnit timeUnit)
Unlocks a write-lockedDocument
.rx.Observable<Boolean>
unlock(String id, long cas)
Unlocks a write-lockedDocument
.rx.Observable<Boolean>
unlock(String id, long cas, long timeout, TimeUnit timeUnit)
Unlocks a write-lockedDocument
.<D extends Document<?>>
rx.Observable<D>upsert(D document)
Insert or overwrite aDocument
.<D extends Document<?>>
rx.Observable<D>upsert(D document, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
.<D extends Document<?>>
rx.Observable<D>upsert(D document, PersistTo persistTo)
Insert or overwrite aDocument
and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>upsert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>upsert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert or overwrite aDocument
and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>upsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>upsert(D document, ReplicateTo replicateTo)
Insert or overwrite aDocument
and watch for durability constraints.<D extends Document<?>>
rx.Observable<D>upsert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints.
-
-
-
Field Detail
-
COUNTER_NOT_EXISTS_EXPIRY
public static final int COUNTER_NOT_EXISTS_EXPIRY
- See Also:
- Constant Field Values
-
CURRENT_BUCKET_IDENTIFIER
public static final String CURRENT_BUCKET_IDENTIFIER
- See Also:
- Constant Field Values
-
JSON_OBJECT_TRANSCODER
public static final JsonTranscoder JSON_OBJECT_TRANSCODER
-
JSON_ARRAY_TRANSCODER
public static final JsonArrayTranscoder JSON_ARRAY_TRANSCODER
-
JSON_BOOLEAN_TRANSCODER
public static final JsonBooleanTranscoder JSON_BOOLEAN_TRANSCODER
-
JSON_DOUBLE_TRANSCODER
public static final JsonDoubleTranscoder JSON_DOUBLE_TRANSCODER
-
JSON_LONG_TRANSCODER
public static final JsonLongTranscoder JSON_LONG_TRANSCODER
-
JSON_STRING_TRANSCODER
public static final JsonStringTranscoder JSON_STRING_TRANSCODER
-
RAW_JSON_TRANSCODER
public static final RawJsonTranscoder RAW_JSON_TRANSCODER
-
BYTE_ARRAY_TRANSCODER
public static final ByteArrayTranscoder BYTE_ARRAY_TRANSCODER
-
LEGACY_TRANSCODER
public static final LegacyTranscoder LEGACY_TRANSCODER
-
BINARY_TRANSCODER
public static final BinaryTranscoder BINARY_TRANSCODER
-
STRING_TRANSCODER
public static final StringTranscoder STRING_TRANSCODER
-
SERIALIZABLE_TRANSCODER
public static final SerializableTranscoder SERIALIZABLE_TRANSCODER
-
-
Constructor Detail
-
CouchbaseAsyncBucket
public CouchbaseAsyncBucket(ClusterFacade core, CouchbaseEnvironment environment, String name, String password, List<Transcoder<? extends Document,?>> customTranscoders)
-
CouchbaseAsyncBucket
public CouchbaseAsyncBucket(ClusterFacade core, CouchbaseEnvironment environment, String name, String username, String password, List<Transcoder<? extends Document,?>> customTranscoders)
-
-
Method Detail
-
name
public String name()
Description copied from interface:AsyncBucket
The name of theBucket
.- Specified by:
name
in interfaceAsyncBucket
- Returns:
- the name of the bucket.
-
core
public rx.Observable<ClusterFacade> core()
Description copied from interface:AsyncBucket
Returns the underlying "core-io" library through itsClusterFacade
. Handle with care, with great power comes great responsibility. All additional checks which are normally performed by this library are skipped.- Specified by:
core
in interfaceAsyncBucket
- Returns:
- the underlying
ClusterFacade
from the "core-io" package.
-
subdocumentTranscoder
public FragmentTranscoder subdocumentTranscoder()
Description copied from interface:AsyncBucket
Returns the transcoder to be used for individual JSON fragments used and returned by the subdocument API.- Specified by:
subdocumentTranscoder
in interfaceAsyncBucket
- Returns:
- the
FragmentTranscoder
to be used within the subdocument API. - See Also:
AsyncBucket.lookupIn(String)
,AsyncBucket.mutateIn(String)
-
n1qlQueryExecutor
protected N1qlQueryExecutor n1qlQueryExecutor()
Returns the underlyingN1qlQueryExecutor
used to perform N1QL queries. Handle with care since all additional checks that are normally performed by this library may be skipped (hence the protected visibility).
-
environment
public CouchbaseEnvironment environment()
Description copied from interface:AsyncBucket
TheCouchbaseEnvironment
used.- Specified by:
environment
in interfaceAsyncBucket
- Returns:
- the CouchbaseEnvironment.
-
repository
public rx.Observable<AsyncRepository> repository()
Description copied from interface:AsyncBucket
TheRepository
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.- Specified by:
repository
in interfaceAsyncBucket
- Returns:
- the repository for ODM capabilities.
-
get
public rx.Observable<JsonDocument> get(String id)
Description copied from interface:AsyncBucket
Retrieves aJsonDocument
by its unique ID. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
get
in interfaceAsyncBucket
- Parameters:
id
- the unique ID of the document.- Returns:
- an
Observable
eventually containing the foundJsonDocument
.
-
get
public <D extends Document<?>> rx.Observable<D> get(D document)
Description copied from interface:AsyncBucket
Retrieves any type ofDocument
by its unique ID. The document ID is taken out of theDocument
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, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
get
in interfaceAsyncBucket
- Parameters:
document
- the source document from which the ID is taken and the type is inferred.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
get
public <D extends Document<?>> rx.Observable<D> get(String id, Class<D> target)
Description copied from interface:AsyncBucket
Retrieves any type ofDocument
by its unique ID. This method differs fromAsyncBucket.get(String)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
get
in interfaceAsyncBucket
- Parameters:
id
- the unique ID of the document.target
- the target document type to use.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
get
public <D extends Document<?>> rx.Observable<D> get(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieves any type ofDocument
by its unique ID with a custom timeout. This method differs fromAsyncBucket.get(String)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
get
in interfaceAsyncBucket
- Parameters:
id
- the unique ID of the document.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
get
public rx.Observable<JsonDocument> get(String id, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieves aJsonDocument
by its unique ID with a custom timeout. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
get
in interfaceAsyncBucket
- Parameters:
id
- the unique ID of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing the foundJsonDocument
.
-
get
public <D extends Document<?>> rx.Observable<D> get(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieves any type ofDocument
by its unique ID with a custom timeout. The document ID is taken out of theDocument
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, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
get
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
exists
public rx.Observable<Boolean> exists(String id, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Check whether a document with the given ID does exist in the bucket with a custom timeout. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
exists
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- true if it exists, false otherwise.
-
exists
public <D extends Document<?>> rx.Observable<Boolean> exists(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Check whether a document with the given ID does exist in the bucket with a custom timeout. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
exists
in interfaceAsyncBucket
- Parameters:
document
- the document where the ID is extracted from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- true if it exists, false otherwise.
-
exists
public rx.Observable<Boolean> exists(String id)
Description copied from interface:AsyncBucket
Check whether a document with the given ID does exist in the bucket. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
exists
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.- Returns:
- true if it exists, false otherwise.
-
exists
public <D extends Document<?>> rx.Observable<Boolean> exists(D document)
Description copied from interface:AsyncBucket
Check whether a document with the given ID does exist in the bucket. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
exists
in interfaceAsyncBucket
- Parameters:
document
- the document where the ID is extracted from.- Returns:
- true if it exists, false otherwise.
-
getAndLock
public rx.Observable<JsonDocument> getAndLock(String id, int lockTime)
Description copied from interface:AsyncBucket
Retrieve and lock aJsonDocument
by its unique ID. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.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 forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returnedObservable
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 genericCouchbaseException
.- Specified by:
getAndLock
in interfaceAsyncBucket
- Parameters:
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).- Returns:
- an
Observable
eventually containing the foundJsonDocument
.
-
getAndLock
public <D extends Document<?>> rx.Observable<D> getAndLock(D document, int lockTime)
Description copied from interface:AsyncBucket
Retrieve and lock aDocument
by its unique ID. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.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 forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returnedObservable
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 genericCouchbaseException
.- Specified by:
getAndLock
in interfaceAsyncBucket
- Parameters:
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).- Returns:
- an
Observable
eventually containing the foundDocument
.
-
getAndLock
public <D extends Document<?>> rx.Observable<D> getAndLock(String id, int lockTime, Class<D> target)
Description copied from interface:AsyncBucket
Retrieve and lock aDocument
by its unique ID. This method differs fromAsyncBucket.getAndLock(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.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 forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returnedObservable
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 genericCouchbaseException
.- Specified by:
getAndLock
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
getAndTouch
public rx.Observable<JsonDocument> getAndTouch(String id, int expiry)
Description copied from interface:AsyncBucket
Retrieve and touch aJsonDocument
by its unique ID. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.get(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
getAndTouch
in interfaceAsyncBucket
- Parameters:
id
- id the unique ID of the document.expiry
- the new expiration time for the document.- Returns:
- an
Observable
eventually containing the foundJsonDocument
.
-
getAndTouch
public <D extends Document<?>> rx.Observable<D> getAndTouch(D document)
Description copied from interface:AsyncBucket
Retrieve and touch aDocument
by its unique ID. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.get(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
getAndTouch
in interfaceAsyncBucket
- Parameters:
document
- the source document from which the ID and expiry is taken and the type is inferred.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
getAndTouch
public <D extends Document<?>> rx.Observable<D> getAndTouch(String id, int expiry, Class<D> target)
Description copied from interface:AsyncBucket
Retrieve and touch aDocument
by its unique ID. This method differs fromAsyncBucket.getAndTouch(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.get(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
getAndTouch
in interfaceAsyncBucket
- Parameters:
id
- id the unique ID of the document.expiry
- the new expiration time for the document.target
- the target document type to use.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
getFromReplica
public rx.Observable<JsonDocument> getFromReplica(String id, ReplicaMode type)
Description copied from interface:AsyncBucket
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.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 appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
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.- Specified by:
getFromReplica
in interfaceAsyncBucket
- Parameters:
id
- id the unique ID of the document.type
- theReplicaMode
to select.- Returns:
- an
Observable
eventually containing zero to NJsonDocument
s.
-
getFromReplica
public <D extends Document<?>> rx.Observable<D> getFromReplica(D document, ReplicaMode type)
Description copied from interface:AsyncBucket
Retrieves one or more, possibly stale, representations of aDocument
by its unique ID. The document ID is taken out of theDocument
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 theReplicaMode
selected, there can be none to fourDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.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 appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningDocument
responses can come in any order. The returnedObservable
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.- Specified by:
getFromReplica
in interfaceAsyncBucket
- Parameters:
document
- the source document from which the ID is taken and the type is inferred.type
- theReplicaMode
to select.- Returns:
- an
Observable
eventually containing zero to NDocument
s.
-
getFromReplica
public <D extends Document<?>> rx.Observable<D> getFromReplica(String id, ReplicaMode type, Class<D> target)
Description copied from interface:AsyncBucket
Retrieves one or more, possibly stale, representations of aDocument
by its unique ID. This method differs fromAsyncBucket.getFromReplica(String, ReplicaMode)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). Depending on theReplicaMode
selected, there can be none to fourDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.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 appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningDocument
responses can come in any order. The returnedObservable
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.- Specified by:
getFromReplica
in interfaceAsyncBucket
- Parameters:
id
- id the unique ID of the document.type
- theReplicaMode
to select.target
- the target document type to use.- Returns:
- an
Observable
eventually containing zero to NDocument
s.
-
getFromReplica
public rx.Observable<JsonDocument> getFromReplica(String id, ReplicaMode type, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.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 appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
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.- Specified by:
getFromReplica
in interfaceAsyncBucket
- Parameters:
id
- id the unique ID of the document.type
- theReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing zero to NJsonDocument
s.
-
getFromReplica
public <D extends Document<?>> rx.Observable<D> getFromReplica(D document, ReplicaMode type, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieves one or more, possibly stale, representations of aDocument
by its unique ID. The document ID is taken out of theDocument
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 theReplicaMode
selected, there can be none to fourDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.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 appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningDocument
responses can come in any order. The returnedObservable
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.- Specified by:
getFromReplica
in interfaceAsyncBucket
- Parameters:
document
- the source document from which the ID is taken and the type is inferred.type
- theReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing zero to NDocument
s.
-
getFromReplica
public <D extends Document<?>> rx.Observable<D> getFromReplica(String id, ReplicaMode type, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieves one or more, possibly stale, representations of aDocument
by its unique ID. This method differs fromAsyncBucket.getFromReplica(String, ReplicaMode)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). Depending on theReplicaMode
selected, there can be none to fourDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.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 appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningDocument
responses can come in any order. The returnedObservable
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.- Specified by:
getFromReplica
in interfaceAsyncBucket
- Parameters:
id
- id the unique ID of the document.type
- theReplicaMode
to select.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing zero to NDocument
s.
-
getAndLock
public rx.Observable<JsonDocument> getAndLock(String id, int lockTime, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieve and lock aJsonDocument
by its unique ID with a custom timeout. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.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 forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returnedObservable
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 genericCouchbaseException
.- Specified by:
getAndLock
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundJsonDocument
.
-
getAndLock
public <D extends Document<?>> rx.Observable<D> getAndLock(D document, int lockTime, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieve and lock aDocument
by its unique ID with a custom timeout. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.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 forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returnedObservable
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 genericCouchbaseException
.- Specified by:
getAndLock
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
getAndLock
public <D extends Document<?>> rx.Observable<D> getAndLock(String id, int lockTime, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieve and lock aDocument
by its unique ID with a custom timeout. This method differs fromAsyncBucket.getAndLock(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.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 forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returnedObservable
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 genericCouchbaseException
.- Specified by:
getAndLock
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
getAndTouch
public rx.Observable<JsonDocument> getAndTouch(String id, int expiry, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieve and touch aJsonDocument
by its unique ID with a custom timeout. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.get(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
getAndTouch
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundJsonDocument
.
-
getAndTouch
public <D extends Document<?>> rx.Observable<D> getAndTouch(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieve and touch aDocument
by its unique ID with a custom timeout. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.get(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
getAndTouch
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
getAndTouch
public <D extends Document<?>> rx.Observable<D> getAndTouch(String id, int expiry, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Retrieve and touch aDocument
by its unique ID with a custom timeout. This method differs fromAsyncBucket.getAndTouch(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toAsyncBucket.get(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
getAndTouch
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- an
Observable
eventually containing the foundDocument
.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already. If the givenDocument
(identified by its unique ID) already exists, the observable errors with aDocumentAlreadyExistsException
. If the operation should also override the existingDocument
,AsyncBucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,AsyncBucket.insert(Document, PersistTo, ReplicateTo)
should be used instead. The returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
.- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.- Returns:
- an
Observable
eventually containing a newDocument
.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
. If the givenDocument
(identified by its unique ID) already exists, it will be overridden by the current one. The returnedDocument
contains original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document)
method needs to be used. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,AsyncBucket.upsert(Document, PersistTo, ReplicateTo)
should be used instead. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- 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 genericCouchbaseException
.- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
and watch for durability constraints. This method works exactly likeAsyncBucket.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 theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document, PersistTo, ReplicateTo)
method needs to be used. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document)
Description copied from interface:AsyncBucket
Replace aDocument
if it does already exist. If the givenDocument
(identified by its unique ID) does not exist already, the method errors with aDocumentDoesNotExistException
. If the operation should also insert theDocument
,AsyncBucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,AsyncBucket.replace(Document, PersistTo, ReplicateTo)
should be used instead. The returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
.- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.- Returns:
- an
Observable
eventually containing a newDocument
.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already. If the givenDocument
(identified by its unique ID) already exists, the observable errors with aDocumentAlreadyExistsException
. If the operation should also override the existingDocument
,AsyncBucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,AsyncBucket.insert(Document, PersistTo, ReplicateTo)
should be used instead. The returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
.- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
. If the givenDocument
(identified by its unique ID) already exists, it will be overridden by the current one. The returnedDocument
contains original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document)
method needs to be used. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,AsyncBucket.upsert(Document, PersistTo, ReplicateTo)
should be used instead. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- 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 genericCouchbaseException
.- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
and watch for durability constraints. This method works exactly likeAsyncBucket.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 theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document, PersistTo, ReplicateTo)
method needs to be used. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
and watch for durability constraints. This method works exactly likeAsyncBucket.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 theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document, PersistTo)
method needs to be used. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
and watch for durability constraints. This method works exactly likeAsyncBucket.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 theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document, ReplicateTo)
method needs to be used. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Replace aDocument
if it does already exist. If the givenDocument
(identified by its unique ID) does not exist already, the method errors with aDocumentDoesNotExistException
. If the operation should also insert theDocument
,AsyncBucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,AsyncBucket.replace(Document, PersistTo, ReplicateTo)
should be used instead. The returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
.- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Replace aDocument
if it does exist and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Replace aDocument
if it does exist and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Replace aDocument
if it does exist and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Replace aDocument
if it does exist and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- an
Observable
eventually containing a newDocument
.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
document
- the document to remove, with the ID extracted.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server identified by its ID. TheDocument
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 returnedObservable
can error 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 document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, Class<D> target)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server identified by its ID. TheDocument
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 returnedObservable
can error 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 document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.target
- the target document type to use.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
document
- the document to remove, with the ID extracted.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server identified by its ID. TheDocument
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 returnedObservable
can error 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 document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server identified by its ID. TheDocument
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 returnedObservable
can error 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 document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- the document containing the ID.
-
query
public rx.Observable<AsyncViewResult> query(ViewQuery query)
Description copied from interface:AsyncBucket
Queries a Couchbase ServerView
. The returnedObservable
can error 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 design document or view is not found:ViewDoesNotExistException
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the query to perform.- Returns:
- a result containing all the found rows and additional information.
-
query
public rx.Observable<AsyncViewResult> query(ViewQuery query, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Queries a Couchbase ServerView
. The returnedObservable
can error 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 design document or view is not found:ViewDoesNotExistException
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the query to perform.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a result containing all the found rows and additional information.
-
query
public rx.Observable<AsyncSearchQueryResult> query(SearchQuery query)
Description copied from interface:AsyncBucket
Queries a Full-Text Index The returnedObservable
can error 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
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the query builder.- Returns:
- a query result containing the matches and additional information.
-
query
public rx.Observable<AsyncSearchQueryResult> query(SearchQuery query, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Queries a Full-Text Index The returnedObservable
can error 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
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the query builder.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a query result containing the matches and additional information.
-
query
public rx.Observable<AsyncSpatialViewResult> query(SpatialViewQuery query)
Description copied from interface:AsyncBucket
Queries a Couchbase Server SpatialView
. The returnedObservable
can error 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 design document or view is not found:ViewDoesNotExistException
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the spatial query to perform.- Returns:
- a result containing all the found rows and additional information.
-
query
public rx.Observable<AsyncSpatialViewResult> query(SpatialViewQuery query, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Queries a Couchbase Server SpatialView
. The returnedObservable
can error 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 design document or view is not found:ViewDoesNotExistException
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the spatial query to perform.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a result containing all the found rows and additional information.
-
query
public rx.Observable<AsyncN1qlQueryResult> query(Statement statement)
Description copied from interface:AsyncBucket
Queries a N1QL secondary index with a simpleStatement
. The returnedObservable
can error 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
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
statement
- the statement in a DSL form (start with a static select() import).- Returns:
- a result containing all found rows and additional information.
-
query
public rx.Observable<AsyncN1qlQueryResult> query(N1qlQuery query)
Description copied from interface:AsyncBucket
Queries a N1QL secondary index. The returnedObservable
can error 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
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the fullN1qlQuery
.- Returns:
- a result containing all found rows and additional information.
-
query
public rx.Observable<AsyncN1qlQueryResult> query(N1qlQuery query, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Queries a N1QL secondary index with a custom timeout. The returnedObservable
can error 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
- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the fullN1qlQuery
.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a result containing all found rows and additional information.
-
query
public rx.Observable<AsyncAnalyticsQueryResult> query(AnalyticsQuery query)
Description copied from interface:AsyncBucket
Queries Couchbase Analytics- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the query builder.- Returns:
- a query result containing the rows and additional information.
-
query
public rx.Observable<AsyncAnalyticsQueryResult> query(AnalyticsQuery query, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Queries Couchbase Analytics- Specified by:
query
in interfaceAsyncBucket
- Parameters:
query
- the query builder.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a query result containing the rows and additional information.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Increment or decrement a counter with the given value or throw an exception if it does not exist yet. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
.- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
unlock
public rx.Observable<Boolean> unlock(String id, long cas, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Unlocks a write-lockedDocument
. The returnedObservable
can error under the following conditions: - A transient error happened, most likely the CAS value was not correct: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 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 genericCouchbaseException
.- Specified by:
unlock
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a Boolean indicating if the unlock was successful or not.
-
unlock
public <D extends Document<?>> rx.Observable<Boolean> unlock(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Unlocks a write-lockedDocument
. The returnedObservable
can error under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- A transient error happened, most likely the CAS value was not correct: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 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 genericCouchbaseException
.- Specified by:
unlock
in interfaceAsyncBucket
- Parameters:
document
- the document where ID and CAS are extracted from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a Boolean indicating if the unlock was successful. (note that unsuccessful touch will rather raise an exception)
-
unlock
public rx.Observable<Boolean> unlock(String id, long cas)
Description copied from interface:AsyncBucket
Unlocks a write-lockedDocument
. The returnedObservable
can error under the following conditions: - A transient error happened, most likely the CAS value was not correct: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 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 genericCouchbaseException
.- Specified by:
unlock
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to unlock.cas
- the CAS value which is mandatory to unlock it.- Returns:
- a Boolean indicating if the unlock was successful or not.
-
unlock
public <D extends Document<?>> rx.Observable<Boolean> unlock(D document)
Description copied from interface:AsyncBucket
Unlocks a write-lockedDocument
. The returnedObservable
can error under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- A transient error happened, most likely the CAS value was not correct: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 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 genericCouchbaseException
.- Specified by:
unlock
in interfaceAsyncBucket
- Parameters:
document
- the document where ID and CAS are extracted from.- Returns:
- a Boolean indicating if the unlock was successful. (note that unsuccessful touch will rather raise an exception)
-
touch
public rx.Observable<Boolean> touch(String id, int expiry, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Renews the expiration time of aDocument
. Compared toAsyncBucket.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 returnedObservable
can error under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- 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 genericCouchbaseException
.- Specified by:
touch
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a Boolean indicating if the touch had been successful. (note that unsuccessful touch will rather raise an exception)
-
touch
public <D extends Document<?>> rx.Observable<Boolean> touch(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Renews the expiration time of aDocument
. Compared toAsyncBucket.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 returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
touch
in interfaceAsyncBucket
- Parameters:
document
- the document to extract the ID and expiry from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a copy of the document inserted.
-
touch
public rx.Observable<Boolean> touch(String id, int expiry)
Description copied from interface:AsyncBucket
Renews the expiration time of aDocument
. Compared toAsyncBucket.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 returnedObservable
can error under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- 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 genericCouchbaseException
.- Specified by:
touch
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.expiry
- the new expiration time. 0 means no expiry.- Returns:
- a Boolean indicating if the touch had been successful. (note that unsuccessful touch will rather raise an exception)
-
touch
public <D extends Document<?>> rx.Observable<Boolean> touch(D document)
Description copied from interface:AsyncBucket
Renews the expiration time of aDocument
. Compared toAsyncBucket.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 returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
touch
in interfaceAsyncBucket
- Parameters:
document
- the document to extract the ID and expiry from.- Returns:
- a copy of the document inserted.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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 genericCouchbaseException
.- Specified by:
append
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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 genericCouchbaseException
.- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
bucketManager
public rx.Observable<AsyncBucketManager> bucketManager()
Description copied from interface:AsyncBucket
Provides access to theAsyncBucketManager
for administrative access. The manager lets you perform operations such as flushing a bucket or creating and managing design documents.- Specified by:
bucketManager
in interfaceAsyncBucket
- Returns:
- the bucket manager for administrative operations.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document, PersistTo persistTo)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.persistTo
- the persistence constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
insert
public <D extends Document<?>> rx.Observable<D> insert(D document, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Insert aDocument
if it does not exist already and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
insert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to insert.replicateTo
- the replication constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document, PersistTo persistTo)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
and watch for durability constraints. This method works exactly likeAsyncBucket.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 theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document, PersistTo)
method needs to be used. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.persistTo
- the persistence constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
upsert
public <D extends Document<?>> rx.Observable<D> upsert(D document, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Insert or overwrite aDocument
and watch for durability constraints. This method works exactly likeAsyncBucket.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 theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, theAsyncBucket.replace(Document, ReplicateTo)
method needs to be used. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
upsert
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to upsert.replicateTo
- the replication constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document, PersistTo persistTo)
Description copied from interface:AsyncBucket
Replace aDocument
if it does exist and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.persistTo
- the persistence constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
replace
public <D extends Document<?>> rx.Observable<D> replace(D document, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Replace aDocument
if it does exist and watch for durability constraints. This method works exactly likeAsyncBucket.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 returnedObservable
can error 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 original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- 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 genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
replace
in interfaceAsyncBucket
- Parameters:
document
- theDocument
to replace.replicateTo
- the replication constraint to watch.- Returns:
- an
Observable
eventually containing a newDocument
.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document, PersistTo persistTo)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(D document, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove does not exist:DocumentDoesNotExistException
- A CAS value was set on theDocument
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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
document
- the document to remove, with the ID extracted.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id, PersistTo persistTo)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.- Returns:
- the document containing the ID.
-
remove
public rx.Observable<JsonDocument> remove(String id, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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 document to remove does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, PersistTo persistTo, Class<D> target)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.target
- the target document type to use.- Returns:
- the document containing the ID.
-
remove
public <D extends Document<?>> rx.Observable<D> remove(String id, ReplicateTo replicateTo, Class<D> target)
Description copied from interface:AsyncBucket
Removes aDocument
from the Server by its ID and apply a durability requirement. TheDocument
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 returnedObservable
can error 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
. - The document to remove 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 genericCouchbaseException
.- Specified by:
remove
in interfaceAsyncBucket
- Parameters:
id
- the id of the document to remove.replicateTo
- the replication constraint to watch.target
- the target document type to use.- Returns:
- the document containing the ID.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta)
Description copied from interface:AsyncBucket
Increment or decrement a counter with the given value or throw an exception if it does not exist yet. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
.- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 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 genericCouchbaseException
.- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
counter
public rx.Observable<JsonLongDocument> counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
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 initial value for the counter can be set by passing the initial value in {@link #counter)} or usingAsyncBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingAsyncBucket.upsert(D)
withJsonLongDocument
. The returnedObservable
can error 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 server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
counter
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a
Document
containing the resulting value.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
append
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
append
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
append
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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 genericCouchbaseException
.- Specified by:
append
in interfaceAsyncBucket
- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
append
in interfaceAsyncBucket
- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
append
in interfaceAsyncBucket
- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.replicateTo
- the replication constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
public <D extends Document<?>> rx.Observable<D> append(D document, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Append aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
append
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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 genericCouchbaseException
.- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.replicateTo
- the replication constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
public <D extends Document<?>> rx.Observable<D> prepend(D document, PersistTo persistTo, ReplicateTo replicateTo)
Description copied from interface:AsyncBucket
Prepend aDocument
s content to an existing one. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateAsyncBucket.get(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. The returnedObservable
can error 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 request content is too big:RequestTooBigException
- If the 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
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
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 andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. 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.**- Specified by:
prepend
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a document which mirrors the one supplied as an argument.
-
lookupIn
public AsyncLookupInBuilder lookupIn(String docId)
Description copied from interface:AsyncBucket
Prepare a sub-document lookup through abuilder API
. You can use the builder to describe one or several lookup operations inside an existingJsonDocument
, then execute the lookup asynchronously by calling theAsyncLookupInBuilder.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.- Specified by:
lookupIn
in interfaceAsyncBucket
- Parameters:
docId
- the id of the JSON document to lookup in.- Returns:
- a builder to describe the lookup(s) to perform.
- See Also:
AsyncLookupInBuilder.execute()
-
mutateIn
public AsyncMutateInBuilder mutateIn(String docId)
Description copied from interface:AsyncBucket
Prepare a sub-document mutation through abuilder API
. You can use the builder to describe one or several mutation operations inside an existingJsonDocument
, then execute them asynchronously by calling theAsyncMutateInBuilder.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
.- Specified by:
mutateIn
in interfaceAsyncBucket
- Parameters:
docId
- the id of the JSON document to mutate in.- Returns:
- a builder to describe the mutation(s) to perform.
- See Also:
AsyncMutateInBuilder.execute()
-
mapGet
public <V> rx.Observable<V> mapGet(String docId, String key, Class<V> valueType)
Description copied from interface:AsyncBucket
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 mapPathNotFoundException
- 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 genericCouchbaseException
.- Specified by:
mapGet
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the mapkey
- key in the mapvalueType
- value type class- Returns:
- value if found
-
mapAdd
public <V> rx.Observable<Boolean> mapAdd(String docId, String key, V value)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
mapAdd
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the mapkey
- key to be storedvalue
- value to be stored- Returns:
- true if successful
-
mapAdd
public <V> rx.Observable<Boolean> mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Add a key value pair into CouchbaseMap with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
mapAdd
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the mapkey
- key to be storedvalue
- value to be storedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
mapRemove
public rx.Observable<Boolean> mapRemove(String docId, String key)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
mapRemove
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the mapkey
- key to be removed- Returns:
- true if successful, even if the key doesn't exist
-
mapRemove
public rx.Observable<Boolean> mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Remove a key value pair from CouchbaseMap with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
mapRemove
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the mapkey
- key to be removed- Returns:
- true if successful, even if the key doesn't exist
-
mapSize
public rx.Observable<Integer> mapSize(String docId)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
mapSize
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the map- Returns:
- number of key value pairs
-
listGet
public <E> rx.Observable<E> listGet(String docId, int index, Class<E> elementType)
Description copied from interface:AsyncBucket
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 listPathNotFoundException
- 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 genericCouchbaseException
.- Specified by:
listGet
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listindex
- index in listelementType
- element type class- Returns:
- value if found
-
listAppend
public <E> rx.Observable<Boolean> listAppend(String docId, E element)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
listAppend
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queue- Returns:
- true if successful
-
listAppend
public <E> rx.Observable<Boolean> listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Push an element to tail of CouchbaseList with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
listAppend
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listRemove
public rx.Observable<Boolean> listRemove(String docId, int index)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
listRemove
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listindex
- index of the element in list- Returns:
- true if successful
-
listRemove
public rx.Observable<Boolean> listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Remove an element from an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
listRemove
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listindex
- index of the element in listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listSet
public <E> rx.Observable<Boolean> listSet(String docId, int index, E element)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
listSet
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listindex
- index in the listelement
- element to be added- Returns:
- true if successful
-
listSet
public <E> rx.Observable<Boolean> listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Add an element at an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
. 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 genericCouchbaseException
.- Specified by:
listSet
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listindex
- index in the listelement
- element to be addedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listPrepend
public <E> rx.Observable<Boolean> listPrepend(String docId, E element)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
listPrepend
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listelement
- element to shift as head of list- Returns:
- true if successful
-
listPrepend
public <E> rx.Observable<Boolean> listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Shift list head to element in CouchbaseList with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
listPrepend
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the listelement
- element to shift as head of listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listSize
public rx.Observable<Integer> listSize(String docId)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
listSize
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the list- Returns:
- number of elements
-
setAdd
public <E> rx.Observable<Boolean> setAdd(String docId, E element)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
setAdd
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the setelement
- element to be pushed into the set- Returns:
- true if successful, false if the element exists in set
-
setAdd
public <E> rx.Observable<Boolean> setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Add an element into CouchbaseSet with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
setAdd
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the setelement
- element to be pushed into the setmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful, false if the element exists in set
-
setContains
public <E> rx.Observable<Boolean> setContains(String docId, E element)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
setContains
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the setelement
- element to check for existence- Returns:
- true if element exists, false if the element does not exist
-
setRemove
public <E> rx.Observable<E> setRemove(String docId, E element)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
setRemove
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the setelement
- element to be removed- Returns:
- element removed from set (fails silently by returning the element is not found in set)
-
setRemove
public <E> rx.Observable<E> setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Removes an element from CouchbaseSet with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
setRemove
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the setelement
- element to be removedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- element removed from set (fails silently by returning the element is not found in set)
-
setSize
public rx.Observable<Integer> setSize(String docId)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
setSize
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the set- Returns:
- number of elements in set
-
queuePush
public <E> rx.Observable<Boolean> queuePush(String docId, E element)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
queuePush
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the queueelement
- element to be pushed into the queue- Returns:
- true if successful
-
queuePush
public <E> rx.Observable<Boolean> queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Add an element into CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
queuePush
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the queueelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
queuePop
public <E> rx.Observable<E> queuePop(String docId, Class<E> elementType)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
queuePop
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the queueelementType
- element type class- Returns:
- element removed from queue
-
queuePop
public <E> rx.Observable<E> queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder)
Description copied from interface:AsyncBucket
Removes the first element from CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
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 genericCouchbaseException
.- Specified by:
queuePop
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the queueelementType
- element type class- Returns:
- element removed from queue
-
queueSize
public rx.Observable<Integer> queueSize(String docId)
Description copied from interface:AsyncBucket
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 genericCouchbaseException
.- Specified by:
queueSize
in interfaceAsyncBucket
- Parameters:
docId
- document id backing the queue- Returns:
- number of elements
-
close
public rx.Observable<Boolean> close()
Description copied from interface:AsyncBucket
Closes theAsyncBucket
.- Specified by:
close
in interfaceAsyncBucket
- Returns:
- an
Observable
eventually containing a newBoolean
after close.
-
isClosed
public boolean isClosed()
Description copied from interface:AsyncBucket
Returns true if this bucket is already closed, false if it is still open.- Specified by:
isClosed
in interfaceAsyncBucket
- Returns:
- true if closed, false otherwise.
-
invalidateQueryCache
public rx.Observable<Integer> invalidateQueryCache()
Description copied from interface:AsyncBucket
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 returnedObservable
will not error out under any conditions.- Specified by:
invalidateQueryCache
in interfaceAsyncBucket
- Returns:
- the number of entries in the cache before it was cleared out.
-
ping
public rx.Single<PingReport> ping(String reportId, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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).- Specified by:
ping
in interfaceAsyncBucket
- Parameters:
reportId
- the report ID to use in the report.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.- Returns:
- a ping report once created.
-
ping
public rx.Single<PingReport> ping(long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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).- Specified by:
ping
in interfaceAsyncBucket
- Parameters:
timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.- Returns:
- a ping report once created.
-
ping
public rx.Single<PingReport> ping(Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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).- Specified by:
ping
in interfaceAsyncBucket
- Parameters:
services
- collection of services which should be included.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.- Returns:
- a ping report once created.
-
ping
public rx.Single<PingReport> ping(String reportId, Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Description copied from interface:AsyncBucket
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).- Specified by:
ping
in interfaceAsyncBucket
- Parameters:
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.- Returns:
- a ping report once created.
-
-