Interface BinaryMemcacheMessage

All Superinterfaces:
MemcacheMessage, MemcacheObject, ReferenceCounted
All Known Subinterfaces:
BinaryMemcacheRequest, BinaryMemcacheResponse, FullBinaryMemcacheRequest, FullBinaryMemcacheResponse
All Known Implementing Classes:
AbstractBinaryMemcacheMessage, DefaultBinaryMemcacheRequest, DefaultBinaryMemcacheResponse, DefaultFullBinaryMemcacheRequest, DefaultFullBinaryMemcacheResponse

public interface BinaryMemcacheMessage
extends MemcacheMessage
An interface that defines a binary Memcache message, providing common properties for BinaryMemcacheRequest and BinaryMemcacheResponse.

A BinaryMemcacheMessage always consists of a header and optional extras or/and a key.
See Also:
BinaryMemcacheRequest, BinaryMemcacheResponse
  • Method Details

    • getMagic

      byte getMagic()
      Returns the magic byte for the message.
      Returns:
      the magic byte.
    • setMagic

      BinaryMemcacheMessage setMagic​(byte magic)
      Sets the magic byte.
      Parameters:
      magic - the magic byte to use.
      See Also:
      for typesafe opcodes.
    • getOpcode

      byte getOpcode()
      Returns the opcode for the message.
      Returns:
      the opcode.
    • setOpcode

      BinaryMemcacheMessage setOpcode​(byte code)
      Sets the opcode for the message.
      Parameters:
      code - the opcode to use.
    • getKeyLength

      short getKeyLength()
      Returns the key length of the message.

      This may return 0, since the key is optional.
      Returns:
      the key length.
    • setKeyLength

      BinaryMemcacheMessage setKeyLength​(short keyLength)
      Set the key length of the message.

      This may be 0, since the key is optional.
      Parameters:
      keyLength - the key length to use.
    • getExtrasLength

      byte getExtrasLength()
      Return the extras length of the message.

      This may be 0, since the extras content is optional.
      Returns:
      the extras length.
    • setExtrasLength

      BinaryMemcacheMessage setExtrasLength​(byte extrasLength)
      Set the extras length of the message.

      This may be 0, since the extras content is optional.
      Parameters:
      extrasLength - the extras length.
    • getDataType

      byte getDataType()
      Returns the data type of the message.
      Returns:
      the data type of the message.
    • setDataType

      BinaryMemcacheMessage setDataType​(byte dataType)
      Sets the data type of the message.
      Parameters:
      dataType - the data type of the message.
    • getTotalBodyLength

      int getTotalBodyLength()
      Returns the total body length.

      Note that this may be 0, since the body is optional.
      Returns:
      the total body length.
    • setTotalBodyLength

      BinaryMemcacheMessage setTotalBodyLength​(int totalBodyLength)
      Sets the total body length.

      Note that this may be 0, since the body length is optional.
      Parameters:
      totalBodyLength - the total body length.
    • getOpaque

      int getOpaque()
      Returns the opaque value.
      Returns:
      the opaque value.
    • setOpaque

      BinaryMemcacheMessage setOpaque​(int opaque)
      Sets the opaque value.
      Parameters:
      opaque - the opqaue value to use.
    • getCAS

      long getCAS()
      Returns the CAS identifier.
      Returns:
      the CAS identifier.
    • setCAS

      BinaryMemcacheMessage setCAS​(long cas)
      Sets the CAS identifier.
      Parameters:
      cas - the CAS identifier to use.
    • getKey

      byte[] getKey()
      Returns the optional key of the document.
      Returns:
      the key of the document.
    • setKey

      BinaryMemcacheMessage setKey​(byte[] key)
      Sets the key of the document.
      Parameters:
      key - the key of the message.
    • getExtras

      ByteBuf getExtras()
      Returns a ByteBuf representation of the optional extras.
      Returns:
      the optional extras.
    • setExtras

      BinaryMemcacheMessage setExtras​(ByteBuf extras)
      Sets the extras buffer on the message.
      Parameters:
      extras - the extras buffer of the document.
    • getFramingExtras

      ByteBuf getFramingExtras()
      Returns a ByteBuf representation of the optional framing extras.
      Returns:
      the optional framing extras.
    • setFramingExtras

      BinaryMemcacheMessage setFramingExtras​(ByteBuf framingExtras)
      Sets the framing extras buffer on the message.
      Parameters:
      framingExtras - the framing extras buffer of the document.
    • getFramingExtrasLength

      byte getFramingExtrasLength()
      Return the framing extras length of the message.

      This may be 0, since the extras content is optional.
      Returns:
      the framing extras length.
    • setFramingExtrasLength

      BinaryMemcacheMessage setFramingExtrasLength​(byte framingExtrasLength)
      Set the framing extras length of the message.

      This may be 0, since the extras content is optional.
      Parameters:
      framingExtrasLength - the framing extras length.