Class UpsertRequest

All Implemented Interfaces:
CouchbaseMessage, CouchbaseRequest, BinaryRequest, BinaryStoreRequest

public class UpsertRequest
extends AbstractKeyValueRequest
implements BinaryStoreRequest
Insert or update a document.
Since:
1.0
Author:
Michael Nitschinger
  • Constructor Details

    • UpsertRequest

      public UpsertRequest​(String key, ByteBuf content, String bucket, boolean json)
    • UpsertRequest

      public UpsertRequest​(String key, ByteBuf content, String bucket)
      Creates a new UpsertRequest.
      Parameters:
      key - the key of the document.
      content - the content of the document.
      bucket - the name of the bucket.
    • UpsertRequest

      public UpsertRequest​(String key, ByteBuf content, int exp, int flags, String bucket)
    • UpsertRequest

      public UpsertRequest​(String key, ByteBuf content, int exp, int flags, String bucket, boolean json)
      Creates a new UpsertRequest.
      Parameters:
      key - the key of the document.
      content - the content of the document.
      exp - the expiration time.
      flags - optional flags.
      bucket - the the name of the bucket.
  • Method Details

    • expiration

      public int expiration()
      Returns the expiration time for this document.
      Specified by:
      expiration in interface BinaryStoreRequest
      Returns:
      the expiration time.
    • flags

      public int flags()
      Returns the flags for this document.
      Specified by:
      flags in interface BinaryStoreRequest
      Returns:
      the flags.
    • content

      public ByteBuf content()
      The content of the document.
      Specified by:
      content in interface BinaryStoreRequest
      Returns:
      the content.
    • isJson

      public boolean isJson()
      Specified by:
      isJson in interface BinaryStoreRequest