Package net.rubyeye.xmemcached.command
Class Command
- java.lang.Object
-
- net.rubyeye.xmemcached.command.Command
-
- All Implemented Interfaces:
WriteMessage
- Direct Known Subclasses:
BaseBinaryCommand,TextAWSElasticCacheConfigCommand,TextCacheDumpCommand,TextDeleteCommand,TextFlushAllCommand,TextGetCommand,TextIncrDecrCommand,TextQuitCommand,TextStatsCommand,TextStoreCommand,TextTouchCommand,TextVersionCommand,VerbosityCommand
public abstract class Command extends Object implements WriteMessage
Abstract Memcached Command- Author:
- dennis
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancancelprotected CommandTypecommandTypeprotected Exceptionexceptionprotected IoBufferioBufferprotected Stringkeyprotected byte[]keyBytesprotected CountDownLatchlatchprotected intmergeCountprotected booleannoreplystatic byteREQUEST_MAGIC_NUMBERstatic byteRESPONSE_MAGIC_NUMBERprotected Objectresultprotected OperationStatusstatusprotected Transcodertranscoderprotected FutureImpl<Boolean>writeFuture
-
Constructor Summary
Constructors Constructor Description Command()Command(String key, byte[] keyBytes, CountDownLatch latch)Command(String key, byte[] keyBytes, CommandType cmdType, CountDownLatch latch)Command(String key, CommandType commandType, CountDownLatch latch)Command(CommandType cmdType)Command(CommandType cmdType, CountDownLatch latch)
-
Method Summary
-
-
-
Field Detail
-
REQUEST_MAGIC_NUMBER
public static final byte REQUEST_MAGIC_NUMBER
- See Also:
- Constant Field Values
-
RESPONSE_MAGIC_NUMBER
public static final byte RESPONSE_MAGIC_NUMBER
- See Also:
- Constant Field Values
-
key
protected String key
-
keyBytes
protected byte[] keyBytes
-
result
protected Object result
-
latch
protected CountDownLatch latch
-
commandType
protected CommandType commandType
-
exception
protected Exception exception
-
ioBuffer
protected IoBuffer ioBuffer
-
cancel
protected volatile boolean cancel
-
status
protected OperationStatus status
-
mergeCount
protected int mergeCount
-
transcoder
protected Transcoder transcoder
-
noreply
protected boolean noreply
-
writeFuture
protected FutureImpl<Boolean> writeFuture
-
-
Constructor Detail
-
Command
public Command()
-
Command
public Command(String key, byte[] keyBytes, CountDownLatch latch)
-
Command
public Command(String key, byte[] keyBytes, CommandType cmdType, CountDownLatch latch)
-
Command
public Command(CommandType cmdType)
-
Command
public Command(CommandType cmdType, CountDownLatch latch)
-
Command
public Command(String key, CommandType commandType, CountDownLatch latch)
-
-
Method Detail
-
isAdded
public boolean isAdded()
-
setAdded
public void setAdded(boolean added)
-
getMessage
public final Object getMessage()
- Specified by:
getMessagein interfaceWriteMessage
-
getWriteBuffer
public final IoBuffer getWriteBuffer()
- Specified by:
getWriteBufferin interfaceWriteMessage
-
setWriteBuffer
public void setWriteBuffer(IoBuffer buffers)
- Specified by:
setWriteBufferin interfaceWriteMessage
-
getKeyBytes
public final byte[] getKeyBytes()
-
setKeyBytes
public final void setKeyBytes(byte[] keyBytes)
-
setCommandType
public void setCommandType(CommandType commandType)
-
getMergeCount
public int getMergeCount()
-
getTranscoder
public Transcoder getTranscoder()
-
setTranscoder
public void setTranscoder(Transcoder transcoder)
-
setMergeCount
public void setMergeCount(int mergetCount)
-
getCopiedMergeCount
public int getCopiedMergeCount()
-
getStatus
public OperationStatus getStatus()
-
setStatus
public final void setStatus(OperationStatus status)
-
setIoBuffer
public final void setIoBuffer(IoBuffer ioBuffer)
-
getException
public Exception getException()
-
setException
public void setException(Exception throwable)
-
getKey
public final String getKey()
-
setKey
public final void setKey(String key)
-
getResult
public final Object getResult()
-
setResult
public final void setResult(Object result)
-
getIoBuffer
public final IoBuffer getIoBuffer()
-
isCancel
public boolean isCancel()
-
cancel
public final void cancel()
-
getLatch
public final CountDownLatch getLatch()
-
countDownLatch
public final void countDownLatch()
-
getCommandType
public final CommandType getCommandType()
-
setLatch
public final void setLatch(CountDownLatch latch)
-
encode
public abstract void encode()
-
decode
public abstract boolean decode(MemcachedTCPSession session, ByteBuffer buffer)
-
decodeError
protected final void decodeError()
-
decodeError
protected final boolean decodeError(String line)
-
decodeError
protected final boolean decodeError(Session session, ByteBuffer buffer)
-
isNoreply
public final boolean isNoreply()
-
setNoreply
public final void setNoreply(boolean noreply)
-
getWriteFuture
public FutureImpl<Boolean> getWriteFuture()
- Specified by:
getWriteFuturein interfaceWriteMessage
-
setWriteFuture
public final void setWriteFuture(FutureImpl<Boolean> writeFuture)
-
isWriting
public final boolean isWriting()
- Specified by:
isWritingin interfaceWriteMessage
-
writing
public final void writing()
- Specified by:
writingin interfaceWriteMessage
-
-