Class OutboundWay

    • Field Detail

      • entityChannel

        private volatile java.nio.channels.ReadableByteChannel entityChannel
        Deprecated.
        The entity as a NIO readable byte channel.
      • entityChannelType

        private volatile EntityType entityChannelType
        Deprecated.
        The type of the entity channel.
      • entitySelectionKey

        private volatile java.nio.channels.SelectionKey entitySelectionKey
        Deprecated.
        The entity's NIO selection key holding the link between the entity to be written and the way.
      • headerIndex

        private volatile int headerIndex
        Deprecated.
        The header index.
    • Constructor Detail

      • OutboundWay

        public OutboundWay​(Connection<?> connection,
                           int bufferSize)
        Deprecated.
        Constructor.
        Parameters:
        connection - The parent connection.
        bufferSize - The byte buffer size.
    • Method Detail

      • getVersion

        protected static java.lang.String getVersion​(Request request)
        Deprecated.
        Returns the protocol version.
        Parameters:
        request - The request.
        Returns:
        The protocol version.
      • addEntityHeaders

        protected void addEntityHeaders​(Representation entity,
                                        Series<Header> headers)
        Deprecated.
        Adds the entity headers for the given response.
        Parameters:
        entity - The entity to inspect.
      • addGeneralHeaders

        protected void addGeneralHeaders​(Series<Header> headers)
        Deprecated.
        Adds the general headers from the Message to the Series.
        Parameters:
        headers - The target headers Series.
      • addHeaders

        protected abstract void addHeaders​(Series<Header> headers)
        Deprecated.
        Add all the headers, including the general, the message specific and the entity headers.
        Parameters:
        headers - The headers to update.
      • clear

        public void clear()
        Deprecated.
        Description copied from class: Way
        Recycles the way so it can be reused. Typically invoked by a connection pool.
        Overrides:
        clear in class Way
      • flushBuffer

        public void flushBuffer()
        Deprecated.
        Flush buffers onto the network.
      • getEntityChannel

        public java.nio.channels.ReadableByteChannel getEntityChannel()
        Deprecated.
        Returns the entity as a NIO readable byte channel.
        Returns:
        The entity as a NIO readable byte channel.
      • getEntityChannelType

        protected EntityType getEntityChannelType()
        Deprecated.
        Returns the type of the entity channel.
        Returns:
        The type of the entity channel.
      • getEntityFileChannel

        public java.nio.channels.FileChannel getEntityFileChannel()
        Deprecated.
        Returns the entity as a NIO file channel.
        Returns:
        The entity as a NIO file channel.
      • getEntityInterestOps

        public int getEntityInterestOps()
        Deprecated.
        Registers interest of this way for socket NIO operations.
        Returns:
        The operations of interest.
      • getEntitySelectableChannel

        public java.nio.channels.SelectableChannel getEntitySelectableChannel()
        Deprecated.
        Returns the entity as a NIO non-blocking selectable channel.
        Returns:
        The entity as a NIO non-blocking selectable channel.
      • getEntitySelectionKey

        public java.nio.channels.SelectionKey getEntitySelectionKey()
        Deprecated.
        Returns the entity's NIO selection key holding the link between the entity to be written and the way.
        Returns:
        The entity's NIO selection key.
      • getHeaderIndex

        protected int getHeaderIndex()
        Deprecated.
        Returns the header index.
        Returns:
        The header index.
      • getInterestOperations

        public int getInterestOperations()
        Deprecated.
        Description copied from class: Way
        Returns the operations of interest.
        Specified by:
        getInterestOperations in class Way
        Returns:
        The operations of interest.
      • handle

        public abstract void handle​(Response response)
        Deprecated.
        Add a message to the outbound way.
        Parameters:
        response -
      • hasIoInterest

        protected boolean hasIoInterest()
        Deprecated.
        Description copied from class: Way
        Indicates if we want to be selected for IO processing when the socket related socket is prepared.
        Overrides:
        hasIoInterest in class Way
        Returns:
        True if we want to be selected for IO processing when the socket is ready.
      • onDrain

        public int onDrain​(Buffer buffer,
                           int maxDrained,
                           java.lang.Object... args)
                    throws java.io.IOException
        Deprecated.
        Description copied from class: Way
        Drains the byte buffer by writing available bytes to the socket channel.
        Specified by:
        onDrain in interface BufferProcessor
        Specified by:
        onDrain in class Way
        Parameters:
        buffer - The IO buffer to drain.
        maxDrained - The maximum number of bytes drained by this call.
        args - The optional arguments to pass back to the callbacks.
        Returns:
        The number of bytes drained.
        Throws:
        java.io.IOException
      • onError

        public void onError​(Status status)
        Deprecated.
        Description copied from class: Way
        Called on error.
        Specified by:
        onError in class Way
        Parameters:
        status - The error status.
      • onFill

        public int onFill​(Buffer buffer,
                          java.lang.Object... args)
                   throws java.io.IOException
        Deprecated.
        Description copied from class: Way
        Fills the byte buffer by writing the current message.
        Specified by:
        onFill in interface BufferProcessor
        Specified by:
        onFill in class Way
        Parameters:
        buffer - The IO buffer to drain.
        args - The optional arguments to pass back to the callbacks.
        Returns:
        The number of bytes filled.
        Throws:
        java.io.IOException
      • onFillEof

        public void onFillEof()
        Deprecated.
        Called back when a fill operation returns with an EOF status.
      • onHeadersCompleted

        public void onHeadersCompleted()
                                throws java.io.IOException
        Deprecated.
        Callback invoked when a message has been sent. Note that only the start line and the headers must have been sent, not the optional body.
        Specified by:
        onHeadersCompleted in class Way
        Throws:
        java.io.IOException
      • onMessageCompleted

        public void onMessageCompleted​(boolean endReached)
                                throws java.io.IOException
        Deprecated.
        Description copied from class: Way
        Callback method invoked when the current message has been completely received or sent.
        Specified by:
        onMessageCompleted in interface CompletionListener
        Overrides:
        onMessageCompleted in class Way
        Parameters:
        endReached - Indicates if the end of the socket channel was detected.
        Throws:
        java.io.IOException
      • onPostProcessing

        protected void onPostProcessing()
        Deprecated.
        Description copied from class: Way
        Called back after the IO processing to indicate if there is further IO interest. By default, it sets the IO state to IoState.INTEREST.
        Specified by:
        onPostProcessing in class Way
      • onTimeOut

        public void onTimeOut()
        Deprecated.
        Description copied from class: Way
        Called back by the controller when an IO time out has been detected.
        Specified by:
        onTimeOut in class Way
      • processIoBuffer

        public int processIoBuffer()
                            throws java.io.IOException
        Deprecated.
        Description copied from class: Way
        Processes the IO buffer by filling and draining it.
        Overrides:
        processIoBuffer in class Way
        Throws:
        java.io.IOException
      • setEntityChannel

        public void setEntityChannel​(java.nio.channels.ReadableByteChannel entityChannel)
        Deprecated.
        Sets the entity as a NIO readable byte channel.
        Parameters:
        entityChannel - The entity as a NIO readable byte channel.
      • setEntityChannelType

        protected void setEntityChannelType​(EntityType entityChannelType)
        Deprecated.
        Sets the type of the entity channel.
        Parameters:
        entityChannelType - The type of the entity channel.
      • setEntitySelectionKey

        public void setEntitySelectionKey​(java.nio.channels.SelectionKey entityKey)
        Deprecated.
        Sets the entity's NIO selection key holding the link between the entity to be written and the way.
        Parameters:
        entityKey - The entity's NIO selection key.
      • setHeaderIndex

        protected void setHeaderIndex​(int headerIndex)
        Deprecated.
        Sets the header index.
        Parameters:
        headerIndex - The header index.
      • shouldBeChunked

        protected boolean shouldBeChunked​(Representation entity)
        Deprecated.
        Indicates if the entity should be chunked because its length is unknown.
        Parameters:
        entity - The entity to analyze.
        Returns:
        True if the entity should be chunked.
      • updateState

        public void updateState()
        Deprecated.
        Description copied from class: Way
        Updates the way IO and message states.
        Overrides:
        updateState in class Way
      • writeLine

        protected void writeLine()
                          throws java.io.IOException
        Deprecated.
        Write a new line into the line builder.
        Throws:
        java.io.IOException
      • writeStartLine

        protected abstract void writeStartLine()
                                        throws java.io.IOException
        Deprecated.
        Writes the start line of the current outbound message.
        Throws:
        java.io.IOException