Class MongoSessionDao

java.lang.Object
dev.getelements.elements.dao.mongo.MongoSessionDao
All Implemented Interfaces:
SessionDao

public class MongoSessionDao extends Object implements SessionDao
  • Constructor Details

    • MongoSessionDao

      public MongoSessionDao()
  • Method Details

    • getBySessionSecret

      public Session getBySessionSecret(String sessionSecret)
      Description copied from interface: SessionDao
      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.
      Specified by:
      getBySessionSecret in interface SessionDao
      Parameters:
      sessionSecret - the session's ID
      Returns:
      the Session never null
    • refresh

      public Session refresh(String sessionSecret, long expiry)
      Description copied from interface: SessionDao
      Refreshs the Session with the supplied expiry.
      Specified by:
      refresh in interface SessionDao
      Parameters:
      sessionSecret - the session secret key
      expiry - the expiry timestamp, as expression milliseconds since the Unix epoch
      Returns:
      the updated Session
    • create

      public SessionCreation create(Session session)
      Description copied from interface: SessionDao
      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.
      Specified by:
      create in interface SessionDao
      Parameters:
      session -
      Returns:
      the SessionCreation as it was created in the database
    • blacklist

      public void blacklist(String userId, String sessionSecret)
      Description copied from interface: SessionDao
      Deletes the Session instance. The secret is determined by SessionCreation.getSessionSecret().
      Specified by:
      blacklist in interface SessionDao
      Parameters:
      userId - the user ID owning the session
      sessionSecret - the session secret
    • validate

      public void validate(Session session)
    • getValidationHelper

      public ValidationHelper getValidationHelper()
    • setValidationHelper

      @Inject public void setValidationHelper(ValidationHelper validationHelper)
    • getMongoDBUtils

      public MongoDBUtils getMongoDBUtils()
    • setMongoDBUtils

      @Inject public void setMongoDBUtils(MongoDBUtils mongoDBUtils)
    • getDatastore

      public dev.morphia.Datastore getDatastore()
    • setDatastore

      @Inject public void setDatastore(dev.morphia.Datastore datastore)
    • getMongoUserDao

      public MongoUserDao getMongoUserDao()
    • setMongoUserDao

      @Inject public void setMongoUserDao(MongoUserDao mongoUserDao)
    • getMessageDigestProvider

      public jakarta.inject.Provider<MessageDigest> getMessageDigestProvider()
    • setMessageDigestProvider

      @Inject public void setMessageDigestProvider(@Named("dev.getelements.elements.password.digest") jakarta.inject.Provider<MessageDigest> messageDigestProvider)
    • getMapper

      public MapperRegistry getMapper()
    • setMapper

      @Inject public void setMapper(MapperRegistry mapperRegistry)