Class CouchbaseBucket

  • All Implemented Interfaces:
    Bucket

    public class CouchbaseBucket
    extends Object
    implements Bucket
    • Method Detail

      • async

        public AsyncBucket async()
        Description copied from interface: Bucket
        Provides access to the underlying asynchronous bucket interface.
        Specified by:
        async in interface Bucket
        Returns:
        the asynchronous bucket.
      • name

        public String name()
        Description copied from interface: Bucket
        The name of the Bucket.
        Specified by:
        name in interface Bucket
        Returns:
        the name of the bucket.
      • core

        public ClusterFacade core()
        Description copied from interface: Bucket
        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.
        Specified by:
        core in interface Bucket
        Returns:
        the underlying ClusterFacade from the "core-io" package.
      • repository

        public Repository repository()
        Description copied from interface: Bucket
        The Repository provides access to full object document mapping (ODM) capabilities. It allows you to work with POJO entities only and use annotations to customize the behaviour and mapping characteristics.
        Specified by:
        repository in interface Bucket
        Returns:
        the repository for ODM capabilities.
      • get

        public <D extends Document<?>> D get​(D document)
        Description copied from interface: Bucket
        Retrieves any type of Document with the default key/value timeout. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method throws under the following conditions: - 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.
        Specified by:
        get in interface Bucket
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        Returns:
        the found Document or null.
      • get

        public <D extends Document<?>> D get​(D document,
                                             long timeout,
                                             TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieves any type of Document with a custom timeout. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method throws under the following conditions: - 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.
        Specified by:
        get in interface Bucket
        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

        public <D extends Document<?>> D get​(String id,
                                             Class<D> target)
        Description copied from interface: Bucket
        Retrieves any type of Document by its ID with the default key/value timeout. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method throws under the following conditions: - 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.
        Specified by:
        get in interface Bucket
        Parameters:
        id - the id of the document.
        target - the target document type to use.
        Returns:
        the found Document or null.
      • get

        public <D extends Document<?>> D get​(String id,
                                             Class<D> target,
                                             long timeout,
                                             TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieves any type of Document by its ID with a custom timeout. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method throws under the following conditions: - 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.
        Specified by:
        get in interface Bucket
        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

        public boolean exists​(String id)
        Description copied from interface: Bucket
        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.
        Specified by:
        exists in interface Bucket
        Parameters:
        id - the id of the document.
        Returns:
        true if it exists, false otherwise.
      • exists

        public boolean exists​(String id,
                              long timeout,
                              TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        exists in interface Bucket
        Parameters:
        id - the id of the document.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if it exists, false otherwise.
      • exists

        public <D extends Document<?>> boolean exists​(D document)
        Description copied from interface: Bucket
        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.
        Specified by:
        exists in interface Bucket
        Parameters:
        document - the document where the ID is extracted from.
        Returns:
        true if it exists, false otherwise.
      • exists

        public <D extends Document<?>> boolean exists​(D document,
                                                      long timeout,
                                                      TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        exists in interface Bucket
        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

        public List<JsonDocument> getFromReplica​(String id,
                                                 ReplicaMode type)
        Description copied from interface: Bucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with the default timeout. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. 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
        Specified by:
        getFromReplica in interface Bucket
        Parameters:
        id - id the unique ID of the document.
        type - the ReplicaMode to select.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        public List<JsonDocument> getFromReplica​(String id,
                                                 ReplicaMode type,
                                                 long timeout,
                                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with a custom timeout. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. 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
        Specified by:
        getFromReplica in interface Bucket
        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

        public <D extends Document<?>> List<D> getFromReplica​(D document,
                                                              ReplicaMode type)
        Description copied from interface: Bucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with the default timeout. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. 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
        Specified by:
        getFromReplica in interface Bucket
        Parameters:
        document - the document to extract the ID from.
        type - the ReplicaMode to select.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        public <D extends Document<?>> List<D> getFromReplica​(D document,
                                                              ReplicaMode type,
                                                              long timeout,
                                                              TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with a custom timeout. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. 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
        Specified by:
        getFromReplica in interface Bucket
        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

        public <D extends Document<?>> List<D> getFromReplica​(String id,
                                                              ReplicaMode type,
                                                              Class<D> target)
        Description copied from interface: Bucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with the default timeout. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. 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
        Specified by:
        getFromReplica in interface Bucket
        Parameters:
        id - the id of the document.
        type - the ReplicaMode to select.
        Returns:
        a List containing zero to N JsonDocuments.
      • getFromReplica

        public <D extends Document<?>> List<D> getFromReplica​(String id,
                                                              ReplicaMode type,
                                                              Class<D> target,
                                                              long timeout,
                                                              TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID with a custom timeout. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. 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
        Specified by:
        getFromReplica in interface Bucket
        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

        public Iterator<JsonDocument> getFromReplica​(String id)
        Description copied from interface: Bucket
        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
        Specified by:
        getFromReplica in interface Bucket
        Parameters:
        id - the unique ID of the document.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        public <D extends Document<?>> Iterator<D> getFromReplica​(D document)
        Description copied from interface: Bucket
        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
        Specified by:
        getFromReplica in interface Bucket
        Parameters:
        document - the document to extract the ID from.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        public <D extends Document<?>> Iterator<D> getFromReplica​(String id,
                                                                  Class<D> target)
        Description copied from interface: Bucket
        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
        Specified by:
        getFromReplica in interface Bucket
        Parameters:
        id - the unique ID of the document.
        target - the target document type to use.
        Returns:
        the Iterator containing Documents as they arrive.
      • getFromReplica

        public <D extends Document<?>> Iterator<D> getFromReplica​(String id,
                                                                  Class<D> target,
                                                                  long timeout,
                                                                  TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        getFromReplica in interface Bucket
        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.
      • getFromReplica

        public <D extends Document<?>> Iterator<D> getFromReplica​(D document,
                                                                  long timeout,
                                                                  TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        getFromReplica in interface Bucket
        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

        public Iterator<JsonDocument> getFromReplica​(String id,
                                                     long timeout,
                                                     TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        getFromReplica in interface Bucket
        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.
      • getAndLock

        public JsonDocument getAndLock​(String id,
                                       int lockTime)
        Description copied from interface: Bucket
        Retrieve and lock a JsonDocument by its unique ID with the default key/value timeout. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. 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.
        Specified by:
        getAndLock in interface Bucket
        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

        public JsonDocument getAndLock​(String id,
                                       int lockTime,
                                       long timeout,
                                       TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieve and lock a JsonDocument by its unique ID with a custom timeout. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. 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.
        Specified by:
        getAndLock in interface Bucket
        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

        public <D extends Document<?>> D getAndLock​(D document,
                                                    int lockTime)
        Description copied from interface: Bucket
        Retrieve and lock a Document by its unique ID with the default key/value timeout. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(Document), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. 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.
        Specified by:
        getAndLock in interface Bucket
        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

        public <D extends Document<?>> D getAndLock​(D document,
                                                    int lockTime,
                                                    long timeout,
                                                    TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieve and lock a Document by its unique ID with a custom timeout. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(Document), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. 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.
        Specified by:
        getAndLock in interface Bucket
        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

        public <D extends Document<?>> D getAndLock​(String id,
                                                    int lockTime,
                                                    Class<D> target)
        Description copied from interface: Bucket
        Retrieve and lock a Document by its unique ID with the default key/value timeout. This method differs from Bucket.getAndLock(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. 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.
        Specified by:
        getAndLock in interface Bucket
        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

        public <D extends Document<?>> D getAndLock​(String id,
                                                    int lockTime,
                                                    Class<D> target,
                                                    long timeout,
                                                    TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieve and lock a Document by its unique ID with the a custom timeout. This method differs from Bucket.getAndLock(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. 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.
        Specified by:
        getAndLock in interface Bucket
        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

        public JsonDocument getAndTouch​(String id,
                                        int expiry)
        Description copied from interface: Bucket
        Retrieve and touch a JsonDocument by its unique ID with the default key/value timeout. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String), but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - 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.
        Specified by:
        getAndTouch in interface Bucket
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        Returns:
        the found JsonDocument or null.
      • getAndTouch

        public JsonDocument getAndTouch​(String id,
                                        int expiry,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieve and touch a JsonDocument by its unique ID with the a custom timeout. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String), but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - 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.
        Specified by:
        getAndTouch in interface Bucket
        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

        public <D extends Document<?>> D getAndTouch​(D document)
        Description copied from interface: Bucket
        Retrieve and touch a Document by its unique ID with the default key/value timeout. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(Document), but in addition it touches the document, which will reset its configured expiration time set on the given document itself. This method throws under the following conditions: - 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.
        Specified by:
        getAndTouch in interface Bucket
        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

        public <D extends Document<?>> D getAndTouch​(D document,
                                                     long timeout,
                                                     TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieve and touch a Document by its unique ID with a custom timeout. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(Document), but in addition it touches the document, which will reset its configured expiration time set on the given document itself. This method throws under the following conditions: - 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.
        Specified by:
        getAndTouch in interface Bucket
        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

        public <D extends Document<?>> D getAndTouch​(String id,
                                                     int expiry,
                                                     Class<D> target)
        Description copied from interface: Bucket
        Retrieve and touch a Document by its unique ID with the default key/value timeout. This method differs from Bucket.getAndTouch(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String, Class), but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - 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.
        Specified by:
        getAndTouch in interface Bucket
        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

        public <D extends Document<?>> D getAndTouch​(String id,
                                                     int expiry,
                                                     Class<D> target,
                                                     long timeout,
                                                     TimeUnit timeUnit)
        Description copied from interface: Bucket
        Retrieve and touch a Document by its unique ID with a custom timeout. This method differs from Bucket.getAndTouch(String, int) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to Bucket.get(String, Class), but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - 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.
        Specified by:
        getAndTouch in interface Bucket
        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

        public <D extends Document<?>> D insert​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Insert a Document if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        insert in interface Bucket
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • insert

        public <D extends Document<?>> D insert​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Insert a Document if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly like Bucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        insert in interface Bucket
        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

        public <D extends Document<?>> D insert​(D document,
                                                PersistTo persistTo)
        Description copied from interface: Bucket
        Insert a Document if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        insert in interface Bucket
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        Returns:
        the new Document.
      • insert

        public <D extends Document<?>> D insert​(D document,
                                                PersistTo persistTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Insert a Document if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly like Bucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        insert in interface Bucket
        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

        public <D extends Document<?>> D insert​(D document,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Insert a Document if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        insert in interface Bucket
        Parameters:
        document - the Document to insert.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • insert

        public <D extends Document<?>> D insert​(D document,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Insert a Document if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly like Bucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        insert in interface Bucket
        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

        public <D extends Document<?>> D upsert​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Insert or overwrite a Document and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the Bucket.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.**
        Specified by:
        upsert in interface Bucket
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • upsert

        public <D extends Document<?>> D upsert​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Insert or overwrite a Document and watch for durability constraints with a custom timeout. This method works exactly like Bucket.upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the Bucket.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.**
        Specified by:
        upsert in interface Bucket
        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

        public <D extends Document<?>> D upsert​(D document,
                                                PersistTo persistTo)
        Description copied from interface: Bucket
        Insert or overwrite a Document and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the Bucket.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.**
        Specified by:
        upsert in interface Bucket
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        Returns:
        the new Document.
      • upsert

        public <D extends Document<?>> D upsert​(D document,
                                                PersistTo persistTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Insert or overwrite a Document and watch for durability constraints with a custom timeout. This method works exactly like Bucket.upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the Bucket.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.**
        Specified by:
        upsert in interface Bucket
        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

        public <D extends Document<?>> D upsert​(D document,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Insert or overwrite a Document and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the Bucket.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.**
        Specified by:
        upsert in interface Bucket
        Parameters:
        document - the Document to upsert.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • upsert

        public <D extends Document<?>> D upsert​(D document,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Insert or overwrite a Document and watch for durability constraints with a custom timeout. This method works exactly like Bucket.upsert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use the Document.cas() for optimistic concurrency checks. If this behavior is needed, the Bucket.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.**
        Specified by:
        upsert in interface Bucket
        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

        public <D extends Document<?>> D replace​(D document,
                                                 PersistTo persistTo,
                                                 ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Replace a Document if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        replace in interface Bucket
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • replace

        public <D extends Document<?>> D replace​(D document,
                                                 PersistTo persistTo,
                                                 ReplicateTo replicateTo,
                                                 long timeout,
                                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        Replace a Document if it does exist and watch for durability constraints with a custom timeout. This method works exactly like Bucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        replace in interface Bucket
        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

        public <D extends Document<?>> D replace​(D document,
                                                 PersistTo persistTo)
        Description copied from interface: Bucket
        Replace a Document if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        replace in interface Bucket
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        Returns:
        the new Document.
      • replace

        public <D extends Document<?>> D replace​(D document,
                                                 PersistTo persistTo,
                                                 long timeout,
                                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        Replace a Document if it does exist and watch for durability constraints with a custom timeout. This method works exactly like Bucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        replace in interface Bucket
        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

        public <D extends Document<?>> D replace​(D document,
                                                 ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Replace a Document if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly like Bucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        replace in interface Bucket
        Parameters:
        document - the Document to replace.
        replicateTo - the replication constraint to watch.
        Returns:
        the new Document.
      • replace

        public <D extends Document<?>> D replace​(D document,
                                                 ReplicateTo replicateTo,
                                                 long timeout,
                                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        Replace a Document if it does exist and watch for durability constraints with a custom timeout. This method works exactly like Bucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - 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.**
        Specified by:
        replace in interface Bucket
        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

        public <D extends Document<?>> D remove​(D document)
        Description copied from interface: Bucket
        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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Removes a Document from the Server and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(D document,
                                                PersistTo persistTo)
        Description copied from interface: Bucket
        Removes a Document from the Server and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(D document,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Removes a Document from the Server and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(D document,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(D document,
                                                PersistTo persistTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(D document,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        remove in interface Bucket
        Parameters:
        document - the document to remove, with the ID extracted.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public JsonDocument remove​(String id,
                                   PersistTo persistTo,
                                   ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public JsonDocument remove​(String id,
                                   PersistTo persistTo)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public JsonDocument remove​(String id,
                                   ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public JsonDocument remove​(String id,
                                   long timeout,
                                   TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public JsonDocument remove​(String id,
                                   PersistTo persistTo,
                                   ReplicateTo replicateTo,
                                   long timeout,
                                   TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public JsonDocument remove​(String id,
                                   PersistTo persistTo,
                                   long timeout,
                                   TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public JsonDocument remove​(String id,
                                   ReplicateTo replicateTo,
                                   long timeout,
                                   TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(String id,
                                                Class<D> target)
        Description copied from interface: Bucket
        Removes a Document from the Server identified by its ID with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(String id,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo,
                                                Class<D> target)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(String id,
                                                PersistTo persistTo,
                                                Class<D> target)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(String id,
                                                ReplicateTo replicateTo,
                                                Class<D> target)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with the default key/value timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        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

        public <D extends Document<?>> D remove​(String id,
                                                Class<D> target,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(String id,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo,
                                                Class<D> target,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(String id,
                                                PersistTo persistTo,
                                                Class<D> target,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> D remove​(String id,
                                                ReplicateTo replicateTo,
                                                Class<D> target,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes a Document from the Server by its ID and apply a durability requirement with a custom timeout. The Document returned just has the document ID 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.
        Specified by:
        remove in interface Bucket
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • query

        public N1qlQueryResult query​(Statement statement)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        Parameters:
        statement - the statement in a DSL form (start with a static select() import)
        Returns:
        a result containing all found rows and additional information.
      • query

        public N1qlQueryResult query​(N1qlQuery query)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        Parameters:
        query - the full N1qlQuery, including statement and any other additional parameter.
        Returns:
        a result containing all found rows and additional information.
      • query

        public SearchQueryResult query​(SearchQuery query)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        Parameters:
        query - the query builder.
        Returns:
        a query result containing the matches and additional information.
      • query

        public SearchQueryResult query​(SearchQuery query,
                                       long timeout,
                                       TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        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

        public AnalyticsQueryResult query​(AnalyticsQuery query)
        Description copied from interface: Bucket
        Queries Couchbase Analytics
        Specified by:
        query in interface Bucket
        Parameters:
        query - the query builder.
        Returns:
        a query result containing the rows and additional information.
      • query

        public AnalyticsQueryResult query​(AnalyticsQuery query,
                                          long timeout,
                                          TimeUnit timeUnit)
        Description copied from interface: Bucket
        Queries Couchbase Analytics
        Specified by:
        query in interface Bucket
        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.
      • query

        public ViewResult query​(ViewQuery query,
                                long timeout,
                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        Parameters:
        query - the query to perform.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all the found rows and additional information.
      • query

        public SpatialViewResult query​(SpatialViewQuery query,
                                       long timeout,
                                       TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        Parameters:
        query - the query to perform.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all the found rows and additional information.
      • query

        public N1qlQueryResult query​(Statement statement,
                                     long timeout,
                                     TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        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

        public N1qlQueryResult query​(N1qlQuery query,
                                     long timeout,
                                     TimeUnit timeUnit)
        Description copied from interface: Bucket
        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
        Specified by:
        query in interface Bucket
        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.
      • touch

        public Boolean touch​(String id,
                             int expiry,
                             long timeout,
                             TimeUnit timeUnit)
        Description copied from interface: Bucket
        Renews the expiration time of a Document with a custom timeout. Compared to Bucket.getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - 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.
        Specified by:
        touch in interface Bucket
        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

        public <D extends Document<?>> Boolean touch​(D document,
                                                     long timeout,
                                                     TimeUnit timeUnit)
        Description copied from interface: Bucket
        Renews the expiration time of a Document with a custom timeout. Compared to Bucket.getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - 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.
        Specified by:
        touch in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.
        Specified by:
        counter in interface Bucket
        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.
      • bucketManager

        public BucketManager bucketManager()
        Description copied from interface: Bucket
        Provides access to the BucketManager for administrative access. The manager lets you perform operations such as flushing a bucket or creating and managing design documents.
        Specified by:
        bucketManager in interface Bucket
        Returns:
        the bucket manager for administrative operations.
      • counter

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        PersistTo persistTo)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        ReplicateTo replicateTo)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        PersistTo persistTo,
                                        ReplicateTo replicateTo)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        PersistTo persistTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        ReplicateTo replicateTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        PersistTo persistTo)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        PersistTo persistTo,
                                        ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        PersistTo persistTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        ReplicateTo replicateTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry,
                                        PersistTo persistTo)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry,
                                        ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry,
                                        PersistTo persistTo,
                                        ReplicateTo replicateTo)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry,
                                        PersistTo persistTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry,
                                        ReplicateTo replicateTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        PersistTo persistTo,
                                        ReplicateTo replicateTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        PersistTo persistTo,
                                        ReplicateTo replicateTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public JsonLongDocument counter​(String id,
                                        long delta,
                                        long initial,
                                        int expiry,
                                        PersistTo persistTo,
                                        ReplicateTo replicateTo,
                                        long timeout,
                                        TimeUnit timeUnit)
        Description copied from interface: Bucket
        Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *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 Bucket.insert(D) to create a JsonLongDocument. The value can also be modified by using Bucket.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.**
        Specified by:
        counter in interface Bucket
        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

        public <D extends Document<?>> D append​(D document,
                                                PersistTo persistTo)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        append in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> D append​(D document,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        append in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> D append​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        append in interface Bucket
        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

        public <D extends Document<?>> D append​(D document,
                                                PersistTo persistTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        append in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> D append​(D document,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        append in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> D append​(D document,
                                                PersistTo persistTo,
                                                ReplicateTo replicateTo,
                                                long timeout,
                                                TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        append in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> D prepend​(D document,
                                                 PersistTo persistTo)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        prepend in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> D prepend​(D document,
                                                 ReplicateTo replicateTo)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        prepend in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> D prepend​(D document,
                                                 PersistTo persistTo,
                                                 ReplicateTo replicateTo)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        prepend in interface Bucket
        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

        public <D extends Document<?>> D prepend​(D document,
                                                 PersistTo persistTo,
                                                 long timeout,
                                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        prepend in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> D prepend​(D document,
                                                 ReplicateTo replicateTo,
                                                 long timeout,
                                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        prepend in interface Bucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> D prepend​(D document,
                                                 PersistTo persistTo,
                                                 ReplicateTo replicateTo,
                                                 long timeout,
                                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        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 Bucket.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.**
        Specified by:
        prepend in interface Bucket
        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

        public LookupInBuilder lookupIn​(String docId)
        Description copied from interface: Bucket
        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.
        Specified by:
        lookupIn in interface Bucket
        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

        public MutateInBuilder mutateIn​(String docId)
        Description copied from interface: Bucket
        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.
        Specified by:
        mutateIn in interface Bucket
        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

        public <V> boolean mapAdd​(String docId,
                                  String key,
                                  V value)
        Description copied from interface: Bucket
        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.
        Specified by:
        mapAdd in interface Bucket
        Parameters:
        docId - document id backing the map
        key - key to be stored
        value - value to be stored
        Returns:
        true if successful
      • mapAdd

        public <V> boolean mapAdd​(String docId,
                                  String key,
                                  V value,
                                  long timeout,
                                  TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        mapAdd in interface Bucket
        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

        public <V> boolean mapAdd​(String docId,
                                  String key,
                                  V value,
                                  MutationOptionBuilder mutationOptionBuilder)
        Description copied from interface: Bucket
        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.
        Specified by:
        mapAdd in interface Bucket
        Parameters:
        docId - document id backing the map
        key - key to be stored
        value - value to be stored
        mutationOptionBuilder - mutation options MutationOptionBuilder
        Returns:
        true if successful
      • mapAdd

        public <V> boolean mapAdd​(String docId,
                                  String key,
                                  V value,
                                  MutationOptionBuilder mutationOptionBuilder,
                                  long timeout,
                                  TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        mapAdd in interface Bucket
        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
      • mapGet

        public <V> V mapGet​(String docId,
                            String key,
                            Class<V> valueType,
                            long timeout,
                            TimeUnit timeUnit)
        Description copied from interface: Bucket
        Get value of a key in the CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the 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.
        Specified by:
        mapGet in interface Bucket
        Parameters:
        docId - document id backing the map
        key - key in the map
        valueType - value type class
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        value if found
      • mapRemove

        public boolean mapRemove​(String docId,
                                 String key)
        Description copied from interface: Bucket
        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.
        Specified by:
        mapRemove in interface Bucket
        Parameters:
        docId - document id backing the map
        key - key to be removed
        Returns:
        true if successful, even if the key doesn't exist
      • mapRemove

        public boolean mapRemove​(String docId,
                                 String key,
                                 long timeout,
                                 TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        mapRemove in interface Bucket
        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
      • mapSize

        public int mapSize​(String docId,
                           long timeout,
                           TimeUnit timeUnit)
        Description copied from interface: Bucket
        Returns the number key value pairs in CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        mapSize in interface Bucket
        Parameters:
        docId - document id backing the map
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        number of key value pairs
      • listGet

        public <E> E listGet​(String docId,
                             int index,
                             Class<E> elementType,
                             long timeout,
                             TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        listGet in interface Bucket
        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

        public <E> boolean listAppend​(String docId,
                                      E element)
        Description copied from interface: Bucket
        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 - The server is currently not able to process the request, retrying may help: TemporaryFailureException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        listAppend in interface Bucket
        Parameters:
        docId - document id backing the list
        element - element to be pushed into the queue
        Returns:
        true if successful
      • listAppend

        public <E> boolean listAppend​(String docId,
                                      E element,
                                      long timeout,
                                      TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        listAppend in interface Bucket
        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

        public <E> boolean listPrepend​(String docId,
                                       E element)
        Description copied from interface: Bucket
        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 - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the underlying couchbase document does not exist: DocumentDoesNotExistException - A CAS value was set and it did not match with the server: CASMismatchException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        listPrepend in interface Bucket
        Parameters:
        docId - document id backing the list
        element - element to shift as head of list
        Returns:
        true if successful
      • listPrepend

        public <E> boolean listPrepend​(String docId,
                                       E element,
                                       long timeout,
                                       TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        listPrepend in interface Bucket
        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
      • listPrepend

        public <E> boolean listPrepend​(String docId,
                                       E element,
                                       MutationOptionBuilder mutationOptionBuilder,
                                       long timeout,
                                       TimeUnit timeUnit)
        Description copied from interface: Bucket
        Shift list head to element in CouchbaseList with additional mutation options provided by MutationOptionBuilder This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - 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.
        Specified by:
        listPrepend in interface Bucket
        Parameters:
        docId - document id backing the list
        element - element to shift as head of list
        mutationOptionBuilder - mutation options MutationOptionBuilder
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful
      • listRemove

        public boolean listRemove​(String docId,
                                  int index,
                                  long timeout,
                                  TimeUnit timeUnit)
        Description copied from interface: Bucket
        Remove an element from an index in CouchbaseList This method throws under the following conditions: - IndexOutOfBoundsException if index is not found - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        listRemove in interface Bucket
        Parameters:
        docId - document id backing the list
        index - index of the element in list
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful
      • listSet

        public <E> boolean listSet​(String docId,
                                   int index,
                                   E element)
        Description copied from interface: Bucket
        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.
        Specified by:
        listSet in interface Bucket
        Parameters:
        docId - document id backing the list
        index - index in the list
        element - element to be added
        Returns:
        true if successful
      • listSet

        public <E> boolean listSet​(String docId,
                                   int index,
                                   E element,
                                   long timeout,
                                   TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        listSet in interface Bucket
        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
      • listSet

        public <E> boolean listSet​(String docId,
                                   int index,
                                   E element,
                                   MutationOptionBuilder mutationOptionBuilder,
                                   long timeout,
                                   TimeUnit timeUnit)
        Description copied from interface: Bucket
        Add an element at an index in CouchbaseList with additional mutation options provided by MutationOptionBuilder This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - 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.
        Specified by:
        listSet in interface Bucket
        Parameters:
        docId - document id backing the list
        index - index in the list
        element - element to be added
        mutationOptionBuilder - mutation options MutationOptionBuilder
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        true if successful
      • listSize

        public int listSize​(String docId,
                            long timeout,
                            TimeUnit timeUnit)
        Description copied from interface: Bucket
        Returns the number of elements in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        listSize in interface Bucket
        Parameters:
        docId - document id backing the list
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        number of elements
      • setAdd

        public <E> boolean setAdd​(String docId,
                                  E element)
        Description copied from interface: Bucket
        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.
        Specified by:
        setAdd in interface Bucket
        Parameters:
        docId - document id backing the set
        element - element to be pushed into the set
        Returns:
        true if successful, false if the element exists in set
      • setAdd

        public <E> boolean setAdd​(String docId,
                                  E element,
                                  long timeout,
                                  TimeUnit timeUnit)
        Description copied from interface: Bucket
        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.
        Specified by:
        setAdd in interface Bucket
        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
      • setContains

        public <E> boolean setContains​(String docId,
                                       E element)
        Description copied from interface: Bucket
        Check if an element exists in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        setContains in interface Bucket
        Parameters:
        docId - document id backing the set
        element - element to check for existence
        Returns:
        true if element exists, false if the element does not exist
      • setContains

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

        public <E> E setRemove​(String docId,
                               E element)
        Description copied from interface: Bucket
        Removes an element from CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        setRemove in interface Bucket
        Parameters:
        docId - document id backing the set
        element - element to be removed
        Returns:
        element removed from set (fails silently by returning the element is not found in set)
      • setRemove

        public <E> E setRemove​(String docId,
                               E element,
                               long timeout,
                               TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes an element from CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        setRemove in interface Bucket
        Parameters:
        docId - document id backing the set
        element - element to be removed
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        element removed from set (fails silently by returning the element is not found in set)
      • setSize

        public int setSize​(String docId,
                           long timeout,
                           TimeUnit timeUnit)
        Description copied from interface: Bucket
        Returns the number of elements in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        setSize in interface Bucket
        Parameters:
        docId - document id backing the set
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        number of elements in set
      • queuePush

        public <E> boolean queuePush​(String docId,
                                     E element)
        Description copied from interface: Bucket
        Add an element into CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        queuePush in interface Bucket
        Parameters:
        docId - document id backing the queue
        element - element to be pushed into the queue
        Returns:
        true if successful
      • queuePush

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

        public <E> E queuePop​(String docId,
                              Class<E> elementType)
        Description copied from interface: Bucket
        Removes the first element from CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        queuePop in interface Bucket
        Parameters:
        docId - document id backing the queue
        elementType - element type class
        Returns:
        element removed from queue
      • queuePop

        public <E> E queuePop​(String docId,
                              Class<E> elementType,
                              long timeout,
                              TimeUnit timeUnit)
        Description copied from interface: Bucket
        Removes the first element from CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        queuePop in interface Bucket
        Parameters:
        docId - document id backing the queue
        elementType - element type class
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        element removed from queue
      • queueSize

        public int queueSize​(String docId,
                             long timeout,
                             TimeUnit timeUnit)
        Description copied from interface: Bucket
        Returns the number of elements in CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the underlying couchbase document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        queueSize in interface Bucket
        Parameters:
        docId - document id backing the queue
        timeout - the custom timeout
        timeUnit - the unit for the timeout
        Returns:
        number of elements
      • close

        public Boolean close()
        Description copied from interface: Bucket
        Closes this bucket with the default disconnect timeout.
        Specified by:
        close in interface Bucket
        Returns:
        true if the bucket was successfully closed.
      • close

        public Boolean close​(long timeout,
                             TimeUnit timeUnit)
        Description copied from interface: Bucket
        Closes this bucket with a custom timeout.
        Specified by:
        close in interface Bucket
        Parameters:
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if the bucket was successfully closed.
      • isClosed

        public boolean isClosed()
        Description copied from interface: Bucket
        Returns true if this bucket is already closed, false if it is still open.
        Specified by:
        isClosed in interface Bucket
        Returns:
        true if closed, false otherwise.
      • invalidateQueryCache

        public int invalidateQueryCache()
        Description copied from interface: Bucket
        Invalidates and clears the internal query cache. This method can be used to explicitly clear the internal N1QL query cache. This cache will be filled with non-adhoc query statements (query plans) to speed up those subsequent executions. Triggering this method will wipe out the complete cache, which will not cause an interruption but rather all queries need to be re-prepared internally. This method is likely to be deprecated in the future once the server side query engine distributes its state throughout the cluster. This method will not throw under any conditions.
        Specified by:
        invalidateQueryCache in interface Bucket
        Returns:
        the number of entries in the cache before it was cleared out.
      • ping

        public PingReport ping​(String reportId,
                               long timeout,
                               TimeUnit timeUnit)
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call with a custom report ID on all services. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
        Specified by:
        ping in interface Bucket
        Parameters:
        reportId - the report ID to use in the report.
        timeout - the timeout for each individual service.
        timeUnit - the unit for the timeout.
        Returns:
        a ping report once created.
      • ping

        public PingReport ping​(long timeout,
                               TimeUnit timeUnit)
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call on all services with a random report id. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
        Specified by:
        ping in interface Bucket
        Parameters:
        timeout - the timeout for each individual service.
        timeUnit - the unit for the timeout.
        Returns:
        a ping report once created.
      • ping

        public PingReport ping​(Collection<ServiceType> services,
                               long timeout,
                               TimeUnit timeUnit)
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call on a list of services with a random report id. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
        Specified by:
        ping in interface Bucket
        Parameters:
        services - collection of services which should be included.
        timeout - the timeout for each individual service.
        timeUnit - the unit for the timeout.
        Returns:
        a ping report once created.
      • ping

        public PingReport ping​(String reportId,
                               Collection<ServiceType> services,
                               long timeout,
                               TimeUnit timeUnit)
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call against all the services provided with a custom report id. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
        Specified by:
        ping in interface Bucket
        Parameters:
        reportId - the report ID to use in the report.
        services - collection of services which should be included.
        timeout - the timeout for each individual service.
        timeUnit - the unit for the timeout.
        Returns:
        a ping report once created.
      • exportAnalyticsDeferredResultHandle

        public byte[] exportAnalyticsDeferredResultHandle​(AnalyticsDeferredResultHandle handle)
        Description copied from interface: Bucket
        Exports the deferred result handle to a serialized form which can be used across SDKs
        Specified by:
        exportAnalyticsDeferredResultHandle in interface Bucket
        Parameters:
        handle - the deferred result handle
        Returns:
        the serialized bytes
      • ping

        public PingReport ping​(String reportId)
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call with a custom report ID on all services. Since no timeout is provided, the management timeout from the environment will be used.
        Specified by:
        ping in interface Bucket
        Parameters:
        reportId - the report ID to use in the report.
        Returns:
        a ping report once created.
      • ping

        public PingReport ping()
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call with a random report id on all services. Since no timeout is provided, the management timeout from the environment will be used.
        Specified by:
        ping in interface Bucket
        Returns:
        a ping report once created.
      • ping

        public PingReport ping​(Collection<ServiceType> services)
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call with a random report id on all services. Since no timeout is provided, the management timeout from the environment will be used.
        Specified by:
        ping in interface Bucket
        Parameters:
        services - collection of services which should be included.
        Returns:
        a ping report once created.
      • ping

        public PingReport ping​(String reportId,
                               Collection<ServiceType> services)
        Description copied from interface: Bucket
        Performs a diagnostic active "ping" call with a custom report id on all services. Since no timeout is provided, the management timeout from the environment will be used.
        Specified by:
        ping in interface Bucket
        services - collection of services which should be included.
        Returns:
        a ping report once created.