Class CouchbaseAsyncBucket

    • Method Detail

      • core

        public rx.Observable<ClusterFacade> core()
        Description copied from interface: AsyncBucket
        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 AsyncBucket
        Returns:
        the underlying ClusterFacade from the "core-io" package.
      • n1qlQueryExecutor

        protected N1qlQueryExecutor n1qlQueryExecutor()
        Returns the underlying N1qlQueryExecutor used to perform N1QL queries. Handle with care since all additional checks that are normally performed by this library may be skipped (hence the protected visibility).
      • repository

        public rx.Observable<AsyncRepository> repository()
        Description copied from interface: AsyncBucket
        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 AsyncBucket
        Returns:
        the repository for ODM capabilities.
      • get

        public <D extends Document<?>> rx.Observable<D> get​(D document)
        Description copied from interface: AsyncBucket
        Retrieves any type of Document by its unique ID. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        Returns:
        an Observable eventually containing the found Document.
      • get

        public <D extends Document<?>> rx.Observable<D> get​(String id,
                                                            Class<D> target)
        Description copied from interface: AsyncBucket
        Retrieves any type of Document by its unique ID. This method differs from AsyncBucket.get(String) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        id - the unique ID of the document.
        target - the target document type to use.
        Returns:
        an Observable eventually containing the found Document.
      • get

        public <D extends Document<?>> rx.Observable<D> get​(String id,
                                                            Class<D> target,
                                                            long timeout,
                                                            TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieves any type of Document by its unique ID with a custom timeout. This method differs from AsyncBucket.get(String) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        id - the unique ID of the document.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found Document.
      • get

        public rx.Observable<JsonDocument> get​(String id,
                                               long timeout,
                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieves a JsonDocument by its unique ID with a custom timeout. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        id - the unique ID of the document.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found JsonDocument.
      • get

        public <D extends Document<?>> rx.Observable<D> get​(D document,
                                                            long timeout,
                                                            TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieves any type of Document by its unique ID with a custom timeout. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found Document.
      • exists

        public rx.Observable<Boolean> exists​(String id,
                                             long timeout,
                                             TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Check whether a document with the given ID does exist in the bucket with a custom timeout. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        exists in interface AsyncBucket
        Parameters:
        id - the id of the document.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if it exists, false otherwise.
      • exists

        public <D extends Document<?>> rx.Observable<Boolean> exists​(D document,
                                                                     long timeout,
                                                                     TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Check whether a document with the given ID does exist in the bucket with a custom timeout. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        exists in interface AsyncBucket
        Parameters:
        document - the document where the ID is extracted from.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        true if it exists, false otherwise.
      • exists

        public rx.Observable<Boolean> exists​(String id)
        Description copied from interface: AsyncBucket
        Check whether a document with the given ID does exist in the bucket. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        exists in interface AsyncBucket
        Parameters:
        id - the id of the document.
        Returns:
        true if it exists, false otherwise.
      • exists

        public <D extends Document<?>> rx.Observable<Boolean> exists​(D document)
        Description copied from interface: AsyncBucket
        Check whether a document with the given ID does exist in the bucket. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        exists in interface AsyncBucket
        Parameters:
        document - the document where the ID is extracted from.
        Returns:
        true if it exists, false otherwise.
      • getAndLock

        public rx.Observable<JsonDocument> getAndLock​(String id,
                                                      int lockTime)
        Description copied from interface: AsyncBucket
        Retrieve and lock a JsonDocument by its unique ID. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to AsyncBucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returned Observable can error under the following conditions: - In case of transient error, most probably because key is already locked: TemporaryLockFailureException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        getAndLock in interface AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        Returns:
        an Observable eventually containing the found JsonDocument.
      • getAndLock

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

        public <D extends Document<?>> rx.Observable<D> getAndLock​(String id,
                                                                   int lockTime,
                                                                   Class<D> target)
        Description copied from interface: AsyncBucket
        Retrieve and lock a Document by its unique ID. This method differs from AsyncBucket.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 AsyncBucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returned Observable can error under the following conditions: - In case of transient error, most probably because key is already locked: TemporaryLockFailureException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        getAndLock in interface AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        target - the target document type to use.
        Returns:
        an Observable eventually containing the found Document.
      • getAndTouch

        public rx.Observable<JsonDocument> getAndTouch​(String id,
                                                       int expiry)
        Description copied from interface: AsyncBucket
        Retrieve and touch a JsonDocument by its unique ID. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to AsyncBucket.get(String), but in addition it touches the document, which will reset its configured expiration time to the value provided. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        Returns:
        an Observable eventually containing the found JsonDocument.
      • getAndTouch

        public <D extends Document<?>> rx.Observable<D> getAndTouch​(D document)
        Description copied from interface: AsyncBucket
        Retrieve and touch a Document by its unique ID. If the document is found, a Document is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to AsyncBucket.get(Document), but in addition it touches the document, which will reset its configured expiration time set on the given document itself. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the source document from which the ID and expiry is taken and the type is inferred.
        Returns:
        an Observable eventually containing the found Document.
      • getAndTouch

        public <D extends Document<?>> rx.Observable<D> getAndTouch​(String id,
                                                                    int expiry,
                                                                    Class<D> target)
        Description copied from interface: AsyncBucket
        Retrieve and touch a Document by its unique ID. This method differs from AsyncBucket.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 AsyncBucket.get(String, Class), but in addition it touches the document, which will reset its configured expiration time to the value provided. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        target - the target document type to use.
        Returns:
        an Observable eventually containing the found Document.
      • getFromReplica

        public rx.Observable<JsonDocument> getFromReplica​(String id,
                                                          ReplicaMode type)
        Description copied from interface: AsyncBucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
        Specified by:
        getFromReplica in interface AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        type - the ReplicaMode to select.
        Returns:
        an Observable eventually containing zero to N JsonDocuments.
      • getFromReplica

        public <D extends Document<?>> rx.Observable<D> getFromReplica​(D document,
                                                                       ReplicaMode type)
        Description copied from interface: AsyncBucket
        Retrieves one or more, possibly stale, representations of a Document by its unique ID. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. Depending on the ReplicaMode selected, there can be none to four Document be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning Document responses can come in any order. The returned Observable can error under the following conditions: Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
        Specified by:
        getFromReplica in interface AsyncBucket
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        type - the ReplicaMode to select.
        Returns:
        an Observable eventually containing zero to N Documents.
      • getFromReplica

        public <D extends Document<?>> rx.Observable<D> getFromReplica​(String id,
                                                                       ReplicaMode type,
                                                                       Class<D> target)
        Description copied from interface: AsyncBucket
        Retrieves one or more, possibly stale, representations of a Document by its unique ID. This method differs from AsyncBucket.getFromReplica(String, ReplicaMode) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). Depending on the ReplicaMode selected, there can be none to four Document be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning Document responses can come in any order. The returned Observable can error under the following conditions: Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
        Specified by:
        getFromReplica in interface AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        type - the ReplicaMode to select.
        target - the target document type to use.
        Returns:
        an Observable eventually containing zero to N Documents.
      • getFromReplica

        public rx.Observable<JsonDocument> getFromReplica​(String id,
                                                          ReplicaMode type,
                                                          long timeout,
                                                          TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieves one or more, possibly stale, representations of a JsonDocument by its unique ID. Depending on the ReplicaMode selected, there can be none to four JsonDocument be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning JsonDocument responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
        Specified by:
        getFromReplica in interface AsyncBucket
        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:
        an Observable eventually containing zero to N JsonDocuments.
      • getFromReplica

        public <D extends Document<?>> rx.Observable<D> getFromReplica​(D document,
                                                                       ReplicaMode type,
                                                                       long timeout,
                                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieves one or more, possibly stale, representations of a Document by its unique ID. The document ID is taken out of the Document provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. Depending on the ReplicaMode selected, there can be none to four Document be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning Document responses can come in any order. The returned Observable can error under the following conditions: Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
        Specified by:
        getFromReplica in interface AsyncBucket
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        type - the ReplicaMode to select.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing zero to N Documents.
      • getFromReplica

        public <D extends Document<?>> rx.Observable<D> getFromReplica​(String id,
                                                                       ReplicaMode type,
                                                                       Class<D> target,
                                                                       long timeout,
                                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieves one or more, possibly stale, representations of a Document by its unique ID. This method differs from AsyncBucket.getFromReplica(String, ReplicaMode) in that if a specific Document type is passed in, the appropriate Transcoder will be selected (and not JSON conversion). Depending on the ReplicaMode selected, there can be none to four Document be returned from the Observable. If ReplicaMode.FIRST, ReplicaMode.SECOND or ReplicaMode.THIRD are selected zero or one documents are returned, if ReplicaMode.ALL is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriate ReplicateTo constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returning Document responses can come in any order. The returned Observable can error under the following conditions: Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, all errors are swallowed (but logged) and the Observable will return all successful responses.
        Specified by:
        getFromReplica in interface AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        type - the ReplicaMode to select.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing zero to N Documents.
      • getAndLock

        public rx.Observable<JsonDocument> getAndLock​(String id,
                                                      int lockTime,
                                                      long timeout,
                                                      TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        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 AsyncBucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returned Observable can error under the following conditions: - In case of transient error, most probably because key is already locked: TemporaryLockFailureException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        getAndLock in interface AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found JsonDocument.
      • getAndLock

        public <D extends Document<?>> rx.Observable<D> getAndLock​(D document,
                                                                   int lockTime,
                                                                   long timeout,
                                                                   TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieve and lock 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 AsyncBucket.get(Document), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returned Observable can error under the following conditions: - In case of transient error, most probably because key is already locked: TemporaryLockFailureException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        getAndLock in interface AsyncBucket
        Parameters:
        document - the source document from which the ID is taken and the type is inferred.
        lockTime - the time to write lock the document (max. 30 seconds).
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found Document.
      • getAndLock

        public <D extends Document<?>> rx.Observable<D> getAndLock​(String id,
                                                                   int lockTime,
                                                                   Class<D> target,
                                                                   long timeout,
                                                                   TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieve and lock a Document by its unique ID with a custom timeout. This method differs from AsyncBucket.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 AsyncBucket.get(String), but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking for TemporaryLockFailureException. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. The returned Observable can error under the following conditions: - In case of transient error, most probably because key is already locked: TemporaryLockFailureException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        getAndLock in interface AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        lockTime - the time to write lock the document (max. 30 seconds).
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found Document.
      • getAndTouch

        public rx.Observable<JsonDocument> getAndTouch​(String id,
                                                       int expiry,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieve and touch a JsonDocument by its unique ID with a custom timeout. If the document is found, a JsonDocument is returned. If the document is not found, the Observable completes without an item emitted. This method works similar to AsyncBucket.get(String), but in addition it touches the document, which will reset its configured expiration time to the value provided. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found JsonDocument.
      • getAndTouch

        public <D extends Document<?>> rx.Observable<D> getAndTouch​(D document,
                                                                    long timeout,
                                                                    TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        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 AsyncBucket.get(Document), but in addition it touches the document, which will reset its configured expiration time set on the given document itself. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the source document from which the ID and expiry is taken and the type is inferred.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found Document.
      • getAndTouch

        public <D extends Document<?>> rx.Observable<D> getAndTouch​(String id,
                                                                    int expiry,
                                                                    Class<D> target,
                                                                    long timeout,
                                                                    TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Retrieve and touch a Document by its unique ID with a custom timeout. This method differs from AsyncBucket.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 AsyncBucket.get(String, Class), but in addition it touches the document, which will reset its configured expiration time to the value provided. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        id - id the unique ID of the document.
        expiry - the new expiration time for the document.
        target - the target document type to use.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing the found Document.
      • insert

        public <D extends Document<?>> rx.Observable<D> insert​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Insert a Document if it does not exist already and watch for durability constraints. This method works exactly like AsyncBucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        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:
        an Observable eventually containing a new Document.
      • upsert

        public <D extends Document<?>> rx.Observable<D> upsert​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Insert or overwrite a Document and watch for durability constraints. This method works exactly like AsyncBucket.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 AsyncBucket.replace(Document, PersistTo, ReplicateTo) method needs to be used. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a 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 AsyncBucket
        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:
        an Observable eventually containing a new Document.
      • insert

        public <D extends Document<?>> rx.Observable<D> insert​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Insert a Document if it does not exist already and watch for durability constraints. This method works exactly like AsyncBucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • insert

        public <D extends Document<?>> rx.Observable<D> insert​(D document,
                                                               PersistTo persistTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Insert a Document if it does not exist already and watch for durability constraints. This method works exactly like AsyncBucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing a new Document.
      • insert

        public <D extends Document<?>> rx.Observable<D> insert​(D document,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Insert a Document if it does not exist already and watch for durability constraints. This method works exactly like AsyncBucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to insert.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing a new Document.
      • upsert

        public <D extends Document<?>> rx.Observable<D> upsert​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Insert or overwrite a Document and watch for durability constraints. This method works exactly like AsyncBucket.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 AsyncBucket.replace(Document, PersistTo, ReplicateTo) method needs to be used. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • upsert

        public <D extends Document<?>> rx.Observable<D> upsert​(D document,
                                                               PersistTo persistTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Insert or overwrite a Document and watch for durability constraints. This method works exactly like AsyncBucket.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 AsyncBucket.replace(Document, PersistTo) method needs to be used. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing a new Document.
      • upsert

        public <D extends Document<?>> rx.Observable<D> upsert​(D document,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Insert or overwrite a Document and watch for durability constraints. This method works exactly like AsyncBucket.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 AsyncBucket.replace(Document, ReplicateTo) method needs to be used. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the Document to upsert.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing a new Document.
      • replace

        public <D extends Document<?>> rx.Observable<D> replace​(D document,
                                                                PersistTo persistTo,
                                                                ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Replace a Document if it does exist and watch for durability constraints. This method works exactly like AsyncBucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • replace

        public <D extends Document<?>> rx.Observable<D> replace​(D document,
                                                                PersistTo persistTo,
                                                                long timeout,
                                                                TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Replace a Document if it does exist and watch for durability constraints. This method works exactly like AsyncBucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing a new Document.
      • replace

        public <D extends Document<?>> rx.Observable<D> replace​(D document,
                                                                ReplicateTo replicateTo,
                                                                long timeout,
                                                                TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Replace a Document if it does exist and watch for durability constraints. This method works exactly like AsyncBucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to replace.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        an Observable eventually containing a new Document.
      • replace

        public <D extends Document<?>> rx.Observable<D> replace​(D document,
                                                                PersistTo persistTo,
                                                                ReplicateTo replicateTo,
                                                                long timeout,
                                                                TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Replace a Document if it does exist and watch for durability constraints. This method works exactly like AsyncBucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        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:
        an Observable eventually containing a new Document.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(D document,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        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<?>> rx.Observable<D> remove​(String id,
                                                               Class<D> target)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server identified by its ID. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The document to remove does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        id - the id of the document to remove.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public rx.Observable<JsonDocument> remove​(String id,
                                                  PersistTo persistTo,
                                                  ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server by its ID and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The document to remove does not exist: DocumentDoesNotExistException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

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

        public <D extends Document<?>> rx.Observable<D> remove​(D document)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        document - the document to remove, with the ID extracted.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(D document,
                                                               PersistTo persistTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(D document,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        document - the document to remove, with the ID extracted.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        the document containing the ID.
      • remove

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

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

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

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

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

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

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

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

        public rx.Observable<AsyncViewResult> query​(ViewQuery query)
        Description copied from interface: AsyncBucket
        Queries a Couchbase Server View. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the design document or view is not found: ViewDoesNotExistException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the query to perform.
        Returns:
        a result containing all the found rows and additional information.
      • query

        public rx.Observable<AsyncViewResult> query​(ViewQuery query,
                                                    long timeout,
                                                    TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Queries a Couchbase Server View. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the design document or view is not found: ViewDoesNotExistException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the query to perform.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all the found rows and additional information.
      • query

        public rx.Observable<AsyncSearchQueryResult> query​(SearchQuery query)
        Description copied from interface: AsyncBucket
        Queries a Full-Text Index The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the query builder.
        Returns:
        a query result containing the matches and additional information.
      • query

        public rx.Observable<AsyncSearchQueryResult> query​(SearchQuery query,
                                                           long timeout,
                                                           TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Queries a Full-Text Index The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the query builder.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a query result containing the matches and additional information.
      • query

        public rx.Observable<AsyncSpatialViewResult> query​(SpatialViewQuery query,
                                                           long timeout,
                                                           TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Queries a Couchbase Server Spatial View. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - If the design document or view is not found: ViewDoesNotExistException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the spatial query to perform.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all the found rows and additional information.
      • query

        public rx.Observable<AsyncN1qlQueryResult> query​(Statement statement)
        Description copied from interface: AsyncBucket
        Queries a N1QL secondary index with a simple Statement. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        statement - the statement in a DSL form (start with a static select() import).
        Returns:
        a result containing all found rows and additional information.
      • query

        public rx.Observable<AsyncN1qlQueryResult> query​(N1qlQuery query)
        Description copied from interface: AsyncBucket
        Queries a N1QL secondary index. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the full N1qlQuery.
        Returns:
        a result containing all found rows and additional information.
      • query

        public rx.Observable<AsyncN1qlQueryResult> query​(N1qlQuery query,
                                                         long timeout,
                                                         TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Queries a N1QL secondary index with a custom timeout. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the full N1qlQuery.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a result containing all found rows and additional information.
      • query

        public rx.Observable<AsyncAnalyticsQueryResult> query​(AnalyticsQuery query,
                                                              long timeout,
                                                              TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Queries Couchbase Analytics
        Specified by:
        query in interface AsyncBucket
        Parameters:
        query - the query builder.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a query result containing the rows and additional information.
      • counter

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

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        counter in interface AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • touch

        public rx.Observable<Boolean> touch​(String id,
                                            int expiry,
                                            long timeout,
                                            TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Renews the expiration time of a Document. Compared to AsyncBucket.getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. The returned Observable can error under the following conditions: - The document doesn't exist: DocumentDoesNotExistException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        touch in interface AsyncBucket
        Parameters:
        id - the id of the document.
        expiry - the new expiration time. 0 means no expiry.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Boolean indicating if the touch had been successful. (note that unsuccessful touch will rather raise an exception)
      • touch

        public <D extends Document<?>> rx.Observable<Boolean> touch​(D document,
                                                                    long timeout,
                                                                    TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Renews the expiration time of a Document. Compared to AsyncBucket.getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the document to extract the ID and expiry from.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a copy of the document inserted.
      • touch

        public rx.Observable<Boolean> touch​(String id,
                                            int expiry)
        Description copied from interface: AsyncBucket
        Renews the expiration time of a Document. Compared to AsyncBucket.getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. The returned Observable can error under the following conditions: - The document doesn't exist: DocumentDoesNotExistException - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        touch in interface AsyncBucket
        Parameters:
        id - the id of the document.
        expiry - the new expiration time. 0 means no expiry.
        Returns:
        a Boolean indicating if the touch had been successful. (note that unsuccessful touch will rather raise an exception)
      • touch

        public <D extends Document<?>> rx.Observable<Boolean> touch​(D document)
        Description copied from interface: AsyncBucket
        Renews the expiration time of a Document. Compared to AsyncBucket.getAndTouch(Document), this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the document to extract the ID and expiry from.
        Returns:
        a copy of the document inserted.
      • append

        public <D extends Document<?>> rx.Observable<D> append​(D document,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Append a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        append in interface AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> rx.Observable<D> prepend​(D document,
                                                                long timeout,
                                                                TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Prepend a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        prepend in interface AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • bucketManager

        public rx.Observable<AsyncBucketManager> bucketManager()
        Description copied from interface: AsyncBucket
        Provides access to the AsyncBucketManager 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 AsyncBucket
        Returns:
        the bucket manager for administrative operations.
      • insert

        public <D extends Document<?>> rx.Observable<D> insert​(D document,
                                                               PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Insert a Document if it does not exist already and watch for durability constraints. This method works exactly like AsyncBucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to insert.
        persistTo - the persistence constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • insert

        public <D extends Document<?>> rx.Observable<D> insert​(D document,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Insert a Document if it does not exist already and watch for durability constraints. This method works exactly like AsyncBucket.insert(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to insert.
        replicateTo - the replication constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • upsert

        public <D extends Document<?>> rx.Observable<D> upsert​(D document,
                                                               PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Insert or overwrite a Document and watch for durability constraints. This method works exactly like AsyncBucket.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 AsyncBucket.replace(Document, PersistTo) method needs to be used. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the Document to upsert.
        persistTo - the persistence constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • upsert

        public <D extends Document<?>> rx.Observable<D> upsert​(D document,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Insert or overwrite a Document and watch for durability constraints. This method works exactly like AsyncBucket.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 AsyncBucket.replace(Document, ReplicateTo) method needs to be used. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the Document to upsert.
        replicateTo - the replication constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • replace

        public <D extends Document<?>> rx.Observable<D> replace​(D document,
                                                                PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Replace a Document if it does exist and watch for durability constraints. This method works exactly like AsyncBucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to replace.
        persistTo - the persistence constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • replace

        public <D extends Document<?>> rx.Observable<D> replace​(D document,
                                                                ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Replace a Document if it does exist and watch for durability constraints. This method works exactly like AsyncBucket.replace(Document), but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. The returned Observable can error under the following conditions: - The producer outpaces 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 AsyncBucket
        Parameters:
        document - the Document to replace.
        replicateTo - the replication constraint to watch.
        Returns:
        an Observable eventually containing a new Document.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(D document,
                                                               PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        document - the document to remove, with the ID extracted.
        persistTo - the persistence constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(D document,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - A CAS value was set on 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 - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        document - the document to remove, with the ID extracted.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public rx.Observable<JsonDocument> remove​(String id,
                                                  PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server by its ID and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The document to remove does not exist: DocumentDoesNotExistException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public rx.Observable<JsonDocument> remove​(String id,
                                                  ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server by its ID and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The document to remove does not exist: DocumentDoesNotExistException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(String id,
                                                               PersistTo persistTo,
                                                               Class<D> target)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server by its ID and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        id - the id of the document to remove.
        persistTo - the persistence constraint to watch.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • remove

        public <D extends Document<?>> rx.Observable<D> remove​(String id,
                                                               ReplicateTo replicateTo,
                                                               Class<D> target)
        Description copied from interface: AsyncBucket
        Removes a Document from the Server by its ID and apply a durability requirement. The Document returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - The document to remove does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        remove in interface AsyncBucket
        Parameters:
        id - the id of the document to remove.
        replicateTo - the replication constraint to watch.
        target - the target document type to use.
        Returns:
        the document containing the ID.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       PersistTo persistTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       ReplicateTo replicateTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       PersistTo persistTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       ReplicateTo replicateTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry,
                                                       PersistTo persistTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry,
                                                       ReplicateTo replicateTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       PersistTo persistTo,
                                                       ReplicateTo replicateTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       PersistTo persistTo,
                                                       ReplicateTo replicateTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry,
                                                       PersistTo persistTo,
                                                       ReplicateTo replicateTo,
                                                       long timeout,
                                                       TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       PersistTo persistTo,
                                                       ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value or throw an exception if it does not exist yet. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - If the document does not exist: DocumentDoesNotExistException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        counter in interface AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        persistTo - the persistence constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       PersistTo persistTo,
                                                       ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. It is not allowed that the delta value will bring the actual value below zero. The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - Unexpected errors are caught and contained in a generic CouchbaseException.
        Specified by:
        counter in interface AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry,
                                                       PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry,
                                                       ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • counter

        public rx.Observable<JsonLongDocument> counter​(String id,
                                                       long delta,
                                                       long initial,
                                                       int expiry,
                                                       PersistTo persistTo,
                                                       ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Increment or decrement a counter with the given value and a initial value if it does not exist. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or using AsyncBucket.insert(D) to create a JsonLongDocument. The value can also be modified by using AsyncBucket.upsert(D) with JsonLongDocument. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        id - the id of the document.
        delta - the increment or decrement amount.
        initial - the initial value to use if the document does not exist yet.
        expiry - the new expiration time for the document, only used on creation.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a Document containing the resulting value.
      • append

        public <D extends Document<?>> rx.Observable<D> append​(D document,
                                                               PersistTo persistTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Append a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> rx.Observable<D> append​(D document,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Append a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> rx.Observable<D> append​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo,
                                                               long timeout,
                                                               TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Append a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> rx.Observable<D> prepend​(D document,
                                                                PersistTo persistTo,
                                                                long timeout,
                                                                TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Prepend a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> rx.Observable<D> prepend​(D document,
                                                                ReplicateTo replicateTo,
                                                                long timeout,
                                                                TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Prepend a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> rx.Observable<D> prepend​(D document,
                                                                PersistTo persistTo,
                                                                ReplicateTo replicateTo,
                                                                long timeout,
                                                                TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Prepend a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        timeout - the custom timeout.
        timeUnit - the unit for the timeout.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> rx.Observable<D> append​(D document,
                                                               PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Append a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> rx.Observable<D> append​(D document,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Append a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • append

        public <D extends Document<?>> rx.Observable<D> append​(D document,
                                                               PersistTo persistTo,
                                                               ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Append a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the appended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is appended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> rx.Observable<D> prepend​(D document,
                                                                PersistTo persistTo)
        Description copied from interface: AsyncBucket
        Prepend a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> rx.Observable<D> prepend​(D document,
                                                                ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Prepend a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • prepend

        public <D extends Document<?>> rx.Observable<D> prepend​(D document,
                                                                PersistTo persistTo,
                                                                ReplicateTo replicateTo)
        Description copied from interface: AsyncBucket
        Prepend a Documents content to an existing one. The Document returned explicitly has the Document.content() set to null, because the server does not return the prepended result, so at this point the client does not know how the Document now looks like. A separate AsyncBucket.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. The returned Observable can error under the following conditions: - The producer outpaces the SDK: BackpressureException - The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying: RequestCancelledException - The request content is too big: RequestTooBigException - If the document does not exist: DocumentDoesNotExistException - The server is currently not able to process the request, retrying may help: TemporaryFailureException - The server is out of memory: CouchbaseOutOfMemoryException - The durability constraint could not be fulfilled because of a temporary or persistent problem: DurabilityException. - Unexpected errors are caught and contained in a 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 AsyncBucket
        Parameters:
        document - the document, identified by its id, from which the content is prepended to the existing one.
        persistTo - the persistence constraint to watch.
        replicateTo - the replication constraint to watch.
        Returns:
        a document which mirrors the one supplied as an argument.
      • lookupIn

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

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

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

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

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

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

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

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

        public rx.Single<PingReport> ping​(String reportId,
                                          Collection<ServiceType> services,
                                          long timeout,
                                          TimeUnit timeUnit)
        Description copied from interface: AsyncBucket
        Performs a diagnostic active "ping" call against all the services provided with a custom report id. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).
        Specified by:
        ping in interface AsyncBucket
        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.