Package com.io7m.idstore.server.internal

# Class IdUserSessionService

java.lang.Object
com.io7m.idstore.server.internal.IdUserSessionService

All Implemented Interfaces:
  `IdServiceType`, `jakarta.servlet.http.HttpSessionListener`, `EventListener`

public final class IdUserSessionService extends Object implements IdServiceType, jakarta.servlet.http.HttpSessionListener
A service to create and manage user sessions.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IdUserSessionService(IdServerTelemetryService inTelemetry)`
  A service to create and manage user sessions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IdUserSession`
  `createOrGet(UUID userId, String sessionId)`
  Create or get an existing user session.
  `void`
  `delete(UUID userId, String sessionId)`
  Delete a user session if one exists.
  `String`
  `description()`
  `void`
  `sessionCreated(jakarta.servlet.http.HttpSessionEvent se)`
  `void`
  `sessionDestroyed(jakarta.servlet.http.HttpSessionEvent se)`
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### IdUserSessionService

    public IdUserSessionService(IdServerTelemetryService inTelemetry)
    A service to create and manage user sessions.
    Parameters:
      `inTelemetry` - The telemetry service

- ## Method Details

  - ### description

    public String description()
    Specified by:
      `description` in interface `IdServiceType`
    Returns:
      The service description

  - ### createOrGet

    public IdUserSession createOrGet(UUID userId, String sessionId)
    Create or get an existing user session.
    Parameters:
      `userId` - The user ID
      `sessionId` - The session ID
    Returns:
      A user session

  - ### sessionCreated

    public void sessionCreated(jakarta.servlet.http.HttpSessionEvent se)
    Specified by:
      `sessionCreated` in interface `jakarta.servlet.http.HttpSessionListener`

  - ### sessionDestroyed

    public void sessionDestroyed(jakarta.servlet.http.HttpSessionEvent se)
    Specified by:
      `sessionDestroyed` in interface `jakarta.servlet.http.HttpSessionListener`

  - ### delete

    public void delete(UUID userId, String sessionId)
    Delete a user session if one exists.
    Parameters:
      `userId` - The user ID
      `sessionId` - The session ID

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`