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
Abstract Memcached Command
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
protected boolean
protected CommandType
private int
protected Exception
protected IoBuffer
protected String
protected byte[]
protected CountDownLatch
protected int
protected boolean
static final byte
static final byte
protected Object
protected OperationStatus
protected Transcoder
protected FutureImpl
<Boolean> -
Constructor Summary
ConstructorsConstructorDescriptionCommand()
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
Modifier and TypeMethodDescriptionfinal void
cancel()
final void
abstract boolean
decode
(MemcachedTCPSession session, ByteBuffer buffer) protected final void
protected final boolean
decodeError
(Session session, ByteBuffer buffer) protected final boolean
decodeError
(String line) protected final void
decodeError
(String msg, Throwable e) abstract void
encode()
final CommandType
int
private String
getErrorMsg
(String line, String defaultMsg) final IoBuffer
final String
getKey()
final byte[]
final CountDownLatch
getLatch()
int
final Object
final Object
final IoBuffer
boolean
isAdded()
boolean
isCancel()
final boolean
final boolean
void
setAdded
(boolean added) void
setCommandType
(CommandType commandType) void
setException
(Exception throwable) final void
setIoBuffer
(IoBuffer ioBuffer) final void
final void
setKeyBytes
(byte[] keyBytes) final void
setLatch
(CountDownLatch latch) void
setMergeCount
(int mergetCount) final void
setNoreply
(boolean noreply) final void
final void
setStatus
(OperationStatus status) void
setTranscoder
(Transcoder transcoder) void
setWriteBuffer
(IoBuffer buffers) final void
setWriteFuture
(FutureImpl<Boolean> writeFuture) toString()
final void
writing()
-
Field Details
-
REQUEST_MAGIC_NUMBER
public static final byte REQUEST_MAGIC_NUMBER- See Also:
-
RESPONSE_MAGIC_NUMBER
public static final byte RESPONSE_MAGIC_NUMBER- See Also:
-
added
private boolean added -
key
-
keyBytes
protected byte[] keyBytes -
result
-
latch
-
commandType
-
exception
-
ioBuffer
-
cancel
protected volatile boolean cancel -
status
-
mergeCount
protected int mergeCount -
copiedMergeCount
private int copiedMergeCount -
transcoder
-
noreply
protected boolean noreply -
writeFuture
-
-
Constructor Details
-
Command
public Command() -
Command
-
Command
-
Command
-
Command
-
Command
-
-
Method Details
-
isAdded
public boolean isAdded() -
setAdded
public void setAdded(boolean added) -
getMessage
- Specified by:
getMessage
in interfaceWriteMessage
-
getWriteBuffer
- Specified by:
getWriteBuffer
in interfaceWriteMessage
-
setWriteBuffer
- Specified by:
setWriteBuffer
in interfaceWriteMessage
-
getKeyBytes
public final byte[] getKeyBytes() -
setKeyBytes
public final void setKeyBytes(byte[] keyBytes) -
setCommandType
-
getMergeCount
public int getMergeCount() -
getTranscoder
-
setTranscoder
-
setMergeCount
public void setMergeCount(int mergetCount) -
getCopiedMergeCount
public int getCopiedMergeCount() -
getStatus
-
setStatus
-
setIoBuffer
-
getException
-
setException
-
getKey
-
setKey
-
getResult
-
setResult
-
getIoBuffer
-
toString
-
isCancel
public boolean isCancel() -
cancel
public final void cancel() -
getLatch
-
countDownLatch
public final void countDownLatch() -
getCommandType
-
setLatch
-
encode
public abstract void encode() -
decode
-
decodeError
-
decodeError
protected final void decodeError() -
decodeError
-
decodeError
-
getErrorMsg
-
isNoreply
public final boolean isNoreply() -
setNoreply
public final void setNoreply(boolean noreply) -
getWriteFuture
- Specified by:
getWriteFuture
in interfaceWriteMessage
-
setWriteFuture
-
isWriting
public final boolean isWriting()- Specified by:
isWriting
in interfaceWriteMessage
-
writing
public final void writing()- Specified by:
writing
in interfaceWriteMessage
-