Interface SessionDao

All Known Implementing Classes:
MongoSessionDao

public interface SessionDao
Manages instances of Session.
  • Method Details

    • getBySessionSecret

      Session getBySessionSecret(String sessionSecret)
      Gets the Session by it's session id, as returned by SessionCreation.getSessionSecret() ()}. Throwing an appropriate exception type if the Session can't be found.
      Parameters:
      sessionSecret - the session's ID
      Returns:
      the Session never null
    • refresh

      Session refresh(String sessionSecret, long expiry)
      Refreshs the Session with the supplied expiry.
      Parameters:
      sessionSecret - the session secret key
      expiry - the expiry timestamp, as expression milliseconds since the Unix epoch
      Returns:
      the updated Session
    • create

      SessionCreation create(Session session)
      Creates a Session with the provided Session object. This will return an instance of SessionCreation providing a secret key which can be used to access the Session in the future.
      Parameters:
      session -
      Returns:
      the SessionCreation as it was created in the database
    • blacklist

      void blacklist(String userId, String sessionSecret)
      Deletes the Session instance. The secret is determined by SessionCreation.getSessionSecret().
      Parameters:
      userId - the user ID owning the session
      sessionSecret - the session secret