Interface NettyWriteContext

All Known Implementing Classes:
PipeliningServerHandler.OutboundAccess

@Internal public interface NettyWriteContext
This interface is used to write the different kinds of netty responses.
Since:
4.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull io.netty.buffer.ByteBufAllocator
     
    default void
    writeFull(@NonNull io.netty.handler.codec.http.FullHttpResponse response)
    Write a full response.
    void
    writeFull(@NonNull io.netty.handler.codec.http.FullHttpResponse response, boolean headResponse)
    Write a full response.
    void
    writeStream(@NonNull io.netty.handler.codec.http.HttpResponse response, @NonNull InputStream stream, @NonNull ExecutorService executorService)
    Write a response with a body that is a blocking stream.
    void
    writeStreamed(@NonNull io.netty.handler.codec.http.HttpResponse response, @NonNull Publisher<io.netty.handler.codec.http.HttpContent> content)
    Write a streamed response.
  • Method Details

    • alloc

      @NonNull @NonNull io.netty.buffer.ByteBufAllocator alloc()
      Returns:
      The bytebuf allocator.
    • writeFull

      default void writeFull(@NonNull @NonNull io.netty.handler.codec.http.FullHttpResponse response)
      Write a full response.
      Parameters:
      response - The response to write
    • writeFull

      void writeFull(@NonNull @NonNull io.netty.handler.codec.http.FullHttpResponse response, boolean headResponse)
      Write a full response.
      Parameters:
      response - The response to write
      headResponse - If true, this is a response to a HEAD request, so the Content-Length header should not be overwritten.
    • writeStreamed

      void writeStreamed(@NonNull @NonNull io.netty.handler.codec.http.HttpResponse response, @NonNull @NonNull Publisher<io.netty.handler.codec.http.HttpContent> content)
      Write a streamed response.
      Parameters:
      response - The response to write
      content - The body
    • writeStream

      void writeStream(@NonNull @NonNull io.netty.handler.codec.http.HttpResponse response, @NonNull @NonNull InputStream stream, @NonNull @NonNull ExecutorService executorService)
      Write a response with a body that is a blocking stream.
      Parameters:
      response - The response. Must not be a FullHttpResponse
      stream - The stream to read from
      executorService - The executor for IO operations