Interface HttpOutput.Interceptor

    • Method Detail

      • write

        void write​(java.nio.ByteBuffer content,
                   boolean last,
                   Callback callback)
        Write content. The response is committed by the first call to write and is closed by a call with last == true. Empty content buffers may be passed to force a commit or close.
        Parameters:
        content - The content to be written or an empty buffer.
        last - True if this is the last call to write
        callback - The callback to use to indicate Callback.succeeded() or Callback.failed(Throwable).
      • getNextInterceptor

        HttpOutput.Interceptor getNextInterceptor()
        Returns:
        The next Interceptor in the chain or null if this is the last Interceptor in the chain.
      • isOptimizedForDirectBuffers

        boolean isOptimizedForDirectBuffers()
        Returns:
        True if the Interceptor is optimized to receive direct ByteBuffers in the write(ByteBuffer, boolean, Callback) method. If false is returned, then passing direct buffers may cause inefficiencies.
      • resetBuffer

        default void resetBuffer()
                          throws java.lang.IllegalStateException
        Reset the buffers.

        If the Interceptor contains buffers then reset them.

        Throws:
        java.lang.IllegalStateException - Thrown if the response has been committed and buffers and/or headers cannot be reset.