Package dev.getelements.elements.sdk.dao
Interface SessionDao
- All Known Implementing Classes:
MongoSessionDao
public interface SessionDao
Manages instances of
Session.-
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes theSessioninstance.getBySessionSecret(String sessionSecret) Gets theSessionby it's session id, as returned bySessionCreation.getSessionSecret()()}.Refreshs theSessionwith the supplied expiry.
-
Method Details
-
getBySessionSecret
Gets theSessionby it's session id, as returned bySessionCreation.getSessionSecret()()}. Throwing an appropriate exception type if theSessioncan't be found.- Parameters:
sessionSecret- the session's ID- Returns:
- the
Sessionnever null
-
refresh
Refreshs theSessionwith the supplied expiry.- Parameters:
sessionSecret- the session secret keyexpiry- the expiry timestamp, as expression milliseconds since the Unix epoch- Returns:
- the updated
Session
-
create
Creates aSessionwith the providedSessionobject. This will return an instance ofSessionCreationproviding a secret key which can be used to access theSessionin the future.- Parameters:
session-- Returns:
- the
SessionCreationas it was created in the database
-
blacklist
Deletes theSessioninstance. The secret is determined bySessionCreation.getSessionSecret().- Parameters:
userId- the user ID owning the sessionsessionSecret- the session secret
-