Class BaseBinaryCommand
- java.lang.Object
-
- net.rubyeye.xmemcached.command.Command
-
- net.rubyeye.xmemcached.command.binary.BaseBinaryCommand
-
- All Implemented Interfaces:
WriteMessage,StoreCommand
- Direct Known Subclasses:
BinaryAppendPrependCommand,BinaryAuthListMechanismsCommand,BinaryAuthStartCommand,BinaryAuthStepCommand,BinaryAWSElasticCacheConfigCommand,BinaryCASCommand,BinaryDeleteCommand,BinaryFlushAllCommand,BinaryGetCommand,BinaryGetMultiCommand,BinaryIncrDecrCommand,BinaryNoopCommand,BinaryQuitCommand,BinarySetMultiCommand,BinaryStatsCommand,BinaryStoreCommand,BinaryTouchCommand,BinaryVerbosityCommand,BinaryVersionCommand
public abstract class BaseBinaryCommand extends Command implements StoreCommand
Base Binary command.- Author:
- dennis
-
-
Field Summary
Fields Modifier and Type Field Description protected longcasprotected BinaryDecodeStatusdecodeStatusprotected intexpTimeprotected intopaqueprotected OpCodeopCodeprotected intresponseExtrasLengthprotected intresponseKeyLengthprotected ResponseStatusresponseStatusprotected intresponseTotalBodyLengthprotected Objectvalueprotected shortvbucketId-
Fields inherited from class net.rubyeye.xmemcached.command.Command
cancel, commandType, exception, ioBuffer, key, keyBytes, latch, mergeCount, noreply, REQUEST_MAGIC_NUMBER, RESPONSE_MAGIC_NUMBER, result, status, transcoder, writeFuture
-
-
Constructor Summary
Constructors Constructor Description BaseBinaryCommand(String key, byte[] keyBytes, CommandType cmdType, CountDownLatch latch, int exp, long cas, Object value, boolean noreply, Transcoder transcoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandecode(MemcachedTCPSession session, ByteBuffer buffer)voidencode()protected voidfillExtras(CachedData data)protected voidfillKey()protected voidfillValue(CachedData data)protected booleanfinish()longgetCas()protected longgetCasValue()intgetExpTime()protected bytegetExtrasLength()protected shortgetKeyLength()intgetOpaque()OpCodegetOpCode()ResponseStatusgetResponseStatus()TranscodergetTranscoder()ObjectgetValue()protected intgetValueLength(CachedData data)protected longreadCAS(ByteBuffer buffer)protected booleanreadExtras(ByteBuffer buffer, int extrasLength)protected voidreadHeader(ByteBuffer buffer)protected booleanreadKey(ByteBuffer buffer, int keyLength)protected booleanreadOpaque(ByteBuffer buffer)protected booleanreadOpCode(ByteBuffer buffer)protected voidreadStatus(ByteBuffer buffer)protected booleanreadValue(ByteBuffer buffer, int bodyLength, int keyLength, int extrasLength)voidsetCas(long cas)voidsetExpTime(int exp)voidsetOpaque(int opaque)voidsetOpCode(OpCode opCode)voidsetResponseStatus(ResponseStatus responseStatus)voidsetTranscoder(Transcoder transcoder)voidsetValue(Object value)-
Methods inherited from class net.rubyeye.xmemcached.command.Command
cancel, countDownLatch, decodeError, decodeError, decodeError, decodeError, getCommandType, getCopiedMergeCount, getException, getIoBuffer, getKey, getKeyBytes, getLatch, getMergeCount, getMessage, getResult, getStatus, getWriteBuffer, getWriteFuture, isAdded, isCancel, isNoreply, isWriting, setAdded, setCommandType, setException, setIoBuffer, setKey, setKeyBytes, setLatch, setMergeCount, setNoreply, setResult, setStatus, setWriteBuffer, setWriteFuture, toString, writing
-
-
-
-
Field Detail
-
expTime
protected int expTime
-
cas
protected long cas
-
value
protected Object value
-
opCode
protected OpCode opCode
-
decodeStatus
protected BinaryDecodeStatus decodeStatus
-
responseKeyLength
protected int responseKeyLength
-
responseExtrasLength
protected int responseExtrasLength
-
responseTotalBodyLength
protected int responseTotalBodyLength
-
responseStatus
protected ResponseStatus responseStatus
-
opaque
protected int opaque
-
vbucketId
protected short vbucketId
-
-
Constructor Detail
-
BaseBinaryCommand
public BaseBinaryCommand(String key, byte[] keyBytes, CommandType cmdType, CountDownLatch latch, int exp, long cas, Object value, boolean noreply, Transcoder transcoder)
-
-
Method Detail
-
getExpTime
public final int getExpTime()
-
setExpTime
public final void setExpTime(int exp)
-
getCas
public final long getCas()
-
getOpaque
public int getOpaque()
-
setOpaque
public void setOpaque(int opaque)
-
setCas
public final void setCas(long cas)
-
getValue
public final Object getValue()
- Specified by:
getValuein interfaceStoreCommand
-
setValue
public final void setValue(Object value)
- Specified by:
setValuein interfaceStoreCommand
-
getTranscoder
public final Transcoder getTranscoder()
- Overrides:
getTranscoderin classCommand
-
setTranscoder
public final void setTranscoder(Transcoder transcoder)
- Overrides:
setTranscoderin classCommand
-
decode
public boolean decode(MemcachedTCPSession session, ByteBuffer buffer)
-
finish
protected boolean finish()
-
readHeader
protected void readHeader(ByteBuffer buffer)
-
readOpaque
protected boolean readOpaque(ByteBuffer buffer)
-
readCAS
protected long readCAS(ByteBuffer buffer)
-
readKey
protected boolean readKey(ByteBuffer buffer, int keyLength)
-
readValue
protected boolean readValue(ByteBuffer buffer, int bodyLength, int keyLength, int extrasLength)
-
readExtras
protected boolean readExtras(ByteBuffer buffer, int extrasLength)
-
readStatus
protected void readStatus(ByteBuffer buffer)
-
getOpCode
public final OpCode getOpCode()
-
setOpCode
public final void setOpCode(OpCode opCode)
-
getResponseStatus
public final ResponseStatus getResponseStatus()
-
setResponseStatus
public final void setResponseStatus(ResponseStatus responseStatus)
-
readOpCode
protected boolean readOpCode(ByteBuffer buffer)
-
fillValue
protected void fillValue(CachedData data)
-
fillKey
protected void fillKey()
-
fillExtras
protected void fillExtras(CachedData data)
-
getCasValue
protected long getCasValue()
-
getValueLength
protected int getValueLength(CachedData data)
-
getKeyLength
protected short getKeyLength()
-
getExtrasLength
protected byte getExtrasLength()
-
-