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
  • 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

      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
    • copiedMergeCount

      private int copiedMergeCount
    • transcoder

      protected Transcoder transcoder
    • noreply

      protected boolean noreply
    • writeFuture

      protected FutureImpl<Boolean> writeFuture
  • Constructor Details

  • Method Details

    • isAdded

      public boolean isAdded()
    • setAdded

      public void setAdded(boolean added)
    • getMessage

      public final Object getMessage()
      Specified by:
      getMessage in interface WriteMessage
    • getWriteBuffer

      public final IoBuffer getWriteBuffer()
      Specified by:
      getWriteBuffer in interface WriteMessage
    • setWriteBuffer

      public void setWriteBuffer(IoBuffer buffers)
      Specified by:
      setWriteBuffer in interface WriteMessage
    • 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()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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(String msg, Throwable e)
    • decodeError

      protected final void decodeError()
    • decodeError

      protected final boolean decodeError(String line)
    • decodeError

      protected final boolean decodeError(Session session, ByteBuffer buffer)
    • getErrorMsg

      private String getErrorMsg(String line, String defaultMsg)
    • isNoreply

      public final boolean isNoreply()
    • setNoreply

      public final void setNoreply(boolean noreply)
    • getWriteFuture

      public FutureImpl<Boolean> getWriteFuture()
      Specified by:
      getWriteFuture in interface WriteMessage
    • setWriteFuture

      public final void setWriteFuture(FutureImpl<Boolean> writeFuture)
    • isWriting

      public final boolean isWriting()
      Specified by:
      isWriting in interface WriteMessage
    • writing

      public final void writing()
      Specified by:
      writing in interface WriteMessage