public interface SessionRepository extends Closeable
Serializable or convertible into
binary representation using a SerializerDeserializer implementation.| Modifier and Type | Interface and Description |
|---|---|
static interface |
SessionRepository.CommitTransaction
The commit transaction on the session.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
cleanSessionsOnShutdown()
If repository supports cleaning of sessions on application shutdown, it
should return
true from this method. |
void |
close()
Called to shutdown the repository and release resources.
|
Set<String> |
getAllKeys(SessionData sessionData)
Get all attribute keys stored in the session.
|
Collection<String> |
getOwnedSessionIds()
Returns session ids stored in repository and owned by current application
node.
|
Object |
getSessionAttribute(SessionData sessionData,
String attribute)
Returns value of the attribute or
null if attribute or session
have not been found |
SessionData |
getSessionData(String id)
Retrieves global session data from repository.
|
boolean |
prepareRemove(SessionData session)
Prepares session repository for removal of session.
|
void |
remove(SessionData sessionData)
Removes session from the repository.
|
void |
removeSessionAttribute(SessionData sessionData,
String name)
The attribute for the session will be removed from the repository.
|
void |
requestFinished()
Called to clean up resources after the request has been completed and the
session will no longer be used in the current thread.
|
void |
sessionIdChange(SessionData sessionData)
Called by session manager to notify repository that session id has changed.
|
void |
setSessionAttribute(SessionData sessionData,
String name,
Object value)
Sets the value of the attribute for the session in the repository.
|
void |
setSessionManager(SessionManager sessionManager)
Links repository with the session management.
|
SessionRepository.CommitTransaction |
startCommit(SessionData sessionData)
Starts transaction on remote session.
|
void |
storeSessionData(SessionData sessionData)
Stores global session data into repository
|
SessionData getSessionData(String id)
id - the session idnull
if data wasn't found in repository.void storeSessionData(SessionData sessionData)
sessionData - the session informationSet<String> getAllKeys(SessionData sessionData)
sessionData - the session informationObject getSessionAttribute(SessionData sessionData, String attribute)
null if attribute or session
have not been foundsessionData - the session informationattribute - the key of the attribute to retrievenull if attribute or session
have not been foundvoid remove(SessionData sessionData)
sessionData - the session informationboolean prepareRemove(SessionData session)
true if caller can proceed with session
removal.session - the session informationtrue if caller can proceed with session removalvoid setSessionManager(SessionManager sessionManager)
SessionManager.sessionManager - the session manager to associatevoid requestFinished()
void setSessionAttribute(SessionData sessionData, String name, Object value)
sessionData - the session informationname - attribute namevalue - attribute value. If session is stored remotely, attribute should
be Serializable.void removeSessionAttribute(SessionData sessionData, String name)
sessionData - the session informationname - attribute nameSessionRepository.CommitTransaction startCommit(SessionData sessionData)
SessionRepository.CommitTransaction for more information.sessionData - the session informationboolean cleanSessionsOnShutdown()
true from this method.true if repository supports cleaning of sessions on
application shutdownCollection<String> getOwnedSessionIds()
UnsupportedOperationException if repository
doesn't offer this functionality.void close()
close in interface AutoCloseableclose in interface Closeablevoid sessionIdChange(SessionData sessionData)
sessionData - the session informationCopyright © 2018 Amadeus s.a.s.. All rights reserved.