Class SpincastSessionRepositoryDefault
java.lang.Object
org.spincast.plugins.session.repositories.SpincastSessionRepositoryDefault
- All Implemented Interfaces:
SpincastSessionRepository
The default implementation of
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!
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpincastSessionRepositoryDefault(com.google.inject.Provider<RequestContext<?>> requestContextProvider, SpincastSessionConfig spincastSessionConfig, SpincastSessionFactory spincastSessionFactory, JsonManager jsonManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected SpincastSessionvoiddeleteOldInactiveSession(int sessionMaxInactiveMinutes) Deletes the deletes that were inactive for too long.voiddeleteSession(String sessionId) Deletes a saved session.protected SpincastSessiondeserializeSession(String sessionValue) protected JsonManagerprotected com.google.inject.Provider<RequestContext<?>>getSession(String sessionId) Gets a session from the database/data source.protected Stringprotected Stringprotected Stringprotected SpincastSessionConfigprotected SpincastSessionFactoryvoidsaveSession(SpincastSession session) Save a session.protected StringserializeSession(SpincastSession session)
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
SpincastSessionRepositoryDefault
@Inject public SpincastSessionRepositoryDefault(com.google.inject.Provider<RequestContext<?>> requestContextProvider, SpincastSessionConfig spincastSessionConfig, SpincastSessionFactory spincastSessionFactory, JsonManager jsonManager)
-
-
Method Details
-
getRequestContextProvider
-
getSpincastSessionConfig
-
getSpincastSessionFactory
-
getJsonManager
-
getSession
Description copied from interface:SpincastSessionRepositoryGets a session from the database/data source.- Specified by:
getSessionin interfaceSpincastSessionRepository- Returns:
- the session or
nullif not found.
-
saveSession
Description copied from interface:SpincastSessionRepositorySave a session.- Specified by:
saveSessionin interfaceSpincastSessionRepository
-
deleteSession
Description copied from interface:SpincastSessionRepositoryDeletes a saved session.- Specified by:
deleteSessionin interfaceSpincastSessionRepository
-
deleteOldInactiveSession
public void deleteOldInactiveSession(int sessionMaxInactiveMinutes) Description copied from interface:SpincastSessionRepositoryDeletes 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:
deleteOldInactiveSessionin interfaceSpincastSessionRepository
-
serializeSession
-
deserializeSession
-
createNewSpincastSession
-
getSessionAttributeNameId
-
getSessionAttributeNameCreationDate
-
getSessionAttributeNameModificationDate
-