Class DefaultSessionService

java.lang.Object
dev.getelements.elements.service.auth.DefaultSessionService
All Implemented Interfaces:
SessionService

public class DefaultSessionService extends Object implements SessionService
  • Constructor Details

    • DefaultSessionService

      public DefaultSessionService()
  • Method Details

    • checkAndRefreshSessionIfNecessary

      public Session checkAndRefreshSessionIfNecessary(String sessionSecret)
      Description copied from interface: SessionService
      Finds an instance of Session based on the id, as determined by SessionCreation.getSessionSecret(). In addition to performing a check for a valid Session, this will reset the expiry of the Session.
      Specified by:
      checkAndRefreshSessionIfNecessary in interface SessionService
      Parameters:
      sessionSecret - the Session identifier
      Returns:
      the Session, never null. Throws the appropriate exception if session isn't found.
    • blacklistSession

      public void blacklistSession(String userId, String sessionSecret)
      Description copied from interface: SessionService
      Blacklists the Session instance currently in-use for the specific user id as returned by User.getId()
      Specified by:
      blacklistSession in interface SessionService
      Parameters:
      userId - the user is
      sessionSecret - the session secret
    • getSessionDao

      public SessionDao getSessionDao()
    • setSessionDao

      @Inject public void setSessionDao(SessionDao sessionDao)
    • getSessionTimeoutSeconds

      public long getSessionTimeoutSeconds()
    • setSessionTimeoutSeconds

      @Inject public void setSessionTimeoutSeconds(@Named("dev.getelements.elements.session.timeout.seconds") long sessionTimeoutSeconds)