public class WebSessionServerRequestCache extends java.lang.Object implements ServerRequestCache
ServerRequestCache
that saves the
ServerHttpRequest
in the WebSession
.
The current implementation only saves the URL that was requested.Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
WebSessionServerRequestCache() |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<java.net.URI> |
getRedirectUri(org.springframework.web.server.ServerWebExchange exchange)
Get the URI that can be redirected to trigger the saved request to be used
|
reactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest> |
removeMatchingRequest(org.springframework.web.server.ServerWebExchange exchange)
If the provided
ServerWebExchange matches the saved ServerHttpRequest
gets the saved ServerHttpRequest |
reactor.core.publisher.Mono<java.lang.Void> |
saveRequest(org.springframework.web.server.ServerWebExchange exchange)
Save the
ServerHttpRequest |
void |
setSaveRequestMatcher(ServerWebExchangeMatcher saveRequestMatcher)
Sets the matcher to determine if the request should be saved.
|
public void setSaveRequestMatcher(ServerWebExchangeMatcher saveRequestMatcher)
saveRequestMatcher
- public reactor.core.publisher.Mono<java.lang.Void> saveRequest(org.springframework.web.server.ServerWebExchange exchange)
ServerRequestCache
ServerHttpRequest
saveRequest
in interface ServerRequestCache
exchange
- the exchange to saveMono<Void>
which only replays complete and error signals
from this Mono
.public reactor.core.publisher.Mono<java.net.URI> getRedirectUri(org.springframework.web.server.ServerWebExchange exchange)
ServerRequestCache
getRedirectUri
in interface ServerRequestCache
exchange
- the exchange to obtain the saved ServerHttpRequest
frompublic reactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest> removeMatchingRequest(org.springframework.web.server.ServerWebExchange exchange)
ServerRequestCache
ServerWebExchange
matches the saved ServerHttpRequest
gets the saved ServerHttpRequest
removeMatchingRequest
in interface ServerRequestCache
exchange
- the exchange to obtain the request fromServerHttpRequest