Interface SessionStore
public interface SessionStore
Strategy interface for where Manager's own session cookies live — sibling to
AuthBackend (local-DB-vs-Cognito for the *user directory*; this is in-memory-vs-Redis for
*which session cookies this process currently recognizes*, an orthogonal concern). A local,
single-instance Manager needs nothing beyond an in-memory map; a horizontally-scaled Manager
behind a load balancer needs every instance to recognize a session created by any other
instance, which an in-memory store can never do regardless of how the user directory itself is
configured — see SessionManager's javadoc in cloudforge-manager for the full story.
Deliberately framework-agnostic (no Spring, no Redis client types) — implementations live in
cloudforge-manager, same split as AuthBackend.
-
Method Summary
Modifier and TypeMethodDescriptionEvery subject with at least one active session right now.intcountForSubject(String subject) How many active sessionssubjectcurrently has.Creates a new session forsubject, returning the opaque cookie value.voidinvalidate(String sessionId) Ends one session.intinvalidateAllForSubject(String subject) Ends every session belonging tosubject(admin force-logout).booleanisLoggedIn(String subject) True ifsubjecthas at least one active (non-expired) session.longSession TTL, in seconds — the sliding window each successfulresolveSubject(String)and freshcreate(String)extends.resolveSubject(String sessionId) Resolves a session cookie to its owning subject, refreshing its TTL (sliding expiry) if still valid.
-
Method Details
-
create
-
resolveSubject
-
invalidate
Ends one session. No-op if the cookie is already unknown/expired. -
invalidateAllForSubject
Ends every session belonging tosubject(admin force-logout). Returns how many were actually active and removed. -
isLoggedIn
True ifsubjecthas at least one active (non-expired) session. -
countForSubject
How many active sessionssubjectcurrently has. -
activeSubjects
-
maxAgeSeconds
long maxAgeSeconds()Session TTL, in seconds — the sliding window each successfulresolveSubject(String)and freshcreate(String)extends.
-