Interface SessionIdExtractor<A extends ExchangeContext,B extends Exchange<A>>

Type Parameters:
A - the exchange context type
B - the exchange type
All Known Implementing Classes:
CookieSessionIdExtractor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SessionIdExtractor<A extends ExchangeContext,B extends Exchange<A>>

A session identifier extractor extracts the session identifier from an exchange, typically the request.

It is used by the SessionInterceptor to extract the session identifier in order to resolve the session in the session context.

Since:
1.13
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    extract(B exchange)
    Extracts the session identifier from the specified exchange.
    or(SessionIdExtractor<? super A,? super B> other)
    Returns a composed session identifier extractor which first invokes this extractor and, if no identifier could have been extracted, invokes the specified extractor.
  • Method Details

    • extract

      Mono<String> extract(B exchange)

      Extracts the session identifier from the specified exchange.

      Parameters:
      exchange - the exchange
      Returns:
      a mono emitting the session identifier or an empty mono if the exchange didn't provide any session identifier
    • or

      default SessionIdExtractor<A,B> or(SessionIdExtractor<? super A,? super B> other)

      Returns a composed session identifier extractor which first invokes this extractor and, if no identifier could have been extracted, invokes the specified extractor.

      Parameters:
      other - the session identifier extractor to invoke in case this extractor was not able to extract the identifier
      Returns:
      a composed session identifier extractor