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 TypeMethodDescriptionvoid
addChange
(EmbeddedClientSessionKey key, PersistentSessionUpdateTask<AuthenticatedClientSessionEntity> task) Adds a update task to the changelog for a specific client session.void
restartEntity
(EmbeddedClientSessionKey key, PersistentSessionUpdateTask<AuthenticatedClientSessionEntity> task) Resets and replaces the state of the persistedAuthenticatedClientSessionEntity
for 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
. MultipleaddChange
calls 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
- ifkey
ortask
isnull
.
-
restartEntity
void restartEntity(EmbeddedClientSessionKey key, PersistentSessionUpdateTask<AuthenticatedClientSessionEntity> task) Resets and replaces the state of the persistedAuthenticatedClientSessionEntity
for the given session.All previously added changes via
addChange
for 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
- ifkey
ortask
isnull
.
-