public class DefaultServerWebExchange extends Object implements ServerWebExchange
ServerWebExchange.ServerWebExchange.Builder| Constructor and Description |
|---|
DefaultServerWebExchange(ServerHttpRequest request,
ServerHttpResponse response,
WebSessionManager sessionManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkNotModified(Instant lastModified)
An overloaded variant of
ServerWebExchange.checkNotModified(String, Instant) with
a last-modified timestamp only. |
boolean |
checkNotModified(String etag)
An overloaded variant of
ServerWebExchange.checkNotModified(String, Instant) with
an ETag (entity tag) value only. |
boolean |
checkNotModified(String etag,
Instant lastModified)
Check whether the requested resource has been modified given the supplied
ETag (entity tag) and last-modified timestamp as determined by
the application. |
<T> Optional<T> |
getAttribute(String name)
Return the request attribute value if present.
|
Map<String,Object> |
getAttributes()
Return a mutable map of request attributes for the current exchange.
|
reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>> |
getFormData()
Return the form data from the body of the request if the Content-Type is
"application/x-www-form-urlencoded" or an empty map. |
<T extends Principal> |
getPrincipal()
Return the authenticated user for the request, if any.
|
ServerHttpRequest |
getRequest()
Return the current HTTP request.
|
reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>> |
getRequestParams()
Return a combined map that represents both
ServerHttpRequest.getQueryParams() and ServerWebExchange.getFormData()
or an empty map. |
ServerHttpResponse |
getResponse()
Return the current HTTP response.
|
reactor.core.publisher.Mono<WebSession> |
getSession()
Return the web session for the current request.
|
boolean |
isNotModified()
Returns
true if the one of the checkNotModified methods
in this contract were used and they returned true. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmutatepublic DefaultServerWebExchange(ServerHttpRequest request, ServerHttpResponse response, WebSessionManager sessionManager)
public ServerHttpRequest getRequest()
ServerWebExchangegetRequest in interface ServerWebExchangepublic ServerHttpResponse getResponse()
ServerWebExchangegetResponse in interface ServerWebExchangepublic Map<String,Object> getAttributes()
ServerWebExchangegetAttributes in interface ServerWebExchangepublic <T> Optional<T> getAttribute(String name)
ServerWebExchangegetAttribute in interface ServerWebExchangeT - the attribute typename - the attribute namepublic reactor.core.publisher.Mono<WebSession> getSession()
ServerWebExchangeWebSession
for more details.getSession in interface ServerWebExchangepublic <T extends Principal> reactor.core.publisher.Mono<T> getPrincipal()
ServerWebExchangegetPrincipal in interface ServerWebExchangepublic reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>> getFormData()
ServerWebExchange"application/x-www-form-urlencoded" or an empty map.getFormData in interface ServerWebExchangepublic reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>> getRequestParams()
ServerWebExchangeServerHttpRequest.getQueryParams() and ServerWebExchange.getFormData()
or an empty map.getRequestParams in interface ServerWebExchangepublic boolean isNotModified()
ServerWebExchangetrue if the one of the checkNotModified methods
in this contract were used and they returned true.isNotModified in interface ServerWebExchangepublic boolean checkNotModified(Instant lastModified)
ServerWebExchangeServerWebExchange.checkNotModified(String, Instant) with
a last-modified timestamp only.checkNotModified in interface ServerWebExchangelastModified - the last-modified timepublic boolean checkNotModified(String etag)
ServerWebExchangeServerWebExchange.checkNotModified(String, Instant) with
an ETag (entity tag) value only.checkNotModified in interface ServerWebExchangeetag - the entity tag for the underlying resource.public boolean checkNotModified(String etag, Instant lastModified)
ServerWebExchangeETag (entity tag) and last-modified timestamp as determined by
the application. Also transparently prepares the response, setting HTTP
status, and adding "ETag" and "Last-Modified" headers when applicable.
This method works with conditional GET/HEAD requests as well as with
conditional POST/PUT/DELETE requests.
Note: The HTTP specification recommends setting both
ETag and Last-Modified values, but you can also use
#checkNotModified(String) or
ServerWebExchange.checkNotModified(Instant).
checkNotModified in interface ServerWebExchangeetag - the entity tag that the application determined for the
underlying resource. This parameter will be padded with quotes (")
if necessary.lastModified - the last-modified timestamp that the application
determined for the underlying resource