Class DefaultBinaryMemcacheResponse
java.lang.Object
io.netty.util.AbstractReferenceCounted
io.netty.handler.codec.memcache.AbstractMemcacheObject
io.netty.handler.codec.memcache.binary.AbstractBinaryMemcacheMessage
io.netty.handler.codec.memcache.binary.DefaultBinaryMemcacheResponse
- All Implemented Interfaces:
DecoderResultProvider, BinaryMemcacheMessage, BinaryMemcacheResponse, MemcacheMessage, MemcacheObject, ReferenceCounted
- Direct Known Subclasses:
DefaultFullBinaryMemcacheResponse
@UnstableApi
public class DefaultBinaryMemcacheResponse
extends AbstractBinaryMemcacheMessage
implements BinaryMemcacheResponse
The default implementation of the
BinaryMemcacheResponse.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteDefault magic byte for a request. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newDefaultBinaryMemcacheResponsewith the header only.Create a newDefaultBinaryMemcacheResponsewith the header and key.DefaultBinaryMemcacheResponse(ByteBuf key, ByteBuf extras) Create a newDefaultBinaryMemcacheResponsewith the header, key and extras. -
Method Summary
Modifier and TypeMethodDescriptionretain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.setStatus(short status) Sets the status of the response.shortstatus()Returns the status of the response.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 class AbstractBinaryMemcacheMessage
cas, dataType, deallocate, extras, extrasLength, key, keyLength, magic, opaque, opcode, setCas, setDataType, setExtras, setKey, setMagic, setOpaque, setOpcode, setTotalBodyLength, totalBodyLengthModifier and TypeMethodDescriptionlongcas()Returns the CAS identifier.bytedataType()Returns the data type of the message.protected voidCalled onceAbstractReferenceCounted.refCnt()is equals 0.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.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 opcode) Sets the opcode for the message.setTotalBodyLength(int totalBodyLength) Sets the total body length.intReturns the total body length.Methods inherited from class AbstractMemcacheObject
decoderResult, setDecoderResultModifier and TypeMethodDescriptionReturns the result of decoding this object.voidsetDecoderResult(DecoderResult result) Updates the result of decoding this object.Methods inherited from class AbstractReferenceCounted
refCnt, release, release, setRefCntModifier and TypeMethodDescriptionintrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement) Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.protected final voidsetRefCnt(int refCnt) An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly
-
Field Details
-
RESPONSE_MAGIC_BYTE
public static final byte RESPONSE_MAGIC_BYTEDefault magic byte for a request.- See Also:
-
-
Constructor Details
-
DefaultBinaryMemcacheResponse
public DefaultBinaryMemcacheResponse()Create a newDefaultBinaryMemcacheResponsewith the header only. -
DefaultBinaryMemcacheResponse
Create a newDefaultBinaryMemcacheResponsewith the header and key.- Parameters:
key- the key to use.
-
DefaultBinaryMemcacheResponse
Create a newDefaultBinaryMemcacheResponsewith the header, key and extras.- Parameters:
key- the key to use.extras- the extras to use.
-
-
Method Details
-
status
public short status()Description copied from interface:BinaryMemcacheResponseReturns the status of the response.- Specified by:
statusin interfaceBinaryMemcacheResponse- Returns:
- the status of the response.
-
setStatus
Description copied from interface:BinaryMemcacheResponseSets the status of the response.- Specified by:
setStatusin interfaceBinaryMemcacheResponse- Parameters:
status- the status to set.
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceBinaryMemcacheMessage- Specified by:
retainin interfaceBinaryMemcacheResponse- Specified by:
retainin interfaceMemcacheMessage- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractBinaryMemcacheMessage
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceBinaryMemcacheMessage- Specified by:
retainin interfaceBinaryMemcacheResponse- Specified by:
retainin interfaceMemcacheMessage- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractBinaryMemcacheMessage
-
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 interfaceBinaryMemcacheResponse- Specified by:
touchin interfaceMemcacheMessage- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractBinaryMemcacheMessage
-
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 interfaceBinaryMemcacheMessage- Specified by:
touchin interfaceBinaryMemcacheResponse- Specified by:
touchin interfaceMemcacheMessage- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractBinaryMemcacheMessage
-