
public.javadoc.org.spincast.plugins.session.SpincastSessionManagerDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
SpincastSessionManagerDefault (org.spincast:spincast-framework 2.1.1 API)
Package org.spincast.plugins.session
Class SpincastSessionManagerDefault
java.lang.Object
org.spincast.plugins.session.SpincastSessionManagerDefault
- All Implemented Interfaces:
SpincastSessionManager
-
Field Summary
Fields
Modifier and Type
Field
Description
protected static final org.slf4j.Logger
static final String
The name of the request context variable used to save the user session.
-
Constructor Summary
Constructors
Constructor
Description
SpincastSessionManagerDefault(SpincastSessionFactory spincastSessionFactory,
com.google.inject.Provider<RequestContext<?>> requestContextProvider,
JsonManager jsonManager,
SpincastSessionConfig spincastSessionConfig,
SpincastSessionRepository spincastSessionRepository,
CookieFactory cookieFactory,
SpincastConfig spincastConfig)
-
Method Summary
Modifier and Type
Method
Description
Creates a new session.
createSession(String sessionId,
Instant creationDate,
Instant modificationDate,
JsonObject attributes)
Creates a session from infos, with existing
attributes if any (null
otherwise)
void
Deletes the current session in the request
context, if any.
void
deleteOldInactiveSession(int sessionMaxInactiveMinutes)
Deletes the deletes that were inactive for too long.
void
deleteSession(String sessionId)
Deletes a saved session.
void
Deletes the session id on the user.
Generates a new session id.
protected CookieFactory
Gets the session of the current user, from the
request context.
protected JsonManager
protected com.google.inject.Provider<RequestContext<?>>
getSavedSession(String sessionId)
Gets a session from the database/data source.
protected SpincastConfig
protected SpincastSessionConfig
protected SpincastSessionFactory
protected SpincastSessionRepository
void
saveSession(SpincastSession session)
Save session.
void
saveSessionIdOnUser(String sessionId,
boolean permanent)
Will save the session id to the user (by default using
a cookie).
protected void
saveSessionIdOnUser(RequestContext<?> context,
String sessionId,
boolean permanent)
final void
Saves a session, but update its modification date first.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
REQUEST_CONTEXT_VARIABLE_SESSION
The name of the request context variable used to save the user session.
-
Constructor Details
-
SpincastSessionManagerDefault
@Inject
public SpincastSessionManagerDefault(SpincastSessionFactory spincastSessionFactory,
com.google.inject.Provider<RequestContext<?>> requestContextProvider,
JsonManager jsonManager,
SpincastSessionConfig spincastSessionConfig,
SpincastSessionRepository spincastSessionRepository,
CookieFactory cookieFactory,
SpincastConfig spincastConfig)
-
Method Details
-
getSpincastSessionFactory
-
getRequestContextProvider
-
getJsonManager
-
getSpincastSessionConfig
-
getSpincastSessionRepository
-
getCookieFactory
-
getSpincastConfig
-
createNewSession
Description copied from interface: SpincastSessionManager
Creates a new session.
- Specified by:
createNewSession
in interface SpincastSessionManager
-
createSession
public SpincastSession createSession(String sessionId,
Instant creationDate,
Instant modificationDate,
JsonObject attributes)
Description copied from interface: SpincastSessionManager
Creates a session from infos, with existing
attributes if any (null
otherwise)
- Specified by:
createSession
in interface SpincastSessionManager
-
getCurrentSession
Description copied from interface: SpincastSessionManager
Gets the session of the current user, from the
request context. If not in a request context,
returns null
.
- Specified by:
getCurrentSession
in interface SpincastSessionManager
-
generateNewSessionId
Description copied from interface: SpincastSessionManager
Generates a new session id.
- Specified by:
generateNewSessionId
in interface SpincastSessionManager
-
deleteSessionIdOnUser
public void deleteSessionIdOnUser()
Description copied from interface: SpincastSessionManager
Deletes the session id on the user. By default, will delete
the session id cookie.
- Specified by:
deleteSessionIdOnUser
in interface SpincastSessionManager
-
saveSessionIdOnUser
Description copied from interface: SpincastSessionManager
Will save the session id to the user (by default using
a cookie).
- Specified by:
saveSessionIdOnUser
in interface SpincastSessionManager
permanent
- if true
, the session id will be kept
when the browser session expires.
-
saveSessionIdOnUser
-
updateModificationDateAndSaveSession
Description copied from interface: SpincastSessionManager
Saves a session, but update its modification date first.
The session to save must have a session id.
- Specified by:
updateModificationDateAndSaveSession
in interface SpincastSessionManager
-
deleteCurrentSession
public void deleteCurrentSession()
Description copied from interface: SpincastSessionManager
Deletes the current session in the request
context, if any.
- Specified by:
deleteCurrentSession
in interface SpincastSessionManager
-
getSavedSession
Description copied from interface: SpincastSessionManager
Gets a session from the database/data source.
- Specified by:
getSavedSession
in interface SpincastSessionManager
- Returns:
- the session or
null
if not found.
-
saveSession
Description copied from interface: SpincastSessionManager
Save session.
- Specified by:
saveSession
in interface SpincastSessionManager
-
deleteSession
Description copied from interface: SpincastSessionManager
Deletes a saved session.
- Specified by:
deleteSession
in interface SpincastSessionManager
-
deleteOldInactiveSession
public void deleteOldInactiveSession(int sessionMaxInactiveMinutes)
Description copied from interface: SpincastSessionManager
Deletes the deletes that were inactive for too long.
This means their last "modification date" must be older than
the specified number of mminutes.
- Specified by:
deleteOldInactiveSession
in interface SpincastSessionManager
© 2015 - 2025 Weber Informatics LLC | Privacy Policy