类 ServerHttpResponseDecorator
java.lang.Object
cn.taketoday.http.server.reactive.ServerHttpResponseDecorator
- 所有已实现的接口:
HttpMessage,ReactiveHttpOutputMessage,ServerHttpResponse
- 直接已知子类:
HttpHeadResponseDecorator
Wraps another
ServerHttpResponse and delegates all methods to it.
Sub-classes can override specific methods selectively.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddCookie(ResponseCookie cookie) Add the givenResponseCookie.voidbeforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action) Register an action to apply just before the HttpOutputMessage is committed.cn.taketoday.core.io.buffer.DataBufferFactoryReturn aDataBufferFactorythat can be used to create the body.cn.taketoday.util.MultiValueMap<String,ResponseCookie> Return a mutable map with the cookies to send to the server.Return the headers of this message.static <T> TgetNativeResponse(ServerHttpResponse response) Return the native response of the underlying server API, if possible, also unwrappingServerHttpResponseDecoratorif necessary.Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.booleanWhether the HttpOutputMessage is committed.reactor.core.publisher.Mono<Void>Indicate that message handling is complete, allowing for any cleanup or end-of-processing tasks to be performed such as applying header changes made viaHttpMessage.getHeaders()to the underlying HTTP message (if not applied already).booleansetRawStatusCode(Integer value) Set the HTTP status code to the given value (potentially non-standard and not resolvable through theHttpStatusenum) as an integer.booleansetStatusCode(HttpStatus status) Set the HTTP status code of the response.toString()reactor.core.publisher.Mono<Void>writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> body) Use the givenPublisherofPublishersto write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after eachPublisher<DataBuffer>.reactor.core.publisher.Mono<Void>writeWith(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body) Use the givenPublisherto write the body of the message to the underlying HTTP layer.
-
字段详细资料
-
delegate
-
-
构造器详细资料
-
ServerHttpResponseDecorator
-
-
方法详细资料
-
getDelegate
-
setStatusCode
从接口复制的说明:ServerHttpResponseSet the HTTP status code of the response.- 指定者:
setStatusCode在接口中ServerHttpResponse- 参数:
status- the HTTP status as anHttpStatusenum value- 返回:
falseif the status code change wasn't processed because the HTTP response is committed,trueif successfully set.
-
getStatusCode
从接口复制的说明:ServerHttpResponseReturn 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 benullif the status code value is outside theHttpStatusenum range, or if there is no default value from the underlying server.- 指定者:
getStatusCode在接口中ServerHttpResponse
-
setRawStatusCode
从接口复制的说明:ServerHttpResponseSet the HTTP status code to the given value (potentially non-standard and not resolvable through theHttpStatusenum) as an integer.- 指定者:
setRawStatusCode在接口中ServerHttpResponse- 参数:
value- the status code value- 返回:
falseif the status code change wasn't processed because the HTTP response is committed,trueif successfully set.
-
getRawStatusCode
从接口复制的说明:ServerHttpResponseReturn 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 benullif there is no default value from the underlying server.- 指定者:
getRawStatusCode在接口中ServerHttpResponse
-
getHeaders
从接口复制的说明:HttpMessageReturn the headers of this message.- 指定者:
getHeaders在接口中HttpMessage- 返回:
- a corresponding HttpHeaders object (never
null)
-
getCookies
从接口复制的说明:ServerHttpResponseReturn a mutable map with the cookies to send to the server.- 指定者:
getCookies在接口中ServerHttpResponse
-
addCookie
从接口复制的说明:ServerHttpResponseAdd the givenResponseCookie.- 指定者:
addCookie在接口中ServerHttpResponse- 参数:
cookie- the cookie to add
-
bufferFactory
public cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory()从接口复制的说明:ReactiveHttpOutputMessageReturn aDataBufferFactorythat can be used to create the body.- 指定者:
bufferFactory在接口中ReactiveHttpOutputMessage- 返回:
- a buffer factory
- 另请参阅:
-
beforeCommit
从接口复制的说明:ReactiveHttpOutputMessageRegister 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>>)orMono.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()从接口复制的说明:ReactiveHttpOutputMessageWhether 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) 从接口复制的说明:ReactiveHttpOutputMessageUse the givenPublisherto write the body of the message to the underlying HTTP layer.- 指定者:
writeWith在接口中ReactiveHttpOutputMessage- 参数:
body- the body content publisher- 返回:
- a
Monothat 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) 从接口复制的说明:ReactiveHttpOutputMessageUse the givenPublisherofPublishersto write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after eachPublisher<DataBuffer>.- 指定者:
writeAndFlushWith在接口中ReactiveHttpOutputMessage- 参数:
body- the body content publisher- 返回:
- a
Monothat indicates completion or error
-
setComplete
从接口复制的说明:ReactiveHttpOutputMessageIndicate that message handling is complete, allowing for any cleanup or end-of-processing tasks to be performed such as applying header changes made viaHttpMessage.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
Monothat indicates completion or error
-
getNativeResponse
Return the native response of the underlying server API, if possible, also unwrappingServerHttpResponseDecoratorif necessary.- 类型参数:
T- the expected native response type- 参数:
response- the response to check- 抛出:
IllegalArgumentException- if the native response can't be obtained
-
toString
-