public enum MessageUtil extends Enum<MessageUtil>
| Modifier and Type | Method and Description |
|---|---|
static long |
getCas(io.netty.buffer.ByteBuf buffer) |
static CollectionIdAndKey |
getCollectionIdAndKey(io.netty.buffer.ByteBuf buffer,
boolean collectionsEnabled) |
static io.netty.buffer.ByteBuf |
getContent(io.netty.buffer.ByteBuf buffer)
Returns the message content, uncompressed.
|
static ContentAndXattrs |
getContentAndXattrs(io.netty.buffer.ByteBuf buffer) |
static byte[] |
getContentAsByteArray(io.netty.buffer.ByteBuf buffer)
Returns a new array containing the uncompressed content of the given message.
|
static String |
getContentAsString(io.netty.buffer.ByteBuf buffer) |
static byte |
getDataType(io.netty.buffer.ByteBuf buffer) |
static io.netty.buffer.ByteBuf |
getExtras(io.netty.buffer.ByteBuf buffer) |
static io.netty.buffer.ByteBuf |
getKey(io.netty.buffer.ByteBuf buffer) |
static String |
getKeyAsString(io.netty.buffer.ByteBuf buffer) |
static int |
getOpaque(io.netty.buffer.ByteBuf buffer) |
static int |
getOpcode(io.netty.buffer.ByteBuf buf) |
static io.netty.buffer.ByteBuf |
getRawContent(io.netty.buffer.ByteBuf buffer)
Returns the message content in its original form (possibly compressed).
|
static ResponseStatus |
getResponseStatus(io.netty.buffer.ByteBuf buffer) |
static String |
getShortOpcodeName(io.netty.buffer.ByteBuf buf) |
static String |
getShortOpcodeName(int opcode) |
static short |
getStatus(io.netty.buffer.ByteBuf buffer)
Deprecated.
in favor of
getResponseStatus(ByteBuf) |
static int |
getVbucket(io.netty.buffer.ByteBuf buffer) |
static String |
humanize(io.netty.buffer.ByteBuf buffer)
Dumps the given ByteBuf in the "wire format".
|
static void |
initRequest(byte opcode,
io.netty.buffer.ByteBuf buffer)
Helper method to initialize a request with an opcode.
|
static void |
initResponse(byte opcode,
io.netty.buffer.ByteBuf buffer)
Helper method to initialize a response with an opcode.
|
static boolean |
isComplete(io.netty.buffer.ByteBuf buffer)
Returns true if message can be processed and false if more data is needed.
|
static boolean |
isSnappyCompressed(io.netty.buffer.ByteBuf buffer) |
static boolean |
requiresFlowControlAck(io.netty.buffer.ByteBuf message) |
static void |
setContent(byte[] content,
io.netty.buffer.ByteBuf buffer) |
static void |
setContent(io.netty.buffer.ByteBuf content,
io.netty.buffer.ByteBuf buffer)
Sets the content payload of the buffer, updating the content length as well.
|
static void |
setDataType(byte dataType,
io.netty.buffer.ByteBuf buffer) |
static void |
setExtras(io.netty.buffer.ByteBuf extras,
io.netty.buffer.ByteBuf buffer) |
static void |
setKey(String key,
io.netty.buffer.ByteBuf buffer)
Helper method to set the key, update the key length and the content length.
|
static void |
setOpaque(int opaque,
io.netty.buffer.ByteBuf buffer) |
static void |
setVbucket(int vbucket,
io.netty.buffer.ByteBuf buffer) |
static MessageUtil |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MessageUtil[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final int HEADER_SIZE
public static final byte MAGIC_INT
public static final byte MAGIC_REQ
public static final byte MAGIC_RES
public static final byte MAGIC_SERVER_REQ
public static final byte MAGIC_SERVER_RES
public static final int KEY_LENGTH_OFFSET
public static final int EXTRAS_LENGTH_OFFSET
public static final int DATA_TYPE_OFFSET
public static final int VBUCKET_OFFSET
public static final int BODY_LENGTH_OFFSET
public static final int OPAQUE_OFFSET
public static final int CAS_OFFSET
public static final byte NOOP_OPCODE
public static final byte VERSION_OPCODE
public static final byte HELLO_OPCODE
public static final byte SASL_LIST_MECHS_OPCODE
public static final byte SASL_AUTH_OPCODE
public static final byte SASL_STEP_OPCODE
public static final byte GET_SEQNOS_OPCODE
public static final byte OPEN_CONNECTION_OPCODE
public static final byte DCP_ADD_STREAM_OPCODE
public static final byte DCP_STREAM_CLOSE_OPCODE
public static final byte DCP_STREAM_REQUEST_OPCODE
public static final byte DCP_FAILOVER_LOG_OPCODE
public static final byte DCP_STREAM_END_OPCODE
public static final byte DCP_SNAPSHOT_MARKER_OPCODE
public static final byte DCP_MUTATION_OPCODE
public static final byte DCP_DELETION_OPCODE
public static final byte DCP_EXPIRATION_OPCODE
public static final byte DCP_FLUSH_OPCODE
public static final byte DCP_SET_VBUCKET_STATE_OPCODE
public static final byte DCP_NOOP_OPCODE
public static final byte DCP_BUFFER_ACK_OPCODE
public static final byte DCP_CONTROL_OPCODE
public static final byte DCP_SYSTEM_EVENT_OPCODE
public static final byte DCP_SEQNO_ADVANCED_OPCODE
public static final byte DCP_OSO_SNAPSHOT_MARKER_OPCODE
public static final byte SELECT_BUCKET_OPCODE
public static final byte OBSERVE_SEQNO_OPCODE
public static final byte GET_CLUSTER_CONFIG_OPCODE
public static final byte GET_COLLECTIONS_MANIFEST_OPCODE
public static final byte INTERNAL_ROLLBACK_OPCODE
public static final byte CLUSTERMAP_CHANGE_NOTIFICATION_OPCODE
public static final byte AUTHENTICATE_OPCODE
public static final byte ACTIVE_EXTERNAL_USERS_OPCODE
public static MessageUtil[] values()
for (MessageUtil c : MessageUtil.values()) System.out.println(c);
public static MessageUtil valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static int getOpcode(io.netty.buffer.ByteBuf buf)
public static String getShortOpcodeName(int opcode)
public static String getShortOpcodeName(io.netty.buffer.ByteBuf buf)
public static boolean isComplete(io.netty.buffer.ByteBuf buffer)
public static String humanize(io.netty.buffer.ByteBuf buffer)
Note that the response is undefined if a buffer with a different content than the KV protocol is passed in.
public static void initRequest(byte opcode,
io.netty.buffer.ByteBuf buffer)
public static void initResponse(byte opcode,
io.netty.buffer.ByteBuf buffer)
public static void setExtras(io.netty.buffer.ByteBuf extras,
io.netty.buffer.ByteBuf buffer)
public static io.netty.buffer.ByteBuf getExtras(io.netty.buffer.ByteBuf buffer)
public static void setVbucket(int vbucket,
io.netty.buffer.ByteBuf buffer)
public static int getVbucket(io.netty.buffer.ByteBuf buffer)
public static void setKey(String key, io.netty.buffer.ByteBuf buffer)
public static io.netty.buffer.ByteBuf getKey(io.netty.buffer.ByteBuf buffer)
public static String getKeyAsString(io.netty.buffer.ByteBuf buffer)
public static CollectionIdAndKey getCollectionIdAndKey(io.netty.buffer.ByteBuf buffer, boolean collectionsEnabled)
public static void setContent(io.netty.buffer.ByteBuf content,
io.netty.buffer.ByteBuf buffer)
public static void setContent(byte[] content,
io.netty.buffer.ByteBuf buffer)
public static io.netty.buffer.ByteBuf getRawContent(io.netty.buffer.ByteBuf buffer)
The returned buffer shares its reference count with the given buffer.
public static io.netty.buffer.ByteBuf getContent(io.netty.buffer.ByteBuf buffer)
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.
public static ContentAndXattrs getContentAndXattrs(io.netty.buffer.ByteBuf buffer)
public static boolean isSnappyCompressed(io.netty.buffer.ByteBuf buffer)
public static String getContentAsString(io.netty.buffer.ByteBuf buffer)
public static byte[] getContentAsByteArray(io.netty.buffer.ByteBuf buffer)
If XATTRs were requested, they will be included in the returned byte array.
@Deprecated public static short getStatus(io.netty.buffer.ByteBuf buffer)
getResponseStatus(ByteBuf)public static ResponseStatus getResponseStatus(io.netty.buffer.ByteBuf buffer)
public static boolean requiresFlowControlAck(io.netty.buffer.ByteBuf message)
public static byte getDataType(io.netty.buffer.ByteBuf buffer)
public static void setDataType(byte dataType,
io.netty.buffer.ByteBuf buffer)
public static void setOpaque(int opaque,
io.netty.buffer.ByteBuf buffer)
public static int getOpaque(io.netty.buffer.ByteBuf buffer)
public static long getCas(io.netty.buffer.ByteBuf buffer)
Copyright © 2021 Couchbase, Inc.. All rights reserved.