# Class CASessionService

java.lang.Object
com.io7m.cardant.server.service.sessions.CASessionService

All Implemented Interfaces:
  `com.io7m.repetoir.core.RPServiceType`

public final class CASessionService extends Object implements com.io7m.repetoir.core.RPServiceType
A service to create and manage sessions.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CASessionService(CAMetricsServiceType inMetrics, Duration inExpiration)`
  A service to create and manage sessions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CASession`
  `createSession(CAUserID userId, com.io7m.idstore.model.IdName name, com.io7m.medrina.api.MSubject subject)`
  Create a new session.
  `void`
  `deleteSession(CASessionSecretIdentifier id)`
  Delete an existing session.
  `String`
  `description()`
  `Optional<CASession>`
  `findSession(CASessionSecretIdentifier id)`
  Find a session with the given identifier.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### CASessionService

    public CASessionService(CAMetricsServiceType inMetrics, Duration inExpiration)
    A service to create and manage sessions.
    Parameters:
      `inMetrics` - The metrics service
      `inExpiration` - The session expiration time

- ## Method Details

  - ### findSession

    public Optional<CASession> findSession(CASessionSecretIdentifier id)
    Find a session with the given identifier.
    Parameters:
      `id` - The identifier
    Returns:
      The session

  - ### createSession

    public CASession createSession(CAUserID userId, com.io7m.idstore.model.IdName name, com.io7m.medrina.api.MSubject subject)
    Create a new session.
    Parameters:
      `userId` - The user ID
      `name` - The user's latest username
      `subject` - The user subject
    Returns:
      A new session

  - ### deleteSession

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

  - ### description

    public String description()
    Specified by:
      `description` in interface `com.io7m.repetoir.core.RPServiceType`

  - ### toString

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