ServerHttpResponse implementations.
| Modifier and Type | Class and Description |
|---|---|
| private static enum | AbstractServerHttpResponse.State
COMMITTING -> COMMITTED is the period after doCommit is called but before the response status and headers have been applied to the underlying response during which time pre-commit actions can still make changes to the response status and headers. |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final MultiValueMap | |
| private final DataBufferFactory | |
| private final HttpHeaders | |
| private HttpHeaders | |
| private final AtomicReference | |
| private HttpStatusCode |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCookie(ResponseCookie
the cookie to add cookie)Implements org. ResponseCookie.
|
| protected abstract void | |
| protected abstract void | applyHeaders()
Invoked when the response is getting committed allowing subclasses to make apply header values to the underlying response. |
| protected abstract void | |
| public void | beforeCommit(Supplier<? extends Mono<Void>>
the action to apply action)Implements org. |
| public final DataBufferFactory | bufferFactory()
Implements org. DataBufferFactory that can be used to create the body.
|
| protected Mono | Returns: a completion publisherA variant of |
| protected Mono | Returns: a completion publisherthe action to write the response body (may be writeAction)null)Apply |
| public MultiValueMap | getCookies()
Implements org. |
| public HttpHeaders | getHeaders()
Implements org. |
| public abstract <T> T | |
| public Integer | getRawStatusCode()
Overrides default org.
Deprecated
Return the status code that has been set, or otherwise fall back on the
status of the response from the underlying server.
|
| public HttpStatusCode | getStatusCode()
Implements org. |
| public boolean | isCommitted()
Implements org. |
| public Mono | setComplete()
Implements org. getHeaders() to the underlying HTTP message (if not
applied already).
|
| public boolean | setRawStatusCode(Integer
the status code value statusCode)Overrides default org. |
| public boolean | setStatusCode(HttpStatusCode
the HTTP status as an status)HttpStatusCode valueImplements org. |
| protected void | touchDataBuffer(DataBuffer
the buffer to attach a hint to buffer)Allow subclasses to associate a hint with the data buffer if it is a pooled buffer and supports leak tracking. |
| public final Mono | writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>>
the body content publisher body)Implements org. Publisher of Publishers to write the body
of the HttpOutputMessage to the underlying HTTP layer, flushing after
each Publisher<DataBuffer>.
|
| protected abstract Mono | writeAndFlushWithInternal(Publisher<? extends Publisher<? extends DataBuffer>>
the publisher to write and flush with body)Write to the underlying the response, and flush after each |
| public final Mono | writeWith(Publisher<? extends DataBuffer>
the body content publisher body)Implements org. Publisher to write the body of the message to the
underlying HTTP layer.
|
| protected abstract Mono | writeWithInternal(Publisher<? extends DataBuffer>
the publisher to write with body)Write to the underlying the response. |
| commitActions | back to summary |
|---|---|
| private final List<Supplier<? extends Mono<Void>>> commitActions | |
| cookies | back to summary |
|---|---|
| private final MultiValueMap<String, ResponseCookie> cookies | |
| dataBufferFactory | back to summary |
|---|---|
| private final DataBufferFactory dataBufferFactory | |
| headers | back to summary |
|---|---|
| private final HttpHeaders headers | |
| readOnlyHeaders | back to summary |
|---|---|
| private HttpHeaders readOnlyHeaders
| |
| state | back to summary |
|---|---|
| private final AtomicReference<AbstractServerHttpResponse. | |
| statusCode | back to summary |
|---|---|
| private HttpStatusCode statusCode
| |
| AbstractServerHttpResponse | back to summary |
|---|---|
| public AbstractServerHttpResponse(DataBufferFactory dataBufferFactory) | |
| AbstractServerHttpResponse | back to summary |
|---|---|
| public AbstractServerHttpResponse(DataBufferFactory dataBufferFactory, HttpHeaders headers) | |
| addCookie | back to summary |
|---|---|
| public void addCookie(ResponseCookie cookie) Implements org. Doc from org. Add the given
| |
| applyCookies | back to summary |
|---|---|
| protected abstract void applyCookies() Add cookies from | |
| applyHeaders | back to summary |
|---|---|
| protected abstract void applyHeaders() Invoked when the response is getting committed allowing subclasses to make apply header values to the underlying response. Note that some subclasses use an | |
| applyStatusCode | back to summary |
|---|---|
| protected abstract void applyStatusCode() Write the status code to the underlying response. This method is called once only. | |
| beforeCommit | back to summary |
|---|---|
| public void beforeCommit(Supplier<? extends Mono<Void>> action) Implements org. Doc from org. Register an action to apply just before the HttpOutputMessage is committed. Note the supplied action must be properly deferred,
e.g. via | |
| bufferFactory | back to summary |
|---|---|
| public final DataBufferFactory bufferFactory() Implements org. Doc from org. Return a
| |
| doCommit | back to summary |
|---|---|
| protected Mono A variant of | |
| doCommit | back to summary |
|---|---|
| protected Mono Apply | |
| getCookies | back to summary |
|---|---|
| public MultiValueMap Implements org. Doc from org. Return a mutable map with the cookies to send to the server.
| |
| getHeaders | back to summary |
|---|---|
| public HttpHeaders getHeaders() Implements org. Doc from org. Return the headers of this message.
| |
| getNativeResponse | back to summary |
|---|---|
| public abstract <T> T getNativeResponse() Return the underlying server response. Note This is exposed mainly for internal framework use such as WebSocket upgrades in the spring-webflux module. | |
| getRawStatusCode | back to summary |
|---|---|
| public Integer getRawStatusCode() Overrides default org. Doc from org. Deprecated
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
| |
| getStatusCode | back to summary |
|---|---|
| public HttpStatusCode getStatusCode() Implements org. Doc from org. 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 | |
| isCommitted | back to summary |
|---|---|
| public boolean isCommitted() Implements org. Doc from org. Whether the HttpOutputMessage is committed.
| |
| setComplete | back to summary |
|---|---|
| public Mono Implements org. Doc from org. 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 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. | |
| setRawStatusCode | back to summary |
|---|---|
| public boolean setRawStatusCode(Integer statusCode) Overrides default org. Doc from org. Set the HTTP status code to the given value as an integer. | |
| setStatusCode | back to summary |
|---|---|
| public boolean setStatusCode(HttpStatusCode status) Implements org. Doc from org. Set the HTTP status code of the response.
| |
| touchDataBuffer | back to summary |
|---|---|
| protected void touchDataBuffer(DataBuffer buffer) Allow subclasses to associate a hint with the data buffer if it is a pooled buffer and supports leak tracking.
| |
| writeAndFlushWith | back to summary |
|---|---|
| public final Mono Implements org. Doc from org. Use the given | |
| writeAndFlushWithInternal | back to summary |
|---|---|
| protected abstract Mono Write to the underlying the response, and flush after each
| |
| writeWith | back to summary |
|---|---|
| public final Mono Implements org. Doc from org. Use the given
| |
| writeWithInternal | back to summary |
|---|---|
| protected abstract Mono Write to the underlying the response.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final AbstractServerHttpResponse. | |
| public static final AbstractServerHttpResponse. | |
| public static final AbstractServerHttpResponse. | |
| public static final AbstractServerHttpResponse. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static AbstractServerHttpResponse. | |
| public static AbstractServerHttpResponse. |
| COMMIT_ACTION_FAILED | back to summary |
|---|---|
| public static final AbstractServerHttpResponse. | |
| COMMITTED | back to summary |
|---|---|
| public static final AbstractServerHttpResponse. | |
| COMMITTING | back to summary |
|---|---|
| public static final AbstractServerHttpResponse. | |
| NEW | back to summary |
|---|---|
| public static final AbstractServerHttpResponse. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static AbstractServerHttpResponse. | |
| values | back to summary |
|---|---|
| public static AbstractServerHttpResponse. | |