Class OperationImpl

    • Field Detail

      • CRLF

        protected static final byte[] CRLF
      • byteBuffer

        private final java.io.ByteArrayOutputStream byteBuffer
      • foundCr

        private boolean foundCr
      • errorMsg

        private byte[] errorMsg
    • Constructor Detail

      • OperationImpl

        protected OperationImpl()
    • Method Detail

      • matchStatus

        protected final OperationStatus matchStatus​(java.lang.String line,
                                                    OperationStatus... statii)
        Match the status line provided against one of the given OperationStatus objects. If none match, return a failure status with the given line.
        Parameters:
        line - the current line
        statii - several status objects
        Returns:
        the appropriate status object
      • setReadType

        protected final void setReadType​(OperationReadType to)
        Set the read type of this operation.
      • setArguments

        protected final void setArguments​(java.nio.ByteBuffer bb,
                                          java.lang.Object... args)
        Set some arguments for an operation into the given byte buffer.
      • readFromBuffer

        public void readFromBuffer​(java.nio.ByteBuffer data)
                            throws java.io.IOException
        Description copied from interface: Operation
        Read data from the given byte buffer and dispatch to the appropriate read mechanism.
        Specified by:
        readFromBuffer in interface Operation
        Specified by:
        readFromBuffer in class BaseOperationImpl
        Throws:
        java.io.IOException
      • handleLine

        public abstract void handleLine​(java.lang.String line)
      • getErrorMsg

        public byte[] getErrorMsg()
        Description copied from interface: Operation
        Returns the raw bytes of the error message content.
        Specified by:
        getErrorMsg in interface Operation
        Returns:
        the raw error message content.