Class AbstractBinaryMemcacheDecoder<M extends BinaryMemcacheMessage>

    • Constructor Detail

      • AbstractBinaryMemcacheDecoder

        protected AbstractBinaryMemcacheDecoder​(int chunkSize)
        Create a new AbstractBinaryMemcacheDecoder with custom settings.
        Parameters:
        chunkSize - the maximum chunk size of the payload.
    • Method Detail

      • invalidMessage

        private M invalidMessage​(java.lang.Exception cause)
        Helper method to create a message indicating a invalid decoding result.
        Parameters:
        cause - the cause of the decoding failure.
        Returns:
        a valid message indicating failure.
      • invalidChunk

        private MemcacheContent invalidChunk​(java.lang.Exception cause)
        Helper method to create a content chunk indicating a invalid decoding result.
        Parameters:
        cause - the cause of the decoding failure.
        Returns:
        a valid content chunk indicating failure.
      • resetDecoder

        protected void resetDecoder()
        Prepare for next decoding iteration.
      • decodeHeader

        protected abstract M decodeHeader​(ByteBuf in)
        Decode and return the parsed BinaryMemcacheMessage.
        Parameters:
        in - the incoming buffer.
        Returns:
        the decoded header.
      • buildInvalidMessage

        protected abstract M buildInvalidMessage()
        Helper method to create a upstream message when the incoming parsing did fail.
        Returns:
        a message indicating a decoding failure.