类 ServerHttpResponseDecorator

java.lang.Object
cn.taketoday.http.server.reactive.ServerHttpResponseDecorator
所有已实现的接口:
HttpMessage, ReactiveHttpOutputMessage, ServerHttpResponse
直接已知子类:
HttpHeadResponseDecorator

public class ServerHttpResponseDecorator extends Object implements ServerHttpResponse
Wraps another ServerHttpResponse and delegates all methods to it. Sub-classes can override specific methods selectively.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 字段详细资料

  • 构造器详细资料

    • ServerHttpResponseDecorator

      public ServerHttpResponseDecorator(ServerHttpResponse delegate)
  • 方法详细资料

    • getDelegate

      public ServerHttpResponse getDelegate()
    • setStatusCode

      public boolean setStatusCode(@Nullable HttpStatus status)
      从接口复制的说明: ServerHttpResponse
      Set the HTTP status code of the response.
      指定者:
      setStatusCode 在接口中 ServerHttpResponse
      参数:
      status - the HTTP status as an HttpStatus enum value
      返回:
      false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.
    • 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
    • setRawStatusCode

      public boolean setRawStatusCode(@Nullable Integer value)
      从接口复制的说明: ServerHttpResponse
      Set the HTTP status code to the given value (potentially non-standard and not resolvable through the HttpStatus enum) as an integer.
      指定者:
      setRawStatusCode 在接口中 ServerHttpResponse
      参数:
      value - the status code value
      返回:
      false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.
    • 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
    • getHeaders

      public HttpHeaders getHeaders()
      从接口复制的说明: HttpMessage
      Return the headers of this message.
      指定者:
      getHeaders 在接口中 HttpMessage
      返回:
      a corresponding HttpHeaders object (never null)
    • getCookies

      public cn.taketoday.util.MultiValueMap<String,ResponseCookie> getCookies()
      从接口复制的说明: ServerHttpResponse
      Return a mutable map with the cookies to send to the server.
      指定者:
      getCookies 在接口中 ServerHttpResponse
    • addCookie

      public void addCookie(ResponseCookie cookie)
      从接口复制的说明: ServerHttpResponse
      Add the given ResponseCookie.
      指定者:
      addCookie 在接口中 ServerHttpResponse
      参数:
      cookie - the cookie to add
    • bufferFactory

      public cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory()
      从接口复制的说明: ReactiveHttpOutputMessage
      Return a DataBufferFactory that can be used to create the body.
      指定者:
      bufferFactory 在接口中 ReactiveHttpOutputMessage
      返回:
      a buffer factory
      另请参阅:
    • beforeCommit

      public void beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
      从接口复制的说明: ReactiveHttpOutputMessage
      Register an action to apply just before the HttpOutputMessage is committed.

      Note: the supplied action must be properly deferred, e.g. via Mono.defer(java.util.function.Supplier<? extends reactor.core.publisher.Mono<? extends T>>) or Mono.fromRunnable(java.lang.Runnable), to ensure it's executed in the right order, relative to other actions.

      指定者:
      beforeCommit 在接口中 ReactiveHttpOutputMessage
      参数:
      action - the action to apply
    • isCommitted

      public boolean isCommitted()
      从接口复制的说明: ReactiveHttpOutputMessage
      Whether the HttpOutputMessage is committed.
      指定者:
      isCommitted 在接口中 ReactiveHttpOutputMessage
    • writeWith

      public reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body)
      从接口复制的说明: ReactiveHttpOutputMessage
      Use the given Publisher to write the body of the message to the underlying HTTP layer.
      指定者:
      writeWith 在接口中 ReactiveHttpOutputMessage
      参数:
      body - the body content publisher
      返回:
      a Mono that indicates completion or error
    • writeAndFlushWith

      public reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> body)
      从接口复制的说明: ReactiveHttpOutputMessage
      Use the given Publisher of Publishers to write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after each Publisher<DataBuffer>.
      指定者:
      writeAndFlushWith 在接口中 ReactiveHttpOutputMessage
      参数:
      body - the body content publisher
      返回:
      a Mono that indicates completion or error
    • setComplete

      public reactor.core.publisher.Mono<Void> setComplete()
      从接口复制的说明: ReactiveHttpOutputMessage
      Indicate that message handling is complete, allowing for any cleanup or end-of-processing tasks to be performed such as applying header changes made via HttpMessage.getHeaders() to the underlying HTTP message (if not applied already).

      This method should be automatically invoked at the end of message processing so typically applications should not have to invoke it. If invoked multiple times it should have no side effects.

      指定者:
      setComplete 在接口中 ReactiveHttpOutputMessage
      返回:
      a Mono that indicates completion or error
    • getNativeResponse

      public static <T> T getNativeResponse(ServerHttpResponse response)
      Return the native response of the underlying server API, if possible, also unwrapping ServerHttpResponseDecorator if necessary.
      类型参数:
      T - the expected native response type
      参数:
      response - the response to check
      抛出:
      IllegalArgumentException - if the native response can't be obtained
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object