Interface ClientSessionManager
- All Known Implementing Classes:
InfinispanUserSessionProvider,PersistentUserSessionProvider
public interface ClientSessionManager
Manages transactional context for
AuthenticatedClientSessionModel changes.
It collects all modifications (the changelog) within the current transaction and applies them to the database only upon a successful commit.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddChange(EmbeddedClientSessionKey key, PersistentSessionUpdateTask<AuthenticatedClientSessionEntity> task) Adds a update task to the changelog for a specific client session.voidrestartEntity(EmbeddedClientSessionKey key, PersistentSessionUpdateTask<AuthenticatedClientSessionEntity> task) Resets and replaces the state of the persistedAuthenticatedClientSessionEntityfor the given session.
-
Method Details
-
addChange
void addChange(EmbeddedClientSessionKey key, PersistentSessionUpdateTask<AuthenticatedClientSessionEntity> task) Adds a update task to the changelog for a specific client session.When the transaction commits, this task will apply its changes to the persisted
AuthenticatedClientSessionEntity, effectively updating the correspondingAuthenticatedClientSessionModel. MultipleaddChangecalls for the same session are accumulated (merged).- Parameters:
key- The identifier for the target client session.task- The operation containing the changes to apply to the persisted entity.- Throws:
NullPointerException- ifkeyortaskisnull.
-
restartEntity
void restartEntity(EmbeddedClientSessionKey key, PersistentSessionUpdateTask<AuthenticatedClientSessionEntity> task) Resets and replaces the state of the persistedAuthenticatedClientSessionEntityfor the given session.All previously added changes via
addChangefor this session are discarded, and the provided task is executed to set the new state of the client session entity.- Parameters:
key- The identifier for the target client session.task- The operation that must set the complete new state of the persisted entity.- Throws:
NullPointerException- ifkeyortaskisnull.
-