Class CommonDurabilityOptions<SELF extends CommonDurabilityOptions<SELF>>

java.lang.Object
com.couchbase.client.java.CommonOptions<SELF>
com.couchbase.client.java.kv.CommonDurabilityOptions<SELF>
Direct Known Subclasses:
AppendOptions, DecrementOptions, IncrementOptions, InsertOptions, MutateInOptions, PrependOptions, RemoveOptions, ReplaceOptions, UpsertOptions

public abstract class CommonDurabilityOptions<SELF extends CommonDurabilityOptions<SELF>> extends CommonOptions<SELF>
Extends the CommonOptions to also include the durability requirements.
Since:
2.0.0
  • Constructor Details

    • CommonDurabilityOptions

      public CommonDurabilityOptions()
  • Method Details

    • durability

      public SELF durability(PersistTo persistTo, ReplicateTo replicateTo)
      Allows to customize the poll-based durability requirements for this operation.

      Note: if a durability(DurabilityLevel) has been set beforehand it will be set back to DurabilityLevel.NONE, since it is not allowed to use both mechanisms at the same time.

      Parameters:
      persistTo - the durability persistence requirement.
      replicateTo - the durability replication requirement.
      Returns:
      this options builder for chaining purposes.
    • durability

      public SELF durability(DurabilityLevel durabilityLevel)
      Allows to customize the enhanced durability requirements for this operation.

      Note: if a durability(PersistTo, ReplicateTo) has been set beforehand it will be set back to PersistTo.NONE and ReplicateTo.NONE, since it is not allowed to use both mechanisms at the same time.

      Parameters:
      durabilityLevel - the enhanced durability requirement.
      Returns:
      this options builder for chaining purposes.