Interface SessionIdGenerator<A,B extends Session<A>>

Type Parameters:
A - the session data type
B - the session type
All Known Subinterfaces:
JWTSessionIdGenerator<A,B>
All Known Implementing Classes:
JWTESessionIdGenerator, JWTSSessionIdGenerator

public interface SessionIdGenerator<A,B extends Session<A>>

A session identifier generator is used to generate unique session id.

Implementors must ensure that identifiers are generated in a way that ensures that there is negligible probability that the same value will be accidentally assigned to different sessions.

Since:
1.13
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    generate(B session)
    Generates a new identifier for the specified session.
    static <A, B extends Session<A>>
    SessionIdGenerator<A,B>
    Returns a Base64 UUID session id generator.
    static <A, B extends Session<A>>
    SessionIdGenerator<A,B>
    uuid(boolean base64Encoded)
    Returns a UUID session id generator.
  • Method Details

    • uuid

      static <A, B extends Session<A>> SessionIdGenerator<A,B> uuid()

      Returns a Base64 UUID session id generator.

      Type Parameters:
      A - the session data type
      B - the session type
      Returns:
      a session id generator
    • uuid

      static <A, B extends Session<A>> SessionIdGenerator<A,B> uuid(boolean base64Encoded)

      Returns a UUID session id generator.

      Type Parameters:
      A - the session data type
      B - the session type
      Parameters:
      base64Encoded - true to encode the identifier in Base64, false otherwise
      Returns:
      a session id generator
    • generate

      Mono<String> generate(B session)

      Generates a new identifier for the specified session.

      Parameters:
      session - a session
      Returns:
      a mono generating a session id