Interface Bucket

  • All Known Implementing Classes:
    CouchbaseBucket

    @Committed
    @Public
    public interface Bucket
    Defines operations that can be executed synchronously against a Couchbase Server bucket. Note that only a subset of the provided operations are available for "memcached" type buckets. Also, some other operations are only available against specific versions of Couchbase Server. Default timeouts are always applied and can be configured through the CouchbaseEnvironment. Overloads are also available to change them on a per-call basis.
    Since:
    2.0
    Author:
    Michael Nitschinger
    • Method Detail

      • async

        AsyncBucket async()
        Provides access to the underlying asynchronous bucket interface.
        Returns:
        the asynchronous bucket.
      • core

        ClusterFacade core()
        Returns the underlying "core-io" library through its ClusterFacade. Handle with care, with great power comes great responsibility. All additional checks which are normally performed by this library are skipped.
        Returns:
        the underlying ClusterFacade from the "core-io" package.
      • name

        String name()
        The name of the Bucket.
        Returns:
        the name of the bucket.
      • get

        <D extends Document<?>> D get​(D document)
        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: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        Returns:
        the found Document or null.
      • get

        <D extends Document<?>> D get​(D document,
                                      long timeout,
                                      TimeUnit timeUnit)
        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: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found Document or null.
      • get

        <D extends Document<?>> D get​(String id,
                                      Class<D> target)
        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: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        target - the target document type to use.
        Returns:
        the found Document or null.
      • get

        <D extends Document<?>> D get​(String id,
                                      Class<D> target,
                                      long timeout,
                                      TimeUnit timeUnit)
        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: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found Document or null.
      • exists

        boolean exists​(String id)
        Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        Returns:
        true if it exists, false otherwise.
      • exists

        boolean exists​(String id,
                       long timeout,
                       TimeUnit timeUnit)
        Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if it exists, false otherwise.
      • exists

        <D extends Document<?>> boolean exists​(D document)
        Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document where the ID is extracted from.
        Returns:
        true if it exists, false otherwise.
      • exists

        <D extends Document<?>> boolean exists​(D document,
                                               long timeout,
                                               TimeUnit timeUnit)
        Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document where the ID is extracted from.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if it exists, false otherwise.
      • getFromReplica

        List<JsonDocument> getFromReplica​(String id,
                                          ReplicaMode type)
        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. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        id - id the unique ID of the document.
        type - the ReplicaMode to select.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        Iterator<JsonDocument> getFromReplica​(String id)
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with the default timeout. This method has the ReplicaMode.ALL preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from the List equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        id - the unique ID of the document.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        List<JsonDocument> getFromReplica​(String id,
                                          ReplicaMode type,
                                          long timeout,
                                          TimeUnit timeUnit)
        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. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        id - id the unique ID of the document.
        type - the ReplicaMode to select.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        Iterator<JsonDocument> getFromReplica​(String id,
                                              long timeout,
                                              TimeUnit timeUnit)
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with a custom timeout. This method has the ReplicaMode.ALL preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from the List equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        id - the unique ID of the document.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        <D extends Document<?>> List<D> getFromReplica​(D document,
                                                       ReplicaMode type)
        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. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        document - the document to extract the ID from.
        type - the ReplicaMode to select.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        <D extends Document<?>> Iterator<D> getFromReplica​(D document)
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with the default timeout. This method has the ReplicaMode.ALL preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from the List equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        document - the document to extract the ID from.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        <D extends Document<?>> List<D> getFromReplica​(D document,
                                                       ReplicaMode type,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        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. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        document - the document to extract the ID from.
        type - the ReplicaMode to select.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        <D extends Document<?>> Iterator<D> getFromReplica​(D document,
                                                           long timeout,
                                                           TimeUnit timeUnit)
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with a custom timeout. This method has the ReplicaMode.ALL preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from the List equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        document - the document to extract the ID from.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        <D extends Document<?>> List<D> getFromReplica​(String id,
                                                       ReplicaMode type,
                                                       Class<D> target)
        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. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        id - the id of the document.
        type - the ReplicaMode to select.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        <D extends Document<?>> Iterator<D> getFromReplica​(String id,
                                                           Class<D> target)
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with the default timeout. This method has the ReplicaMode.ALL preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from the List equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        id - the unique ID of the document.
        target - the target document type to use.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        <D extends Document<?>> List<D> getFromReplica​(String id,
                                                       ReplicaMode type,
                                                       Class<D> target,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        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. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        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.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        <D extends Document<?>> Iterator<D> getFromReplica​(String id,
                                                           Class<D> target,
                                                           long timeout,
                                                           TimeUnit timeUnit)
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with a custom timeout. This method has the ReplicaMode.ALL preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from the List equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException
        Parameters:
        id - the unique ID of the document.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the Iterator containing Documents as they arrive.
      • getAndLock

        JsonDocument getAndLock​(String id,
                                int lockTime)
        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 get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A transient error occurred, most probably the key was already locked: TemporaryLockFailureException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        Returns:
        the found JsonDocument or null.
      • getAndLock

        JsonDocument getAndLock​(String id,
                                int lockTime,
                                long timeout,
                                TimeUnit timeUnit)
        Retrieve and lock a JsonDocument by its unique ID with a custom timeout. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A transient error occurred, most probably the key was already locked: TemporaryLockFailureException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found JsonDocument or null.
      • getAndLock

        <D extends Document<?>> D getAndLock​(D document,
                                             int lockTime)
        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 get(Document), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A transient error occurred, most probably the key was already locked: TemporaryLockFailureException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        lockTime - the time to write lock the document (max. 30 seconds).
        Returns:
        the found Document or null.
      • getAndLock

        <D extends Document<?>> D getAndLock​(D document,
                                             int lockTime,
                                             long timeout,
                                             TimeUnit timeUnit)
        Retrieve and lock a Document by its unique ID with a custom timeout. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to get(Document), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A transient error occurred, most probably the key was already locked: TemporaryLockFailureException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        lockTime - the time to write lock the document (max. 30 seconds).
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found Document or null.
      • getAndLock

        <D extends Document<?>> D getAndLock​(String id,
                                             int lockTime,
                                             Class<D> target)
        Retrieve and lock a Document by its unique ID with the default key/value timeout. This method differs from getAndLock(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A transient error occurred, most probably the key was already locked: TemporaryLockFailureException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        target - the target document type to use.
        Returns:
        the found Document or null.
      • getAndLock

        <D extends Document<?>> D getAndLock​(String id,
                                             int lockTime,
                                             Class<D> target,
                                             long timeout,
                                             TimeUnit timeUnit)
        Retrieve and lock a Document by its unique ID with the a custom timeout. This method differs from getAndLock(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A transient error occurred, most probably the key was already locked: TemporaryLockFailureException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found Document or null.
      • getAndTouch

        JsonDocument getAndTouch​(String id,
                                 int expiry)
        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 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: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        Returns:
        the found JsonDocument or null.
      • getAndTouch

        JsonDocument getAndTouch​(String id,
                                 int expiry,
                                 long timeout,
                                 TimeUnit timeUnit)
        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 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: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found JsonDocument or null.
      • getAndTouch

        <D extends Document<?>> D getAndTouch​(D document)
        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 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: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the source document from which the ID and expiry is taken and the type is inferred.
        Returns:
        the found Document or null.
      • getAndTouch

        <D extends Document<?>> D getAndTouch​(D document,
                                              long timeout,
                                              TimeUnit timeUnit)
        Retrieve and touch a Document by its unique ID with a custom timeout. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to get(Document), but in addition it touches the document, which will reset its configured expiration time set on the given document itself. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the source document from which the ID and expiry is taken and the type is inferred.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found Document or null.
      • getAndTouch

        <D extends Document<?>> D getAndTouch​(String id,
                                              int expiry,
                                              Class<D> target)
        Retrieve and touch a Document by its unique ID with the default key/value timeout. This method differs from getAndTouch(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to get(String, Class), but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        target - the target document type to use.
        Returns:
        the found Document or null.
      • getAndTouch

        <D extends Document<?>> D getAndTouch​(String id,
                                              int expiry,
                                              Class<D> target,
                                              long timeout,
                                              TimeUnit timeUnit)
        Retrieve and touch a Document by its unique ID with a custom timeout. This method differs from getAndTouch(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to get(String, Class), but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the found Document or null.
      • insert

        <D extends Document<?>> D 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. This method works exactly like insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original insert failed because the document is already stored: DocumentAlreadyExistsException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • insert

        <D extends Document<?>> D insert​(D document,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Insert a Document if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly like insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original insert failed because the document is already stored: DocumentAlreadyExistsException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • insert

        <D extends Document<?>> D 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. This method works exactly like insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original insert failed because the document is already stored: DocumentAlreadyExistsException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        Returns:
        the new Document.
      • insert

        <D extends Document<?>> D insert​(D document,
                                         PersistTo persistTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Insert a Document if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly like insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original insert failed because the document is already stored: DocumentAlreadyExistsException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • insert

        <D extends Document<?>> D 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. This method works exactly like insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original insert failed because the document is already stored: DocumentAlreadyExistsException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to insert.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • insert

        <D extends Document<?>> D insert​(D document,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Insert a Document if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly like insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original insert failed because the document is already stored: DocumentAlreadyExistsException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to insert.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • upsert

        <D extends Document<?>> D upsert​(D document,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo)
        Insert or overwrite a Document and watch for durability constraints with the default key/value timeout. This method works exactly like upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo, ReplicateTo) method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • upsert

        <D extends Document<?>> D upsert​(D document,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Insert or overwrite a Document and watch for durability constraints with a custom timeout. This method works exactly like upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo, ReplicateTo, long, TimeUnit) method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • upsert

        <D extends Document<?>> D upsert​(D document,
                                         PersistTo persistTo)
        Insert or overwrite a Document and watch for durability constraints with the default key/value timeout. This method works exactly like upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo) method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        Returns:
        the new Document.
      • upsert

        <D extends Document<?>> D upsert​(D document,
                                         PersistTo persistTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Insert or overwrite a Document and watch for durability constraints with a custom timeout. This method works exactly like upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the replace(Document, PersistTo, long, TimeUnit) method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • upsert

        <D extends Document<?>> D upsert​(D document,
                                         ReplicateTo replicateTo)
        Insert or overwrite a Document and watch for durability constraints with the default key/value timeout. This method works exactly like upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the replace(Document, ReplicateTo) method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to upsert.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • upsert

        <D extends Document<?>> D upsert​(D document,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Insert or overwrite a Document and watch for durability constraints with a custom timeout. This method works exactly like upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the replace(Document, ReplicateTo, long, TimeUnit) method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to upsert.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • replace

        <D extends Document<?>> D 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. This method works exactly like replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original replace failed because the document does not exist: DocumentDoesNotExistException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • replace

        <D extends Document<?>> D replace​(D document,
                                          PersistTo persistTo,
                                          ReplicateTo replicateTo,
                                          long timeout,
                                          TimeUnit timeUnit)
        Replace a Document if it does exist and watch for durability constraints with a custom timeout. This method works exactly like replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original replace failed because the document does not exist: DocumentDoesNotExistException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • replace

        <D extends Document<?>> D replace​(D document,
                                          PersistTo persistTo)
        Replace a Document if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly like replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original replace failed because the document does not exist: DocumentDoesNotExistException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        Returns:
        the new Document.
      • replace

        <D extends Document<?>> D replace​(D document,
                                          PersistTo persistTo,
                                          long timeout,
                                          TimeUnit timeUnit)
        Replace a Document if it does exist and watch for durability constraints with a custom timeout. This method works exactly like replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original replace failed because the document does not exist: DocumentDoesNotExistException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • replace

        <D extends Document<?>> D replace​(D document,
                                          ReplicateTo replicateTo)
        Replace a Document if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly like replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original replace failed because the document does not exist: DocumentDoesNotExistException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to replace.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • replace

        <D extends Document<?>> D replace​(D document,
                                          ReplicateTo replicateTo,
                                          long timeout,
                                          TimeUnit timeUnit)
        Replace a Document if it does exist and watch for durability constraints with a custom timeout. This method works exactly like replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The original replace failed because the document does not exist: DocumentDoesNotExistException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the Document to replace.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the new Document.
      • remove

        <D extends Document<?>> D remove​(D document)
        Removes a Document from the Server with the default key/value timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(D document,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(D document,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(D document,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server and apply a durability requirement with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(D document,
                                         PersistTo persistTo)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(D document,
                                         PersistTo persistTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server and apply a durability requirement with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(D document,
                                         ReplicateTo replicateTo)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(D document,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server and apply a durability requirement with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set on the Document and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to remove, with the ID extracted.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        JsonDocument remove​(String id,
                            long timeout,
                            TimeUnit timeUnit)
        Removes a Document from the Server identified by its ID with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        JsonDocument remove​(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. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        JsonDocument remove​(String id,
                            PersistTo persistTo,
                            ReplicateTo replicateTo,
                            long timeout,
                            TimeUnit timeUnit)
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        JsonDocument remove​(String id,
                            PersistTo persistTo)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        JsonDocument remove​(String id,
                            PersistTo persistTo,
                            long timeout,
                            TimeUnit timeUnit)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        JsonDocument remove​(String id,
                            ReplicateTo replicateTo)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        JsonDocument remove​(String id,
                            ReplicateTo replicateTo,
                            long timeout,
                            TimeUnit timeUnit)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         Class<D> target)
        Removes a Document from the Server identified by its ID with the default key/value timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         Class<D> target,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server identified by its ID with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo,
                                         Class<D> target)
        Removes a Document from the Server by its ID and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo,
                                         Class<D> target,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         PersistTo persistTo,
                                         Class<D> target)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         PersistTo persistTo,
                                         Class<D> target,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         ReplicateTo replicateTo,
                                         Class<D> target)
        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 and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        <D extends Document<?>> D remove​(String id,
                                         ReplicateTo replicateTo,
                                         Class<D> target,
                                         long timeout,
                                         TimeUnit timeUnit)
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The document to remove does not exist: DocumentDoesNotExistException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • query

        ViewResult query​(ViewQuery query,
                         long timeout,
                         TimeUnit timeUnit)
        Queries a Couchbase Server View with a custom timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the design document or view is not found: ViewDoesNotExistException
        Parameters:
        query - the query to perform.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all the found rows and additional information.
      • query

        SpatialViewResult query​(SpatialViewQuery query,
                                long timeout,
                                TimeUnit timeUnit)
        Queries a Couchbase Server Spatial View with a custom timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the design document or view is not found: ViewDoesNotExistException
        Parameters:
        query - the query to perform.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all the found rows and additional information.
      • query

        N1qlQueryResult query​(Statement statement)
        Queries a N1QL secondary index with the default query timeout. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Parameters:
        statement - the statement in a DSL form (start with a static select() import)
        Returns:
        a result containing all found rows and additional information.
      • query

        N1qlQueryResult query​(Statement statement,
                              long timeout,
                              TimeUnit timeUnit)
        Queries a N1QL secondary index with a custom timeout. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Parameters:
        statement - the statement in a DSL form (start with a static select() import)
        timeout - the custom full timeout, including the time to retrieve all rows, errors, etc...
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all found rows and additional information.
      • query

        N1qlQueryResult query​(N1qlQuery query)
        Queries a N1QL secondary index with the default query timeout. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Parameters:
        query - the full N1qlQuery, including statement and any other additional parameter.
        Returns:
        a result containing all found rows and additional information.
      • query

        N1qlQueryResult query​(N1qlQuery query,
                              long timeout,
                              TimeUnit timeUnit)
        Queries a N1QL secondary index with a custom timeout. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Parameters:
        query - the full N1qlQuery, including statement and any other additional parameter.
        timeout - the custom full timeout, including the time to retrieve all rows, errors, etc...
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all found rows and additional information.
      • query

        @Committed
        SearchQueryResult query​(SearchQuery query)
        Queries a Full-Text Index This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Parameters:
        query - the query builder.
        Returns:
        a query result containing the matches and additional information.
      • query

        @Committed
        SearchQueryResult query​(SearchQuery query,
                                long timeout,
                                TimeUnit timeUnit)
        Queries a Full-Text Index This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Parameters:
        query - the query builder.
        timeout - the custom full timeout, including the time to retrieve all rows, errors, etc...
        timeUnit - the unit for the timeout.
        Returns:
        a query result containing the matches and additional information.
      • query

        @Committed
        AnalyticsQueryResult query​(AnalyticsQuery query,
                                   long timeout,
                                   TimeUnit timeUnit)
        Queries Couchbase Analytics
        Parameters:
        query - the query builder.
        timeout - the custom full timeout, including the time to retrieve all rows, errors, etc...
        timeUnit - the unit for the timeout.
        Returns:
        a query result containing the rows and additional information.
      • touch

        Boolean touch​(String id,
                      int expiry,
                      long timeout,
                      TimeUnit timeUnit)
        Renews the expiration time of a Document with a custom timeout. Compared to getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - The document doesn't exist: DocumentDoesNotExistException - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        expiry - the new expiration time. 0 means no expiry.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Boolean indicating if the touch had been successful or not.
      • touch

        <D extends Document<?>> Boolean touch​(D document,
                                              long timeout,
                                              TimeUnit timeUnit)
        Renews the expiration time of a Document with a custom timeout. Compared to getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - The document doesn't exist: DocumentDoesNotExistException - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document to extract the ID and expiry from.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Boolean indicating if the touch had been successful or not.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 PersistTo persistTo)
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 ReplicateTo replicateTo)
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 PersistTo persistTo,
                                 ReplicateTo replicateTo)
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 PersistTo persistTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 ReplicateTo replicateTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 PersistTo persistTo,
                                 ReplicateTo replicateTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial)
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 PersistTo persistTo)
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        persistTo - the persistence constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 ReplicateTo replicateTo)
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 PersistTo persistTo,
                                 ReplicateTo replicateTo)
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 PersistTo persistTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 ReplicateTo replicateTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 PersistTo persistTo,
                                 ReplicateTo replicateTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry,
                                 PersistTo persistTo)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry,
                                 ReplicateTo replicateTo)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry,
                                 PersistTo persistTo,
                                 ReplicateTo replicateTo)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry,
                                 PersistTo persistTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry,
                                 ReplicateTo replicateTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        JsonLongDocument counter​(String id,
                                 long delta,
                                 long initial,
                                 int expiry,
                                 PersistTo persistTo,
                                 ReplicateTo replicateTo,
                                 long timeout,
                                 TimeUnit timeUnit)
        Increment or decrement a counter with the given value and a initial value if it does not exist 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. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using insert(D) to create a JsonLongDocument. The value can also be modified by using upsert(D) with JsonLongDocument. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • append

        <D extends Document<?>> D append​(D document,
                                         PersistTo persistTo)
        Append a Documents content to an existing one with the default key/value timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        <D extends Document<?>> D append​(D document,
                                         ReplicateTo replicateTo)
        Append a Documents content to an existing one with the default key/value timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        <D extends Document<?>> D append​(D document,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo)
        Append a Documents content to an existing one with the default key/value timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        <D extends Document<?>> D append​(D document,
                                         long timeout,
                                         TimeUnit timeUnit)
        Append a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        <D extends Document<?>> D append​(D document,
                                         PersistTo persistTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Append a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        <D extends Document<?>> D append​(D document,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Append a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        <D extends Document<?>> D append​(D document,
                                         PersistTo persistTo,
                                         ReplicateTo replicateTo,
                                         long timeout,
                                         TimeUnit timeUnit)
        Append a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        <D extends Document<?>> D prepend​(D document,
                                          PersistTo persistTo)
        Prepend a Documents content to an existing one with the default key/value timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        <D extends Document<?>> D prepend​(D document,
                                          ReplicateTo replicateTo)
        Prepend a Documents content to an existing one with the default key/value timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        <D extends Document<?>> D prepend​(D document,
                                          PersistTo persistTo,
                                          ReplicateTo replicateTo)
        Prepend a Documents content to an existing one with the default key/value timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        <D extends Document<?>> D prepend​(D document,
                                          long timeout,
                                          TimeUnit timeUnit)
        Prepend a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        <D extends Document<?>> D prepend​(D document,
                                          PersistTo persistTo,
                                          long timeout,
                                          TimeUnit timeUnit)
        Prepend a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        <D extends Document<?>> D prepend​(D document,
                                          ReplicateTo replicateTo,
                                          long timeout,
                                          TimeUnit timeUnit)
        Prepend a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        <D extends Document<?>> D prepend​(D document,
                                          PersistTo persistTo,
                                          ReplicateTo replicateTo,
                                          long timeout,
                                          TimeUnit timeUnit)
        Prepend a Documents content to an existing one with a custom timeout. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate get(Document) call needs to be issued in order to get the full current content. If the Document does not exist, it needs to be created upfront. Note that JsonDocuments in all forms are not supported, it is advised that the following ones are used: - LegacyDocument - StringDocument - BinaryDocument Note that this method does not support expiration on the Document. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout: TimeoutException wrapped in a RuntimeException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a generic CouchbaseException. A DurabilityException typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured and ReplicateTo.TWO is used, the observable is errored with a DurabilityException. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • lookupIn

        @Committed
        @Public
        LookupInBuilder lookupIn​(String docId)
        Prepare a sub-document lookup through a builder API. You can use the builder to describe one or several lookup operations inside an existing JsonDocument, then execute the lookup synchronously by calling the LookupInBuilder.execute() method. Only the paths that you looked up inside the document will be transferred over the wire, limiting the network overhead for large documents.
        Parameters:
        docId - the id of the JSON document to lookup in.
        Returns:
        a builder to describe the lookup(s) to perform.
        See Also:
        LookupInBuilder.execute()
      • mutateIn

        @Committed
        @Public
        MutateInBuilder mutateIn​(String docId)
        Prepare a sub-document mutation through a builder API. You can use the builder to describe one or several mutation operations inside an existing JsonDocument, then execute them synchronously by calling the MutateInBuilder.execute() method. Only the values that you want mutated inside the document will be transferred over the wire, limiting the network overhead for large documents. A get followed by a replace of the whole document isn't needed anymore. Note that you can set the expiry, check the CAS and ask for durability constraints in the builder using methods prefixed by "with": withExpiry, withCas, withDurability.
        Parameters:
        docId - the id of the JSON document to mutate in.
        Returns:
        a builder to describe the mutation(s) to perform.
        See Also:
        MutateInBuilder.execute()
      • mapAdd

        @Committed
        @Public
        <V> boolean mapAdd​(String docId,
                           String key,
                           V value)
        Add a key value pair into CouchbaseMap If the underlying document for the map does not exist, this operation will create a new document to back the data structure. This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the map
        key - key to be stored
        value - value to be stored
        Returns:
        true if successful
      • mapAdd

        @Committed
        @Public
        <V> boolean mapAdd​(String docId,
                           String key,
                           V value,
                           long timeout,
                           TimeUnit timeUnit)
        Add a key value pair into CouchbaseMap If the underlying document for the map does not exist, this operation will create a new document to back the data structure. This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the map
        key - key to be stored
        value - value to be stored
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if successful
      • mapAdd

        @Committed
        @Public
        <V> boolean mapAdd​(String docId,
                           String key,
                           V value,
                           MutationOptionBuilder mutationOptionBuilder,
                           long timeout,
                           TimeUnit timeUnit)
        Add a key value pair into CouchbaseMap with additional mutation options provided by MutationOptionBuilder If the underlying document for the map does not exist, this operation will create a new document to back the data structure. This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the map
        key - key to be stored
        value - value to be stored
        mutationOptionBuilder - mutation options MutationOptionBuilder
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if successful
      • mapRemove

        @Committed
        @Public
        boolean mapRemove​(String docId,
                          String key,
                          long timeout,
                          TimeUnit timeUnit)
        Remove a key value pair from CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the map
        key - key to be removed
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful, even if the key doesn't exist
      • listGet

        @Committed
        @Public
        <E> E listGet​(String docId,
                      int index,
                      Class<E> elementType,
                      long timeout,
                      TimeUnit timeUnit)
        Get element at an index in the CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the list
        index - index in list
        elementType - element type class
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        value if found
      • listAppend

        @Committed
        @Public
        <E> boolean listAppend​(String docId,
                               E element,
                               long timeout,
                               TimeUnit timeUnit)
        Push an element to tail of CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the list
        element - element to be pushed into the queue
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful
      • listPrepend

        @Committed
        @Public
        <E> boolean listPrepend​(String docId,
                                E element,
                                long timeout,
                                TimeUnit timeUnit)
        Shift list head to element in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the list
        element - element to shift as head of list
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful
      • listSet

        @Committed
        @Public
        <E> boolean listSet​(String docId,
                            int index,
                            E element)
        Add an element at an index in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the list
        index - index in the list
        element - element to be added
        Returns:
        true if successful
      • listSet

        @Committed
        @Public
        <E> boolean listSet​(String docId,
                            int index,
                            E element,
                            long timeout,
                            TimeUnit timeUnit)
        Add an element at an index in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the list
        index - index in the list
        element - element to be added
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful
      • setAdd

        @Committed
        @Public
        <E> boolean setAdd​(String docId,
                           E element,
                           long timeout,
                           TimeUnit timeUnit)
        Add an element into CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Parameters:
        docId - document id backing the set
        element - element to be pushed into the set
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful, false if the element exists in set