Interface SubjectSessionRegistry
- All Known Implementing Classes:
InMemorySubjectSessionRegistry, StoreBackedSubjectSessionRegistry
public interface SubjectSessionRegistry
Tracks active sessions per
SubjectId.
The LogoutService consults the registry to enumerate all
sessions for a subject when handling
LogoutScope.AllSessionsOfSubject. Each session is identified
by an opaque application-defined string (a token, a Vaadin session id,
a Servlet session id) so the registry stays adapter-neutral.
Implementations must be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionForgets every association forsubjectId.voidRecords thatsessionIdbelongs tosubjectId.sessionsOf(SubjectId subjectId) Returns every session id currently associated withsubjectId.voidunregister(SubjectId subjectId, String sessionId) Removes the(subjectId, sessionId)association if present.
-
Method Details
-
register
-
unregister
-
sessionsOf
Returns every session id currently associated withsubjectId. The returned collection is a snapshot; subsequentregister/unregistercalls do not leak into it.- Parameters:
subjectId- subject to query- Returns:
- snapshot of active session ids, possibly empty
-
clearAll
Forgets every association forsubjectId. Returns the set of removed session ids so the caller can drive downstream cleanup (e.g. revoke tokens, invalidate Vaadin sessions).- Parameters:
subjectId- subject whose sessions to forget- Returns:
- removed session ids
-