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.
  • Field Details

    • DEFAULT_VBUCKET_ID

      static final short DEFAULT_VBUCKET_ID
      See Also:
    • 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
    • EXTRAS_LENGTH

      static final byte EXTRAS_LENGTH
      Set,add,replace protocol's extras length
      See Also:
  • Constructor Details

  • Method Details

    • 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:
      getValue in interface StoreCommand
    • setValue

      public final void setValue(Object value)
      Specified by:
      setValue in interface StoreCommand
    • getTranscoder

      public final Transcoder getTranscoder()
      Overrides:
      getTranscoder in class Command
    • setTranscoder

      public final void setTranscoder(Transcoder transcoder)
      Overrides:
      setTranscoder in class Command
    • decode

      public boolean decode(MemcachedTCPSession session, ByteBuffer buffer)
      Specified by:
      decode in class Command
    • finish

      protected boolean finish()
    • readHeader

      protected void readHeader(ByteBuffer buffer)
    • markBuffer

      private void markBuffer(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)
    • readBodyLength

      private int readBodyLength(ByteBuffer buffer)
    • 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)
    • readKeyLength

      private int readKeyLength(ByteBuffer buffer)
    • readExtrasLength

      private int readExtrasLength(ByteBuffer buffer)
    • readDataType

      private byte readDataType(ByteBuffer buffer)
    • readOpCode

      protected boolean readOpCode(ByteBuffer buffer)
    • readMagicNumber

      private void readMagicNumber(ByteBuffer buffer)
    • encode

      public void encode()
      Specified by:
      encode in class Command
    • fillValue

      protected void fillValue(CachedData data)
    • fillKey

      protected void fillKey()
    • fillExtras

      protected void fillExtras(CachedData data)
    • fillHeader

      private void fillHeader(CachedData data)
    • getCasValue

      protected long getCasValue()
    • getValueLength

      protected int getValueLength(CachedData data)
    • getKeyLength

      protected short getKeyLength()
    • getExtrasLength

      protected byte getExtrasLength()