Interface BinaryMemcacheMessage
- All Superinterfaces:
DecoderResultProvider, MemcacheMessage, MemcacheObject, ReferenceCounted
- All Known Subinterfaces:
BinaryMemcacheRequest, BinaryMemcacheResponse, FullBinaryMemcacheRequest, FullBinaryMemcacheResponse
- All Known Implementing Classes:
AbstractBinaryMemcacheMessage, DefaultBinaryMemcacheRequest, DefaultBinaryMemcacheResponse, DefaultFullBinaryMemcacheRequest, DefaultFullBinaryMemcacheResponse
An interface that defines a binary Memcache message, providing common properties for
BinaryMemcacheRequest and BinaryMemcacheResponse.
A BinaryMemcacheMessage always consists of a header and optional extras or/and
a key.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlongcas()Returns the CAS identifier.bytedataType()Returns the data type of the message.extras()Returns aByteBufrepresentation of the optional extras.byteReturn the extras length of the message.key()Returns the optional key of the document.shortReturns the key length of the message.bytemagic()Returns the magic byte for the message.intopaque()Returns the opaque value.byteopcode()Returns the opcode for the message.retain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.setCas(long cas) Sets the CAS identifier.setDataType(byte dataType) Sets the data type of the message.Sets the extras buffer on the message.Sets the key of the document.setMagic(byte magic) Sets the magic byte.setOpaque(int opaque) Sets the opaque value.setOpcode(byte code) Sets the opcode for the message.setTotalBodyLength(int totalBodyLength) Sets the total body length.intReturns the total body length.touch()Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from interface DecoderResultProvider
decoderResult, setDecoderResultMethods inherited from interface ReferenceCounted
refCnt, release, release
-
Method Details
-
magic
byte magic()Returns the magic byte for the message.- Returns:
- the magic byte.
-
setMagic
Sets the magic byte.- Parameters:
magic- the magic byte to use.- See Also:
-
opcode
byte opcode()Returns the opcode for the message.- Returns:
- the opcode.
-
setOpcode
Sets the opcode for the message.- Parameters:
code- the opcode to use.
-
keyLength
short keyLength()Returns the key length of the message. This may return 0, since the key is optional.- Returns:
- the key length.
-
extrasLength
byte extrasLength()Return the extras length of the message. This may be 0, since the extras content is optional.- Returns:
- the extras length.
-
dataType
byte dataType()Returns the data type of the message.- Returns:
- the data type of the message.
-
setDataType
Sets the data type of the message.- Parameters:
dataType- the data type of the message.
-
totalBodyLength
int totalBodyLength()Returns the total body length. Note that this may be 0, since the body is optional.- Returns:
- the total body length.
-
setTotalBodyLength
Sets the total body length. Note that this may be 0, since the body length is optional.- Parameters:
totalBodyLength- the total body length.
-
opaque
int opaque()Returns the opaque value.- Returns:
- the opaque value.
-
setOpaque
Sets the opaque value.- Parameters:
opaque- the opaque value to use.
-
cas
long cas()Returns the CAS identifier.- Returns:
- the CAS identifier.
-
setCas
Sets the CAS identifier.- Parameters:
cas- the CAS identifier to use.
-
key
-
setKey
Sets the key of the document.ReferenceCounted.release()ownership ofkeyis transferred to thisBinaryMemcacheMessage.- Parameters:
key- the key of the message.ReferenceCounted.release()ownership is transferred to thisBinaryMemcacheMessage.
-
extras
-
setExtras
Sets the extras buffer on the message.ReferenceCounted.release()ownership ofextrasis transferred to thisBinaryMemcacheMessage.- Parameters:
extras- the extras buffer of the document.ReferenceCounted.release()ownership is transferred to thisBinaryMemcacheMessage.
-
retain
BinaryMemcacheMessage retain()Increases the reference count by1.- Specified by:
retainin interfaceMemcacheMessage- Specified by:
retainin interfaceReferenceCounted
-
retain
Increases the reference count by the specifiedincrement.- Specified by:
retainin interfaceMemcacheMessage- Specified by:
retainin interfaceReferenceCounted
-
touch
BinaryMemcacheMessage touch()Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceMemcacheMessage- Specified by:
touchin interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceMemcacheMessage- Specified by:
touchin interfaceReferenceCounted
-