Package dev.getelements.elements.sdk.dao
Interface SessionDao
- All Known Implementing Classes:
MongoSessionDao
public interface SessionDao
Manages instances of
Session
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes theSession
instance.getBySessionSecret
(String sessionSecret) Gets theSession
by it's session id, as returned bySessionCreation.getSessionSecret()
()}.Refreshs theSession
with the supplied expiry.
-
Method Details
-
getBySessionSecret
Gets theSession
by it's session id, as returned bySessionCreation.getSessionSecret()
()}. Throwing an appropriate exception type if theSession
can't be found.- Parameters:
sessionSecret
- the session's ID- Returns:
- the
Session
never null
-
refresh
Refreshs theSession
with 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 aSession
with the providedSession
object. This will return an instance ofSessionCreation
providing a secret key which can be used to access theSession
in the future.- Parameters:
session
-- Returns:
- the
SessionCreation
as it was created in the database
-
blacklist
Deletes theSession
instance. The secret is determined bySessionCreation.getSessionSecret()
.- Parameters:
userId
- the user ID owning the sessionsessionSecret
- the session secret
-