Constructor and Description |
---|
CouchbaseBucket(CouchbaseEnvironment env,
com.couchbase.client.core.ClusterFacade core,
java.lang.String name,
java.lang.String password,
java.util.List<Transcoder<? extends Document,?>> customTranscoders) |
Modifier and Type | Method and Description |
---|---|
<D extends Document<?>> |
append(D document)
Append a
Document to another one with the default key/value timeout. |
<D extends Document<?>> |
append(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Append a
Document to another one with a custom timeout. |
AsyncBucket |
async()
Provides access to the underlying asynchronous bucket interface.
|
BucketManager |
bucketManager()
Provides access to the
BucketManager for administrative access. |
java.lang.Boolean |
close()
Closes this bucket with the default disconnect timeout.
|
java.lang.Boolean |
close(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Closes this bucket with a custom timeout.
|
JsonLongDocument |
counter(java.lang.String id,
long delta)
Increment or decrement a counter with the given value and a default value of 0 with the default key/value timeout.
|
JsonLongDocument |
counter(java.lang.String id,
long delta,
long initial)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.
|
JsonLongDocument |
counter(java.lang.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 with the default key/value timeout.
|
JsonLongDocument |
counter(java.lang.String id,
long delta,
long initial,
int expiry,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.
|
JsonLongDocument |
counter(java.lang.String id,
long delta,
long initial,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.
|
JsonLongDocument |
counter(java.lang.String id,
long delta,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Increment or decrement a counter with the given value and a default value of 0 with a custom timeout.
|
<D extends Document<?>> |
get(D document)
Retrieves any type of
Document with the default key/value timeout. |
<D extends Document<?>> |
get(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieves any type of
Document with a custom timeout. |
JsonDocument |
get(java.lang.String id)
Retrieves a
JsonDocument by its unique ID with the default key/value timeout. |
<D extends Document<?>> |
get(java.lang.String id,
java.lang.Class<D> target)
Retrieves any type of
Document by its ID with the default key/value timeout. |
<D extends Document<?>> |
get(java.lang.String id,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieves any type of
Document by its ID with a custom timeout. |
JsonDocument |
get(java.lang.String id,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieves a
JsonDocument by its unique ID with a custom timeout. |
<D extends Document<?>> |
getAndLock(D document,
int lockTime)
Retrieve and lock a
Document by its unique ID with the default key/value timeout. |
<D extends Document<?>> |
getAndLock(D document,
int lockTime,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieve and lock a
Document by its unique ID with a custom timeout. |
JsonDocument |
getAndLock(java.lang.String id,
int lockTime)
Retrieve and lock a
JsonDocument by its unique ID with the default key/value timeout. |
<D extends Document<?>> |
getAndLock(java.lang.String id,
int lockTime,
java.lang.Class<D> target)
Retrieve and lock a
Document by its unique ID with the default key/value timeout. |
<D extends Document<?>> |
getAndLock(java.lang.String id,
int lockTime,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieve and lock a
Document by its unique ID with the a custom timeout. |
JsonDocument |
getAndLock(java.lang.String id,
int lockTime,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieve and lock a
JsonDocument by its unique ID with a custom timeout. |
<D extends Document<?>> |
getAndTouch(D document)
Retrieve and touch a
Document by its unique ID with the default key/value timeout. |
<D extends Document<?>> |
getAndTouch(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieve and touch a
Document by its unique ID with a custom timeout. |
JsonDocument |
getAndTouch(java.lang.String id,
int expiry)
Retrieve and touch a
JsonDocument by its unique ID with the default key/value timeout. |
<D extends Document<?>> |
getAndTouch(java.lang.String id,
int expiry,
java.lang.Class<D> target)
Retrieve and touch a
Document by its unique ID with the default key/value timeout. |
<D extends Document<?>> |
getAndTouch(java.lang.String id,
int expiry,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieve and touch a
Document by its unique ID with a custom timeout. |
JsonDocument |
getAndTouch(java.lang.String id,
int expiry,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieve and touch a
JsonDocument by its unique ID with the a custom timeout. |
<D extends Document<?>> |
getFromReplica(D document,
ReplicaMode type)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID with the default timeout. |
<D extends Document<?>> |
getFromReplica(D document,
ReplicaMode type,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID with a custom timeout. |
java.util.List<JsonDocument> |
getFromReplica(java.lang.String id,
ReplicaMode type)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID with the default timeout. |
<D extends Document<?>> |
getFromReplica(java.lang.String id,
ReplicaMode type,
java.lang.Class<D> target)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID with the default timeout. |
<D extends Document<?>> |
getFromReplica(java.lang.String id,
ReplicaMode type,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID with a custom timeout. |
java.util.List<JsonDocument> |
getFromReplica(java.lang.String id,
ReplicaMode type,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of a
JsonDocument by its unique ID with a custom timeout. |
<D extends Document<?>> |
insert(D document)
Insert a
Document if it does not exist already with the default key/value timeout. |
<D extends Document<?>> |
insert(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert a
Document if it does not exist already with a custom timeout. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo)
Insert a
Document if it does not exist already and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert a
Document if it does not exist already and watch for durability constraints with a custom timeout. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Insert a
Document if it does not exist already and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
insert(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert a
Document if it does not exist already and watch for durability constraints with a custom timeout. |
<D extends Document<?>> |
insert(D document,
ReplicateTo replicateTo)
Insert a
Document if it does not exist already and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
insert(D document,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert a
Document if it does not exist already and watch for durability constraints with a custom timeout. |
java.lang.String |
name()
The name of the
Bucket . |
<D extends Document<?>> |
prepend(D document)
Prepend a
Document to another one with the default key/value timeout. |
<D extends Document<?>> |
prepend(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Prepend a
Document to another one with a custom timeout. |
QueryResult |
query(Query query)
Experimental: Queries a N1QL secondary index with the default query timeout.
|
QueryResult |
query(Query query,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Experimental: Queries a N1QL secondary index with a custom timeout.
|
QueryResult |
query(java.lang.String query)
Experimental: Queries a N1QL secondary index with the default query timeout.
|
QueryResult |
query(java.lang.String query,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Experimental: Queries a N1QL secondary index with a custom timeout.
|
ViewResult |
query(ViewQuery query)
Queries a Couchbase Server
View with the default view timeout. |
ViewResult |
query(ViewQuery query,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Queries a Couchbase Server
View with a custom timeout. |
<D extends Document<?>> |
remove(D document)
Removes a
Document from the Server with the default key/value timeout. |
<D extends Document<?>> |
remove(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server with a custom timeout. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo)
Removes a
Document from the Server and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server and apply a durability requirement with a custom timeout. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Removes a
Document from the Server and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server and apply a durability requirement with a custom timeout. |
<D extends Document<?>> |
remove(D document,
ReplicateTo replicateTo)
Removes a
Document from the Server and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(D document,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server and apply a durability requirement with a custom timeout. |
JsonDocument |
remove(java.lang.String id)
Removes a
Document from the Server identified by its ID with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
java.lang.Class<D> target)
Removes a
Document from the Server identified by its ID with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server identified by its ID with a custom timeout. |
JsonDocument |
remove(java.lang.String id,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server identified by its ID with a custom timeout. |
JsonDocument |
remove(java.lang.String id,
PersistTo persistTo)
Removes a
Document from the Server by its ID and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
PersistTo persistTo,
java.lang.Class<D> target)
Removes a
Document from the Server by its ID and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
PersistTo persistTo,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement with a custom timeout. |
JsonDocument |
remove(java.lang.String id,
PersistTo persistTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement with a custom timeout. |
JsonDocument |
remove(java.lang.String id,
PersistTo persistTo,
ReplicateTo replicateTo)
Removes a
Document from the Server by its ID and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
PersistTo persistTo,
ReplicateTo replicateTo,
java.lang.Class<D> target)
Removes a
Document from the Server by its ID and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
PersistTo persistTo,
ReplicateTo replicateTo,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement with a custom timeout. |
JsonDocument |
remove(java.lang.String id,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement with a custom timeout. |
JsonDocument |
remove(java.lang.String id,
ReplicateTo replicateTo)
Removes a
Document from the Server by its ID and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
ReplicateTo replicateTo,
java.lang.Class<D> target)
Removes a
Document from the Server by its ID and apply a durability requirement with the default key/value timeout. |
<D extends Document<?>> |
remove(java.lang.String id,
ReplicateTo replicateTo,
java.lang.Class<D> target,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement with a custom timeout. |
JsonDocument |
remove(java.lang.String id,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Document from the Server by its ID and apply a durability requirement with a custom timeout. |
<D extends Document<?>> |
replace(D document)
Replace a
Document if it does already exist with the default key/value timeout. |
<D extends Document<?>> |
replace(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Replace a
Document if it does already exist with a custom timeout. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo)
Replace a
Document if it does exist and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Replace a
Document if it does exist and watch for durability constraints with a custom timeout. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Replace a
Document if it does exist and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
replace(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Replace a
Document if it does exist and watch for durability constraints with a custom timeout. |
<D extends Document<?>> |
replace(D document,
ReplicateTo replicateTo)
Replace a
Document if it does exist and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
replace(D document,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Replace a
Document if it does exist and watch for durability constraints with a custom timeout. |
<D extends Document<?>> |
touch(D document)
Renews the expiration time of a
Document with the default key/value timeout. |
<D extends Document<?>> |
touch(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Renews the expiration time of a
Document with a custom timeout. |
java.lang.Boolean |
touch(java.lang.String id,
int expiry)
Renews the expiration time of a
Document with the default key/value timeout. |
java.lang.Boolean |
touch(java.lang.String id,
int expiry,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Renews the expiration time of a
Document with a custom timeout. |
<D extends Document<?>> |
unlock(D document)
Unlocks a write-locked
Document with the default key/value timeout. |
<D extends Document<?>> |
unlock(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Unlocks a write-locked
Document with a custom timeout. |
java.lang.Boolean |
unlock(java.lang.String id,
long cas)
Unlocks a write-locked
Document with the default key/value timeout. |
java.lang.Boolean |
unlock(java.lang.String id,
long cas,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Unlocks a write-locked
Document with a custom timeout. |
<D extends Document<?>> |
upsert(D document)
Insert or replace a
Document with the default key/value timeout. |
<D extends Document<?>> |
upsert(D document,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert or replace a
Document with a custom timeout. |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo)
Insert or replace a
Document and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert or replace a
Document and watch for durability constraints with a custom timeout. |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo,
ReplicateTo replicateTo)
Insert or replace a
Document and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
upsert(D document,
PersistTo persistTo,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert or replace a
Document and watch for durability constraints with a custom timeout. |
<D extends Document<?>> |
upsert(D document,
ReplicateTo replicateTo)
Insert or replace a
Document and watch for durability constraints with the default key/value timeout. |
<D extends Document<?>> |
upsert(D document,
ReplicateTo replicateTo,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Insert or replace a
Document and watch for durability constraints with a custom timeout. |
public CouchbaseBucket(CouchbaseEnvironment env, com.couchbase.client.core.ClusterFacade core, java.lang.String name, java.lang.String password, java.util.List<Transcoder<? extends Document,?>> customTranscoders)
public AsyncBucket async()
Bucket
Provides access to the underlying asynchronous bucket interface.
public java.lang.String name()
Bucket
The name of the Bucket
.
public JsonDocument get(java.lang.String id)
Bucket
Retrieves a JsonDocument
by its unique ID with the default key/value timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, null is returned.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
get
in interface Bucket
id
- the unique ID of the document.JsonDocument
or null if not found.public JsonDocument get(java.lang.String id, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieves a JsonDocument
by its unique ID with a custom timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, null is returned.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
get
in interface Bucket
id
- the unique ID of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.JsonDocument
or null if not found.public <D extends Document<?>> D get(D document)
Bucket
Retrieves any type of Document
with the default key/value timeout.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D get(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieves any type of Document
with a custom timeout.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D get(java.lang.String id, java.lang.Class<D> target)
Bucket
Retrieves any type of Document
by its ID with the default key/value timeout.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D get(java.lang.String id, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieves any type of Document
by its ID with a custom timeout.
The document ID is taken out of the Document
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public java.util.List<JsonDocument> getFromReplica(java.lang.String id, ReplicaMode type)
Bucket
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID with the default timeout.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getFromReplica
in interface Bucket
id
- id the unique ID of the document.type
- the ReplicaMode
to select.JsonDocument
s.public java.util.List<JsonDocument> getFromReplica(java.lang.String id, ReplicaMode type, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID with a custom timeout.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getFromReplica
in interface Bucket
id
- id the unique ID of the document.type
- the ReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.JsonDocument
s.public <D extends Document<?>> java.util.List<D> getFromReplica(D document, ReplicaMode type)
Bucket
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID with the default timeout.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getFromReplica
in interface Bucket
document
- the document to extract the ID from.type
- the ReplicaMode
to select.JsonDocument
s.public <D extends Document<?>> java.util.List<D> getFromReplica(D document, ReplicaMode type, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID with a custom timeout.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getFromReplica
in interface Bucket
document
- the document to extract the ID from.type
- the ReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.JsonDocument
s.public <D extends Document<?>> java.util.List<D> getFromReplica(java.lang.String id, ReplicaMode type, java.lang.Class<D> target)
Bucket
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID with the default timeout.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getFromReplica
in interface Bucket
id
- the id of the document.type
- the ReplicaMode
to select.JsonDocument
s.public <D extends Document<?>> java.util.List<D> getFromReplica(java.lang.String id, ReplicaMode type, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieves one or more, possibly stale, representations of a JsonDocument
by its unique ID with a custom timeout.
Depending on the ReplicaMode
selected, there can be none to four JsonDocument
be returned from the Observable
. If ReplicaMode.FIRST
, ReplicaMode.SECOND
or ReplicaMode.THIRD
are selected zero or one documents are returned, if ReplicaMode.ALL
is used, all configured replicas plus the master node may return a document.
If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes.
Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.
Note that the returning JsonDocument
responses can come in any order.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getFromReplica
in interface Bucket
id
- the id of the document.type
- the ReplicaMode
to select.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.JsonDocument
s.public JsonDocument getAndLock(java.lang.String id, int lockTime)
Bucket
Retrieve and lock a JsonDocument
by its unique ID with the default key/value timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndLock
in interface Bucket
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).JsonDocument
or null.public JsonDocument getAndLock(java.lang.String id, int lockTime, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieve and lock a JsonDocument
by its unique ID with a custom timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndLock
in interface Bucket
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.JsonDocument
or null.public <D extends Document<?>> D getAndLock(D document, int lockTime)
Bucket
Retrieve and lock a Document
by its unique ID with the default key/value timeout.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndLock
in interface Bucket
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).Document
or null.public <D extends Document<?>> D getAndLock(D document, int lockTime, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieve and lock a Document
by its unique ID with a custom timeout.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndLock
in interface Bucket
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.Document
or null.public <D extends Document<?>> D getAndLock(java.lang.String id, int lockTime, java.lang.Class<D> target)
Bucket
Retrieve and lock a Document
by its unique ID with the default key/value timeout.
This method differs from Bucket.getAndLock(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndLock
in interface Bucket
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.Document
or null.public <D extends Document<?>> D getAndLock(java.lang.String id, int lockTime, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieve and lock a Document
by its unique ID with the a custom timeout.
This method differs from Bucket.getAndLock(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndLock
in interface Bucket
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.Document
or null.public JsonDocument getAndTouch(java.lang.String id, int expiry)
Bucket
Retrieve and touch a JsonDocument
by its unique ID with the default key/value timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.get(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndTouch
in interface Bucket
id
- id the unique ID of the document.expiry
- the new expiration time for the document.JsonDocument
or null.public JsonDocument getAndTouch(java.lang.String id, int expiry, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieve and touch a JsonDocument
by its unique ID with the a custom timeout.
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.get(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndTouch
in interface Bucket
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.JsonDocument
or null.public <D extends Document<?>> D getAndTouch(D document)
Bucket
Retrieve and touch a Document
by its unique ID with the default key/value timeout.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.get(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndTouch
in interface Bucket
document
- the source document from which the ID and expiry is taken and the type is inferred.Document
or null.public <D extends Document<?>> D getAndTouch(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieve and touch a Document
by its unique ID with a custom timeout.
If the document is found, a Document
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.get(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndTouch
in interface Bucket
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.Document
or null.public <D extends Document<?>> D getAndTouch(java.lang.String id, int expiry, java.lang.Class<D> target)
Bucket
Retrieve and touch a Document
by its unique ID with the default key/value timeout.
This method differs from Bucket.getAndTouch(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.get(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndTouch
in interface Bucket
id
- id the unique ID of the document.expiry
- the new expiration time for the document.target
- the target document type to use.Document
or null.public <D extends Document<?>> D getAndTouch(java.lang.String id, int expiry, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Retrieve and touch a Document
by its unique ID with a custom timeout.
This method differs from Bucket.getAndTouch(String, int)
in that if a specific Document
type is passed in, the appropriate Transcoder
will be selected (and not JSON conversion).
If the document is found, a JsonDocument
is returned. If the document is not found, the Observable
completes without an item emitted.
This method works similar to Bucket.get(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
getAndTouch
in interface Bucket
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.Document
or null.public <D extends Document<?>> D insert(D document)
Bucket
Insert a Document
if it does not exist already with the default key/value timeout.
If the given Document
(identified by its unique ID) already exists, the observable errors with a DocumentAlreadyExistsException
. If the operation should also override the existing Document
, Bucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, Bucket.insert(Document, PersistTo, ReplicateTo)
should be used instead.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D insert(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert a Document
if it does not exist already with a custom timeout.
If the given Document
(identified by its unique ID) already exists, the observable errors with a DocumentAlreadyExistsException
. If the operation should also override the existing Document
, Bucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, Bucket.insert(Document, PersistTo, ReplicateTo)
should be used instead.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D insert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Bucket
Insert a Document
if it does not exist already and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D insert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert a Document
if it does not exist already and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D insert(D document, PersistTo persistTo)
Bucket
Insert a Document
if it does not exist already and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D insert(D document, PersistTo persistTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert a Document
if it does not exist already and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D insert(D document, ReplicateTo replicateTo)
Bucket
Insert a Document
if it does not exist already and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D insert(D document, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert a Document
if it does not exist already and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentAlreadyExistsException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D upsert(D document)
Bucket
Insert or replace a Document
with the default key/value timeout.
If the given Document
(identified by its unique ID) already exists, it will be overridden by the current one. The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, Bucket.upsert(Document, PersistTo, ReplicateTo)
should be used instead.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D upsert(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert or replace a Document
with a custom timeout.
If the given Document
(identified by its unique ID) already exists, it will be overridden by the current one. The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, Bucket.upsert(Document, PersistTo, ReplicateTo)
should be used instead.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D upsert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Bucket
Insert or replace a Document
and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D upsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert or replace a Document
and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D upsert(D document, PersistTo persistTo)
Bucket
Insert or replace a Document
and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D upsert(D document, PersistTo persistTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert or replace a Document
and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D upsert(D document, ReplicateTo replicateTo)
Bucket
Insert or replace a Document
and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D upsert(D document, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Insert or replace a Document
and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D replace(D document)
Bucket
Replace a Document
if it does already exist with the default key/value timeout.
If the given Document
(identified by its unique ID) does not exist already, the method errors with a DocumentDoesNotExistException
. If the operation should also insert the Document
, Bucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, Bucket.replace(Document, PersistTo, ReplicateTo)
should be used instead.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
CASMismatchException
public <D extends Document<?>> D replace(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Replace a Document
if it does already exist with a custom timeout.
If the given Document
(identified by its unique ID) does not exist already, the method errors with a DocumentDoesNotExistException
. If the operation should also insert the Document
, Bucket.upsert(Document)
should be used instead. It will always either return a document or fail with an error.
The returned Document
contains original properties, but has the refreshed CAS value set.
This operation will return successfully if the Document
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern, Bucket.replace(Document, PersistTo, ReplicateTo)
should be used instead.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
CASMismatchException
public <D extends Document<?>> D replace(D document, PersistTo persistTo, ReplicateTo replicateTo)
Bucket
Replace a Document
if it does exist and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.CASMismatchException
A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D replace(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Replace a Document
if it does exist and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.CASMismatchException
A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D replace(D document, PersistTo persistTo)
Bucket
Replace a Document
if it does exist and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.CASMismatchException
A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D replace(D document, PersistTo persistTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Replace a Document
if it does exist and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.CASMismatchException
A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D replace(D document, ReplicateTo replicateTo)
Bucket
Replace a Document
if it does exist and watch for durability constraints with the default key/value timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.CASMismatchException
A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D replace(D document, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Replace a Document
if it does exist and watch for durability constraints with a custom timeout.
This method works exactly like Bucket.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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
DurabilityException
.CASMismatchException
A DurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO
is used, the observable is errored with a DurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.
public <D extends Document<?>> D remove(D document)
Bucket
Removes a Document
from the Server with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D remove(D document, PersistTo persistTo, ReplicateTo replicateTo)
Bucket
Removes a Document
from the Server and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(D document, PersistTo persistTo)
Bucket
Removes a Document
from the Server and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(D document, ReplicateTo replicateTo)
Bucket
Removes a Document
from the Server and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D remove(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.remove
in interface Bucket
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.public <D extends Document<?>> D remove(D document, PersistTo persistTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(D document, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public JsonDocument remove(java.lang.String id)
Bucket
Removes a Document
from the Server identified by its ID with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonDocument remove(java.lang.String id, PersistTo persistTo, ReplicateTo replicateTo)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public JsonDocument remove(java.lang.String id, PersistTo persistTo)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public JsonDocument remove(java.lang.String id, ReplicateTo replicateTo)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public JsonDocument remove(java.lang.String id, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server identified by its ID with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonDocument remove(java.lang.String id, PersistTo persistTo, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public JsonDocument remove(java.lang.String id, PersistTo persistTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public JsonDocument remove(java.lang.String id, ReplicateTo replicateTo, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(java.lang.String id, java.lang.Class<D> target)
Bucket
Removes a Document
from the Server identified by its ID with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D remove(java.lang.String id, PersistTo persistTo, ReplicateTo replicateTo, java.lang.Class<D> target)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(java.lang.String id, PersistTo persistTo, java.lang.Class<D> target)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(java.lang.String id, ReplicateTo replicateTo, java.lang.Class<D> target)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with the default key/value timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(java.lang.String id, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server identified by its ID with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D remove(java.lang.String id, PersistTo persistTo, ReplicateTo replicateTo, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.remove
in interface Bucket
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.public <D extends Document<?>> D remove(java.lang.String id, PersistTo persistTo, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public <D extends Document<?>> D remove(java.lang.String id, ReplicateTo replicateTo, java.lang.Class<D> target, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Removes a Document
from the Server by its ID and apply a durability requirement with a custom timeout.
The Document
returned just has the document ID set, since the value and all other associated properties have been removed from the server.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DurabilityException
.public ViewResult query(ViewQuery query)
Bucket
Queries a Couchbase Server View
with the default view timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
ViewDoesNotExistException
public QueryResult query(Query query)
Bucket
Experimental: Queries a N1QL secondary index with the default query timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public QueryResult query(java.lang.String query)
Bucket
Experimental: Queries a N1QL secondary index with the default query timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public ViewResult query(ViewQuery query, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Queries a Couchbase Server View
with a custom timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
ViewDoesNotExistException
public QueryResult query(Query query, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Experimental: Queries a N1QL secondary index with a custom timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public QueryResult query(java.lang.String query, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Experimental: Queries a N1QL secondary index with a custom timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public java.lang.Boolean unlock(java.lang.String id, long cas)
Bucket
Unlocks a write-locked Document
with the default key/value timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
CASMismatchException
public <D extends Document<?>> java.lang.Boolean unlock(D document)
Bucket
Unlocks a write-locked Document
with the default key/value timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
CASMismatchException
public java.lang.Boolean unlock(java.lang.String id, long cas, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Unlocks a write-locked Document
with a custom timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
CASMismatchException
public <D extends Document<?>> java.lang.Boolean unlock(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Unlocks a write-locked Document
with a custom timeout.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
DocumentDoesNotExistException
CASMismatchException
public java.lang.Boolean touch(java.lang.String id, int expiry)
Bucket
Renews the expiration time of a Document
with the default key/value timeout.
Compared to Bucket.getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> java.lang.Boolean touch(D document)
Bucket
Renews the expiration time of a Document
with the default key/value timeout.
Compared to Bucket.getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public java.lang.Boolean touch(java.lang.String id, int expiry, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Renews the expiration time of a Document
with a custom timeout.
Compared to Bucket.getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> java.lang.Boolean touch(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Renews the expiration time of a Document
with a custom timeout.
Compared to Bucket.getAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonLongDocument counter(java.lang.String id, long delta)
Bucket
Increment or decrement a counter with the given value and a default value of 0 with the default key/value timeout.
It is not allowed that the delta value will bring the actual value below zero.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonLongDocument counter(java.lang.String id, long delta, long initial)
Bucket
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.
It is not allowed that the delta value will bring the actual value below zero.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonLongDocument counter(java.lang.String id, long delta, long initial, int expiry)
Bucket
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.
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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonLongDocument counter(java.lang.String id, long delta, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Increment or decrement a counter with the given value and a default value of 0 with a custom timeout.
It is not allowed that the delta value will bring the actual value below zero.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonLongDocument counter(java.lang.String id, long delta, long initial, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.
It is not allowed that the delta value will bring the actual value below zero.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public JsonLongDocument counter(java.lang.String id, long delta, long initial, int expiry, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.
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.
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public BucketManager bucketManager()
Bucket
Provides access to the BucketManager
for administrative access.
The manager lets you perform operations such as flushing a bucket or creating and managing design documents.
bucketManager
in interface Bucket
public <D extends Document<?>> D append(D document)
Bucket
Append a Document
to another one with the default key/value timeout.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D prepend(D document)
Bucket
Prepend a Document
to another one with the default key/value timeout.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D append(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Append a Document
to another one with a custom timeout.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public <D extends Document<?>> D prepend(D document, long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Prepend a Document
to another one with a custom timeout.
If the Document
does not exist, it needs to be created upfront. Note that JsonDocument
s in all forms are not supported, it is advised that the following ones are used:
This method throws under the following conditions:
TimeoutException
BackpressureException
RequestCancelledException
public java.lang.Boolean close()
Bucket
Closes this bucket with the default disconnect timeout.
public java.lang.Boolean close(long timeout, java.util.concurrent.TimeUnit timeUnit)
Bucket
Closes this bucket with a custom timeout.