Interface SessionManager

All Superinterfaces:
AutoCloseable

public interface SessionManager extends AutoCloseable
An interface for session management.
  • Method Details

    • generateSessionId

      String generateSessionId()
      Returns a new session ID.
    • exists

      CompletableFuture<Boolean> exists(String sessionId)
      Returns whether the session which has the specified sessionId exists.
      Parameters:
      sessionId - the session ID
    • get

      CompletableFuture<Session> get(String sessionId)
      Returns the session which has the specified sessionId.
      Parameters:
      sessionId - the session ID
    • create

      CompletableFuture<Void> create(Session session)
      Creates the specified session in the session storage.
      Parameters:
      session - the session to be stored
    • update

      CompletableFuture<Void> update(Session session)
      Updates the specified session if it exists.
      Parameters:
      session - the session to be updated
    • delete

      CompletableFuture<Void> delete(String sessionId)
      Deletes the specified session from the session storage.
      Parameters:
      sessionId - the session ID to be removed