类 ReactorNetty2ServerHttpResponse

java.lang.Object
cn.taketoday.http.server.reactive.AbstractServerHttpResponse
cn.taketoday.http.server.reactive.ReactorNetty2ServerHttpResponse
所有已实现的接口:
HttpMessage, ReactiveHttpOutputMessage, ServerHttpResponse, ZeroCopyHttpOutputMessage

class ReactorNetty2ServerHttpResponse extends AbstractServerHttpResponse implements ZeroCopyHttpOutputMessage
Adapt ServerHttpResponse to the HttpServerResponse.

This class is based on ReactorServerHttpResponse.

从以下版本开始:
4.0
作者:
Violeta Georgieva, Harry Yang
  • 字段详细资料

    • logger

      private static final cn.taketoday.logging.Logger logger
    • response

      private final reactor.netty5.http.server.HttpServerResponse response
  • 构造器详细资料

    • ReactorNetty2ServerHttpResponse

      public ReactorNetty2ServerHttpResponse(reactor.netty5.http.server.HttpServerResponse response, cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory)
  • 方法详细资料

    • getNativeResponse

      public <T> T getNativeResponse()
      从类复制的说明: AbstractServerHttpResponse
      Return the underlying server response.
      指定者:
      getNativeResponse 在类中 AbstractServerHttpResponse
    • getStatusCode

      public HttpStatusCode getStatusCode()
      从接口复制的说明: ServerHttpResponse
      Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may be null if the status code value is outside the HttpStatus enum range, or if there is no default value from the underlying server.
      指定者:
      getStatusCode 在接口中 ServerHttpResponse
      覆盖:
      getStatusCode 在类中 AbstractServerHttpResponse
    • getRawStatusCode

      public Integer getRawStatusCode()
      从接口复制的说明: ServerHttpResponse
      Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may be null if there is no default value from the underlying server.
      指定者:
      getRawStatusCode 在接口中 ServerHttpResponse
      覆盖:
      getRawStatusCode 在类中 AbstractServerHttpResponse
    • applyStatusCode

      protected void applyStatusCode()
      从类复制的说明: AbstractServerHttpResponse
      Write the status code to the underlying response. This method is called once only.
      指定者:
      applyStatusCode 在类中 AbstractServerHttpResponse
    • writeWithInternal

      protected reactor.core.publisher.Mono<Void> writeWithInternal(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> publisher)
      从类复制的说明: AbstractServerHttpResponse
      Write to the underlying the response.
      指定者:
      writeWithInternal 在类中 AbstractServerHttpResponse
      参数:
      publisher - the publisher to write with
    • writeAndFlushWithInternal

      protected reactor.core.publisher.Mono<Void> writeAndFlushWithInternal(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> publisher)
      从类复制的说明: AbstractServerHttpResponse
      Write to the underlying the response, and flush after each Publisher<DataBuffer>.
      指定者:
      writeAndFlushWithInternal 在类中 AbstractServerHttpResponse
      参数:
      publisher - the publisher to write and flush with
    • applyHeaders

      protected void applyHeaders()
      从类复制的说明: AbstractServerHttpResponse
      Invoked when the response is getting committed allowing sub-classes to make apply header values to the underlying response.

      Note that most sub-classes use an HttpHeaders instance that wraps an adapter to the native response headers such that changes are propagated to the underlying response on the go. That means this callback is typically not used other than for specialized updates such as setting the contentType or characterEncoding fields in a Servlet response.

      指定者:
      applyHeaders 在类中 AbstractServerHttpResponse
    • applyCookies

      protected void applyCookies()
      从类复制的说明: AbstractServerHttpResponse
      Add cookies from AbstractServerHttpResponse.getHeaders() to the underlying response. This method is called once only.
      指定者:
      applyCookies 在类中 AbstractServerHttpResponse
    • writeWith

      public reactor.core.publisher.Mono<Void> writeWith(Path file, long position, long count)
      从接口复制的说明: ZeroCopyHttpOutputMessage
      Use the given Path to write the body of the message to the underlying HTTP layer.
      指定者:
      writeWith 在接口中 ZeroCopyHttpOutputMessage
      参数:
      file - the file to transfer
      position - the position within the file from which the transfer is to begin
      count - the number of bytes to be transferred
      返回:
      a publisher that indicates completion or error.
    • toByteBufs

      private org.reactivestreams.Publisher<io.netty5.buffer.Buffer> toByteBufs(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> dataBuffers)
    • touchDataBuffer

      protected void touchDataBuffer(cn.taketoday.core.io.buffer.DataBuffer buffer)
      从类复制的说明: AbstractServerHttpResponse
      Allow sub-classes to associate a hint with the data buffer if it is a pooled buffer and supports leak tracking.
      覆盖:
      touchDataBuffer 在类中 AbstractServerHttpResponse
      参数:
      buffer - the buffer to attach a hint to