Class AbstractBinaryMemcacheMessage
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.codec.memcache.AbstractMemcacheObject
-
- io.netty.handler.codec.memcache.binary.AbstractBinaryMemcacheMessage
-
- All Implemented Interfaces:
DecoderResultProvider,BinaryMemcacheMessage,MemcacheMessage,MemcacheObject,ReferenceCounted
- Direct Known Subclasses:
DefaultBinaryMemcacheRequest,DefaultBinaryMemcacheResponse
@UnstableApi public abstract class AbstractBinaryMemcacheMessage extends AbstractMemcacheObject implements BinaryMemcacheMessage
Default implementation of aBinaryMemcacheMessage.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBinaryMemcacheMessage(ByteBuf key, ByteBuf extras)Create a new instance with all properties set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcas()Returns the CAS identifier.bytedataType()Returns the data type of the message.protected voiddeallocate()Called onceAbstractReferenceCounted.refCnt()is equals 0.ByteBufextras()Returns aByteBufrepresentation of the optional extras.byteextrasLength()Return the extras length of the message.ByteBufkey()Returns the optional key of the document.shortkeyLength()Returns 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.BinaryMemcacheMessageretain()Increases the reference count by1.BinaryMemcacheMessageretain(int increment)Increases the reference count by the specifiedincrement.BinaryMemcacheMessagesetCas(long cas)Sets the CAS identifier.BinaryMemcacheMessagesetDataType(byte dataType)Sets the data type of the message.BinaryMemcacheMessagesetExtras(ByteBuf extras)Sets the extras buffer on the message.BinaryMemcacheMessagesetKey(ByteBuf key)Sets the key of the document.BinaryMemcacheMessagesetMagic(byte magic)Sets the magic byte.BinaryMemcacheMessagesetOpaque(int opaque)Sets the opaque value.BinaryMemcacheMessagesetOpcode(byte opcode)Sets the opcode for the message.BinaryMemcacheMessagesetTotalBodyLength(int totalBodyLength)Sets the total body length.inttotalBodyLength()Returns the total body length.BinaryMemcacheMessagetouch()Records the current access location of this object for debugging purposes.BinaryMemcacheMessagetouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from class io.netty.handler.codec.memcache.AbstractMemcacheObject
decoderResult, setDecoderResult
-
Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, release, release, setRefCnt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
-
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt, release, release
-
-
-
-
Method Detail
-
key
public ByteBuf key()
Description copied from interface:BinaryMemcacheMessageReturns the optional key of the document.- Specified by:
keyin interfaceBinaryMemcacheMessage- Returns:
- the key of the document.
-
extras
public ByteBuf extras()
Description copied from interface:BinaryMemcacheMessageReturns aByteBufrepresentation of the optional extras.- Specified by:
extrasin interfaceBinaryMemcacheMessage- Returns:
- the optional extras.
-
setKey
public BinaryMemcacheMessage setKey(ByteBuf key)
Description copied from interface:BinaryMemcacheMessageSets the key of the document.ReferenceCounted.release()ownership ofkeyis transferred to thisBinaryMemcacheMessage.- Specified by:
setKeyin interfaceBinaryMemcacheMessage- Parameters:
key- the key of the message.ReferenceCounted.release()ownership is transferred to thisBinaryMemcacheMessage.
-
setExtras
public BinaryMemcacheMessage setExtras(ByteBuf extras)
Description copied from interface:BinaryMemcacheMessageSets the extras buffer on the message.ReferenceCounted.release()ownership ofextrasis transferred to thisBinaryMemcacheMessage.- Specified by:
setExtrasin interfaceBinaryMemcacheMessage- Parameters:
extras- the extras buffer of the document.ReferenceCounted.release()ownership is transferred to thisBinaryMemcacheMessage.
-
magic
public byte magic()
Description copied from interface:BinaryMemcacheMessageReturns the magic byte for the message.- Specified by:
magicin interfaceBinaryMemcacheMessage- Returns:
- the magic byte.
-
setMagic
public BinaryMemcacheMessage setMagic(byte magic)
Description copied from interface:BinaryMemcacheMessageSets the magic byte.- Specified by:
setMagicin interfaceBinaryMemcacheMessage- Parameters:
magic- the magic byte to use.- See Also:
for typesafe opcodes.
-
cas
public long cas()
Description copied from interface:BinaryMemcacheMessageReturns the CAS identifier.- Specified by:
casin interfaceBinaryMemcacheMessage- Returns:
- the CAS identifier.
-
setCas
public BinaryMemcacheMessage setCas(long cas)
Description copied from interface:BinaryMemcacheMessageSets the CAS identifier.- Specified by:
setCasin interfaceBinaryMemcacheMessage- Parameters:
cas- the CAS identifier to use.
-
opaque
public int opaque()
Description copied from interface:BinaryMemcacheMessageReturns the opaque value.- Specified by:
opaquein interfaceBinaryMemcacheMessage- Returns:
- the opaque value.
-
setOpaque
public BinaryMemcacheMessage setOpaque(int opaque)
Description copied from interface:BinaryMemcacheMessageSets the opaque value.- Specified by:
setOpaquein interfaceBinaryMemcacheMessage- Parameters:
opaque- the opaque value to use.
-
totalBodyLength
public int totalBodyLength()
Description copied from interface:BinaryMemcacheMessageReturns the total body length. Note that this may be 0, since the body is optional.- Specified by:
totalBodyLengthin interfaceBinaryMemcacheMessage- Returns:
- the total body length.
-
setTotalBodyLength
public BinaryMemcacheMessage setTotalBodyLength(int totalBodyLength)
Description copied from interface:BinaryMemcacheMessageSets the total body length. Note that this may be 0, since the body length is optional.- Specified by:
setTotalBodyLengthin interfaceBinaryMemcacheMessage- Parameters:
totalBodyLength- the total body length.
-
dataType
public byte dataType()
Description copied from interface:BinaryMemcacheMessageReturns the data type of the message.- Specified by:
dataTypein interfaceBinaryMemcacheMessage- Returns:
- the data type of the message.
-
setDataType
public BinaryMemcacheMessage setDataType(byte dataType)
Description copied from interface:BinaryMemcacheMessageSets the data type of the message.- Specified by:
setDataTypein interfaceBinaryMemcacheMessage- Parameters:
dataType- the data type of the message.
-
extrasLength
public byte extrasLength()
Description copied from interface:BinaryMemcacheMessageReturn the extras length of the message. This may be 0, since the extras content is optional.- Specified by:
extrasLengthin interfaceBinaryMemcacheMessage- Returns:
- the extras length.
-
keyLength
public short keyLength()
Description copied from interface:BinaryMemcacheMessageReturns the key length of the message. This may return 0, since the key is optional.- Specified by:
keyLengthin interfaceBinaryMemcacheMessage- Returns:
- the key length.
-
opcode
public byte opcode()
Description copied from interface:BinaryMemcacheMessageReturns the opcode for the message.- Specified by:
opcodein interfaceBinaryMemcacheMessage- Returns:
- the opcode.
-
setOpcode
public BinaryMemcacheMessage setOpcode(byte opcode)
Description copied from interface:BinaryMemcacheMessageSets the opcode for the message.- Specified by:
setOpcodein interfaceBinaryMemcacheMessage- Parameters:
opcode- the opcode to use.
-
retain
public BinaryMemcacheMessage retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceBinaryMemcacheMessage- Specified by:
retainin interfaceMemcacheMessage- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
retain
public BinaryMemcacheMessage retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceBinaryMemcacheMessage- Specified by:
retainin interfaceMemcacheMessage- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
deallocate
protected void deallocate()
Description copied from class:AbstractReferenceCountedCalled onceAbstractReferenceCounted.refCnt()is equals 0.- Specified by:
deallocatein classAbstractReferenceCounted
-
touch
public 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 interfaceBinaryMemcacheMessage- Specified by:
touchin interfaceMemcacheMessage- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractReferenceCounted
-
touch
public BinaryMemcacheMessage touch(java.lang.Object hint)
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 interfaceBinaryMemcacheMessage- Specified by:
touchin interfaceMemcacheMessage- Specified by:
touchin interfaceReferenceCounted
-
-