Package com.io7m.idstore.server.service.sessions

# 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:
  `com.io7m.repetoir.core.RPServiceType`

Direct Known Subclasses:
  `IdSessionAdminService`, `IdSessionUserService`

public abstract class IdSessionService<S extends IdSessionType> extends Object implements com.io7m.repetoir.core.RPServiceType
A service to create and manage sessions.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `IdSessionService(IdMetricsServiceType inMetrics, Duration inExpiration, IdUserDomain inType, BiFunction<UUID,IdSessionSecretIdentifier,S> inSessionCreator)`
  A service to create and manage sessions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final S`
  `createSession(UUID userId)`
  Create a new session.
  `void`
  `deleteSession(IdSessionSecretIdentifier id)`
  Delete an existing session.
  `final Optional<S>`
  `findSession(IdSessionSecretIdentifier id)`
  Find a session with the given identifier.
  `protected abstract org.slf4j.Logger`
  `logger()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.io7m.repetoir.core.RPServiceType

  `description`

- ## Constructor Details

  - ### IdSessionService

    protected IdSessionService(IdMetricsServiceType inMetrics, Duration inExpiration, IdUserDomain inType, BiFunction<UUID,IdSessionSecretIdentifier,S> inSessionCreator)
    A service to create and manage sessions.
    Parameters:
      `inMetrics` - The metrics service
      `inExpiration` - The session expiration time
      `inType` - 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