# Class CASession

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

public final class CASession extends Object
A controller for a single user session.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CASession(CASessionSecretIdentifier inSessionId, CAUser inUser)`
  A controller for a single user session.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CASessionSecretIdentifier`
  `id()`
  `<T> Optional<T>`
  `property(Class<T> clazz)`
  Retrieve the value of a property.
  `<T> void`
  `setProperty(Class<T> clazz, T item)`
  Set the property.
  `com.io7m.medrina.api.MSubject`
  `subject()`
  `String`
  `toString()`
  `CAUserID`
  `userId()`

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

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

- ## Constructor Details

  - ### CASession

    public CASession(CASessionSecretIdentifier inSessionId, CAUser inUser)
    A controller for a single user session.
    Parameters:
      `inSessionId` - The session ID
      `inUser` - The user

- ## Method Details

  - ### toString

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

  - ### subject

    public com.io7m.medrina.api.MSubject subject()
    Returns:
      The user subject

  - ### id

    public CASessionSecretIdentifier id()
    Returns:
      The session identifier

  - ### userId

    public CAUserID userId()
    Returns:
      The user ID

  - ### setProperty

    public <T> void setProperty(Class<T> clazz, T item)
    Set the property.
    Type Parameters:
      `T` - The property type
    Parameters:
      `clazz` - The property class
      `item` - The property value

  - ### property

    public <T> Optional<T> property(Class<T> clazz)
    Retrieve the value of a property.
    Type Parameters:
      `T` - The property type
    Parameters:
      `clazz` - The property class
    Returns:
      The property value, if any