Interface ServerRequestCache

All Known Implementing Classes:
CookieServerRequestCache, NoOpServerRequestCache, WebSessionServerRequestCache

public interface ServerRequestCache
Saves a ServerHttpRequest so it can be "replayed" later. This is useful for when a page was requested and authentication is necessary.
Since:
5.0
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<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<Void>
    saveRequest(org.springframework.web.server.ServerWebExchange exchange)
    Save the ServerHttpRequest
  • Method Details

    • saveRequest

      reactor.core.publisher.Mono<Void> saveRequest(org.springframework.web.server.ServerWebExchange exchange)
      Save the ServerHttpRequest
      Parameters:
      exchange - the exchange to save
      Returns:
      Return a Mono<Void> which only replays complete and error signals from this Mono.
    • getRedirectUri

      reactor.core.publisher.Mono<URI> getRedirectUri(org.springframework.web.server.ServerWebExchange exchange)
      Get the URI that can be redirected to trigger the saved request to be used
      Parameters:
      exchange - the exchange to obtain the saved ServerHttpRequest from
      Returns:
      the URI that can be redirected to trigger the saved request to be used
    • removeMatchingRequest

      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
      Parameters:
      exchange - the exchange to obtain the request from
      Returns:
      the ServerHttpRequest