Class IdSessionService<S extends IdSessionType>

java.lang.Object
com.io7m.idstore.server.service.sessions.IdSessionService<S>
Type Parameters:
S - The type of sessions
All Implemented Interfaces:
IdServiceType
Direct Known Subclasses:
IdSessionAdminService, IdSessionUserService

public abstract class IdSessionService<S extends IdSessionType> extends Object implements IdServiceType
A service to create and manage sessions.
  • Constructor Details

    • IdSessionService

      protected IdSessionService(io.opentelemetry.api.OpenTelemetry inTelemetry, Duration inExpiration, String type, BiFunction<UUID,IdSessionSecretIdentifier,S> inSessionCreator)
      A service to create and manage sessions.
      Parameters:
      inTelemetry - The telemetry service
      inExpiration - The session expiration time
      type - The session type
      inSessionCreator - A session creator function
  • Method Details

    • logger

      protected abstract org.slf4j.Logger logger()
    • findSession

      public final Optional<S> findSession(IdSessionSecretIdentifier id)
      Find a session with the given identifier.
      Parameters:
      id - The identifier
      Returns:
      The session
    • createSession

      public final S createSession(UUID userId)
      Create a new session.
      Parameters:
      userId - The admin ID
      Returns:
      A new session
    • deleteSession

      public void deleteSession(IdSessionSecretIdentifier id)
      Delete an existing session.
      Parameters:
      id - The session ID