Interface SessionStore<S extends Session>

Type Parameters:
S - The session
All Known Implementing Classes:
InMemorySessionStore

public interface SessionStore<S extends Session>

Interface for locating and saving sessions.

Since:
1.0
Author:
Graeme Rocher
  • Method Details

    • newSession

      S newSession()
      Create a new unsaved session.
      Returns:
      The created session
    • findSession

      CompletableFuture<Optional<S>> findSession(String id)
      Find a session for the given ID.
      Parameters:
      id - The ID of the session
      Returns:
      A future the completes with an Optional session
    • deleteSession

      CompletableFuture<Boolean> deleteSession(String id)
      Delete a session for the given ID.
      Parameters:
      id - The ID of the session
      Returns:
      A future that outputs true if the session was successfully deleted
    • save

      CompletableFuture<S> save(S session)
      Save the given session.
      Parameters:
      session - The session to save
      Returns:
      A future that completes with the saved session once the operation is complete