Interface SessionStore
- All Known Implementing Classes:
InMemorySessionStore
Store for
SessionRecords, keyed on SessionId.
Distinct from the existing
SubjectSessionRegistry
which only maps a subject to its set of active session
ids (an index used by multi-session logout). SessionStore
owns the canonical, queryable representation of every session —
including expired and revoked ones, until they age out via
retention.
Mutation pattern: load a record, copy-with via the with…
methods on SessionRecord, save the new value. Stores upsert
on save(SessionRecord) — there is no separate update call.
Implementations must be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanRemoves the record forsessionId.default List<SessionRecord> findAll()Returns every record currently persisted, in insertion order.Looks up the record for a session id.findBySubject(TenantId tenant, SubjectId subjectId) Returns every record (in anySessionStatus) belonging tosubjectIdwithintenant, in insertion order (oldest first).voidsave(SessionRecord session) Persists or replaces the supplied session record.
-
Method Details
-
save
Persists or replaces the supplied session record. Keyed onSessionRecord.sessionId().- Parameters:
session- record to persist; must not benull
-
findById
Looks up the record for a session id.- Parameters:
sessionId- session identifier; must not benull- Returns:
- the record, if present
-
findBySubject
Returns every record (in anySessionStatus) belonging tosubjectIdwithintenant, in insertion order (oldest first).- Parameters:
tenant- tenant scope; must not benullsubjectId- subject; must not benull- Returns:
- immutable list of records; empty when none exist
-
delete
Removes the record forsessionId.- Parameters:
sessionId- session identifier; must not benull- Returns:
trueif a record was removed,falsewhen no such session existed
-
findAll
Returns every record currently persisted, in insertion order. Used by admin tooling — e.g. the Phase-8aSessionManagementView— that needs the full session inventory across all subjects.Default returns an empty list so pre-existing implementations keep compiling; concrete stores override.
- Returns:
- immutable list of records, possibly empty; never
null
-