public class SpincastSessionRepositoryDefault extends Object implements SpincastSessionRepository
SpincastSessionRepository
is to save the sessions in a cookie, on the user.
We highly suggest that you bind a custom implementation that saved sessions in a real database instead!
A cookie can contain +/- 4096 bytes maximum!
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpincastSessionRepositoryDefault(com.google.inject.Provider<RequestContext<?>> requestContextProvider,
SpincastSessionConfig spincastSessionConfig,
SpincastSessionFactory spincastSessionFactory,
JsonManager jsonManager) |
| Modifier and Type | Method and Description |
|---|---|
protected SpincastSession |
createNewSpincastSession() |
void |
deleteOldInactiveSession(int sessionMaxInactiveMinutes)
Deletes the deletes that were inactive for too long.
|
void |
deleteSession(String sessionId)
Deletes a saved session.
|
protected SpincastSession |
deserializeSession(String sessionValue) |
protected JsonManager |
getJsonManager() |
protected com.google.inject.Provider<RequestContext<?>> |
getRequestContextProvider() |
SpincastSession |
getSession(String sessionId)
Gets a session from the database/data source.
|
protected String |
getSessionAttributeNameCreationDate() |
protected String |
getSessionAttributeNameId() |
protected String |
getSessionAttributeNameModificationDate() |
protected SpincastSessionConfig |
getSpincastSessionConfig() |
protected SpincastSessionFactory |
getSpincastSessionFactory() |
void |
saveSession(SpincastSession session)
Save a session.
|
protected String |
serializeSession(SpincastSession session) |
@Inject public SpincastSessionRepositoryDefault(com.google.inject.Provider<RequestContext<?>> requestContextProvider, SpincastSessionConfig spincastSessionConfig, SpincastSessionFactory spincastSessionFactory, JsonManager jsonManager)
protected com.google.inject.Provider<RequestContext<?>> getRequestContextProvider()
protected SpincastSessionConfig getSpincastSessionConfig()
protected SpincastSessionFactory getSpincastSessionFactory()
protected JsonManager getJsonManager()
public SpincastSession getSession(String sessionId)
SpincastSessionRepositorygetSession in interface SpincastSessionRepositorynull if not found.public void saveSession(SpincastSession session)
SpincastSessionRepositorysaveSession in interface SpincastSessionRepositorypublic void deleteSession(String sessionId)
SpincastSessionRepositorydeleteSession in interface SpincastSessionRepositorypublic void deleteOldInactiveSession(int sessionMaxInactiveMinutes)
SpincastSessionRepositorydeleteOldInactiveSession in interface SpincastSessionRepositoryprotected String serializeSession(SpincastSession session)
protected SpincastSession deserializeSession(String sessionValue)
protected SpincastSession createNewSpincastSession()
protected String getSessionAttributeNameId()
protected String getSessionAttributeNameCreationDate()
protected String getSessionAttributeNameModificationDate()
Copyright © 2019. All rights reserved.