Enum MessageUtil

java.lang.Object
java.lang.Enum<MessageUtil>
com.couchbase.client.dcp.message.MessageUtil
All Implemented Interfaces:
Serializable, Comparable<MessageUtil>

public enum MessageUtil extends Enum<MessageUtil>
  • Field Details

  • Method Details

    • values

      public static MessageUtil[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static MessageUtil valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getOpcode

      public static int getOpcode(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
    • getShortOpcodeName

      public static String getShortOpcodeName(int opcode)
    • getShortOpcodeName

      public static String getShortOpcodeName(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
    • isComplete

      public static boolean isComplete(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Returns true if message can be processed and false if more data is needed.
    • humanize

      public static String humanize(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Dumps the given ByteBuf in the "wire format".

      Note that the response is undefined if a buffer with a different content than the KV protocol is passed in.

      Returns:
      the String ready to be printed/logged.
    • initRequest

      public static void initRequest(byte opcode, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Helper method to initialize a request with an opcode.
    • initResponse

      public static void initResponse(byte opcode, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Helper method to initialize a response with an opcode.
    • setExtras

      public static void setExtras(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf extras, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getExtras

      public static com.couchbase.client.core.deps.io.netty.buffer.ByteBuf getExtras(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • setVbucket

      public static void setVbucket(int vbucket, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getVbucket

      public static int getVbucket(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • setKey

      public static void setKey(String key, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Helper method to set the key, update the key length and the content length.
    • getKey

      public static com.couchbase.client.core.deps.io.netty.buffer.ByteBuf getKey(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getKeyAsString

      public static String getKeyAsString(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getCollectionIdAndKey

      public static CollectionIdAndKey getCollectionIdAndKey(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer, boolean collectionsEnabled)
    • setContent

      public static void setContent(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf content, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Sets the content payload of the buffer, updating the content length as well.
    • setContent

      public static void setContent(byte[] content, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getRawContent

      public static com.couchbase.client.core.deps.io.netty.buffer.ByteBuf getRawContent(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Returns the message content in its original form (possibly compressed).

      The returned buffer shares its reference count with the given buffer.

    • getContent

      public static com.couchbase.client.core.deps.io.netty.buffer.ByteBuf getContent(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Returns the message content, uncompressed.

      Callers need not release the returned buffer, since it either shares its reference count with the given buffer, or is unpooled and not leak-aware.

      If XATTRs were requested, they will be included in the returned buffer.

    • getContentAndXattrs

      public static ContentAndXattrs getContentAndXattrs(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • isSnappyCompressed

      public static boolean isSnappyCompressed(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getContentAsString

      public static String getContentAsString(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getContentAsByteArray

      public static byte[] getContentAsByteArray(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Returns a new array containing the uncompressed content of the given message.

      If XATTRs were requested, they will be included in the returned byte array.

    • getStatus

      @Deprecated public static short getStatus(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
      Deprecated.
    • getResponseStatus

      public static ResponseStatus getResponseStatus(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • requiresFlowControlAck

      public static boolean requiresFlowControlAck(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf message)
    • getDataType

      public static byte getDataType(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • setDataType

      public static void setDataType(byte dataType, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • setOpaque

      public static void setOpaque(int opaque, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getOpaque

      public static int getOpaque(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)
    • getCas

      public static long getCas(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buffer)