Class InsertRequest

All Implemented Interfaces:
CouchbaseMessage, CouchbaseRequest, BinaryRequest, BinaryStoreRequest

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

    • InsertRequest

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

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

      public InsertRequest​(String key, ByteBuf content, int exp, int flags, String bucket, boolean json)
      Creates a new InsertRequest.
      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.
    • InsertRequest

      public InsertRequest​(String key, ByteBuf content, int exp, int flags, String 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