Interface JSentinelVersionStatus
- All Known Implementing Classes:
JSentinelVersionStatus.Current, JSentinelVersionStatus.Drifted
@ExperimentalJSentinelApi
public sealed interface JSentinelVersionStatus
permits JSentinelVersionStatus.Current, JSentinelVersionStatus.Drifted
Result of a
JSentinelVersionCheck.check(JSentinelVersionKey, JSentinelVersion) call against a
session snapshot.
Sealed because callers in the Vaadin / REST adapters dispatch on the two outcomes — a session is either current (continue the request) or drifted (refuse the session, force re-login).
Adapter-neutral. The Vaadin adapter maps JSentinelVersionStatus.Drifted to a
reroute, the REST adapter maps it to 401 with
WWW-Authenticate: SessionStale.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordSession is still current — its snapshot matches the subject's stored version.static final recordSession has drifted — its snapshot differs from the subject's stored version. -
Method Summary
-
Method Details
-
snapshot
JSentinelVersion snapshot()- Returns:
- the version snapshot the session was opened with
-
current
JSentinelVersion current()- Returns:
- the subject's current security version
-
isCurrent
default boolean isCurrent()- Returns:
truewhensnapshot()equalscurrent(), i.e. the session is still authoritative
-
isDrifted
default boolean isDrifted()- Returns:
truewhensnapshot()differs fromcurrent(), i.e. the session must be re-validated
-