public interface BinaryMemcacheMessage extends MemcacheMessage
An interface that defines a binary Memcache message, providing common properties for BinaryMemcacheRequest
and BinaryMemcacheResponse
.
BinaryMemcacheMessage
always consists of a header and optional extras or/and a key.BinaryMemcacheRequest
,
BinaryMemcacheResponse
Modifier and Type | Method and Description |
---|---|
long |
getCAS()
Returns the CAS identifier.
|
byte |
getDataType()
Returns the data type of the message.
|
ByteBuf |
getExtras()
Returns a
ByteBuf representation of the optional extras. |
byte |
getExtrasLength()
Return the extras length of the message.
|
ByteBuf |
getFramingExtras()
Returns a
ByteBuf representation of the optional framing extras. |
byte |
getFramingExtrasLength()
Return the framing extras length of the message.
|
byte[] |
getKey()
Returns the optional key of the document.
|
short |
getKeyLength()
Returns the key length of the message.
|
byte |
getMagic()
Returns the magic byte for the message.
|
int |
getOpaque()
Returns the opaque value.
|
byte |
getOpcode()
Returns the opcode for the message.
|
int |
getTotalBodyLength()
Returns the total body length.
|
BinaryMemcacheMessage |
setCAS(long cas)
Sets the CAS identifier.
|
BinaryMemcacheMessage |
setDataType(byte dataType)
Sets the data type of the message.
|
BinaryMemcacheMessage |
setExtras(ByteBuf extras)
Sets the extras buffer on the message.
|
BinaryMemcacheMessage |
setExtrasLength(byte extrasLength)
Set the extras length of the message.
|
BinaryMemcacheMessage |
setFramingExtras(ByteBuf framingExtras)
Sets the framing extras buffer on the message.
|
BinaryMemcacheMessage |
setFramingExtrasLength(byte framingExtrasLength)
Set the framing extras length of the message.
|
BinaryMemcacheMessage |
setKey(byte[] key)
Sets the key of the document.
|
BinaryMemcacheMessage |
setKeyLength(short keyLength)
Set the key length of the message.
|
BinaryMemcacheMessage |
setMagic(byte magic)
Sets the magic byte.
|
BinaryMemcacheMessage |
setOpaque(int opaque)
Sets the opaque value.
|
BinaryMemcacheMessage |
setOpcode(byte code)
Sets the opcode for the message.
|
BinaryMemcacheMessage |
setTotalBodyLength(int totalBodyLength)
Sets the total body length.
|
getDecoderResult, setDecoderResult
byte getMagic()
Returns the magic byte for the message.
BinaryMemcacheMessage setMagic(byte magic)
Sets the magic byte.
magic
- the magic byte to use.for typesafe opcodes.
byte getOpcode()
Returns the opcode for the message.
BinaryMemcacheMessage setOpcode(byte code)
Sets the opcode for the message.
code
- the opcode to use.short getKeyLength()
Returns the key length of the message.
This may return 0, since the key is optional.BinaryMemcacheMessage setKeyLength(short keyLength)
Set the key length of the message.
This may be 0, since the key is optional.keyLength
- the key length to use.byte getExtrasLength()
Return the extras length of the message.
This may be 0, since the extras content is optional.BinaryMemcacheMessage setExtrasLength(byte extrasLength)
Set the extras length of the message.
This may be 0, since the extras content is optional.extrasLength
- the extras length.byte getDataType()
Returns the data type of the message.
BinaryMemcacheMessage setDataType(byte dataType)
Sets the data type of the message.
dataType
- the data type of the message.int getTotalBodyLength()
Returns the total body length.
Note that this may be 0, since the body is optional.BinaryMemcacheMessage setTotalBodyLength(int totalBodyLength)
Sets the total body length.
Note that this may be 0, since the body length is optional.totalBodyLength
- the total body length.int getOpaque()
Returns the opaque value.
BinaryMemcacheMessage setOpaque(int opaque)
Sets the opaque value.
opaque
- the opqaue value to use.long getCAS()
Returns the CAS identifier.
BinaryMemcacheMessage setCAS(long cas)
Sets the CAS identifier.
cas
- the CAS identifier to use.byte[] getKey()
Returns the optional key of the document.
BinaryMemcacheMessage setKey(byte[] key)
Sets the key of the document.
key
- the key of the message.ByteBuf getExtras()
Returns a ByteBuf
representation of the optional extras.
BinaryMemcacheMessage setExtras(ByteBuf extras)
Sets the extras buffer on the message.
extras
- the extras buffer of the document.ByteBuf getFramingExtras()
Returns a ByteBuf
representation of the optional framing extras.
BinaryMemcacheMessage setFramingExtras(ByteBuf framingExtras)
Sets the framing extras buffer on the message.
framingExtras
- the framing extras buffer of the document.byte getFramingExtrasLength()
Return the framing extras length of the message.
This may be 0, since the extras content is optional.BinaryMemcacheMessage setFramingExtrasLength(byte framingExtrasLength)
Set the framing extras length of the message.
This may be 0, since the extras content is optional.framingExtrasLength
- the framing extras length.Copyright © 2018 Couchbase, Inc.. All rights reserved.