Interface SessionExpirationPolicy
- All Known Implementing Classes:
FixedTimeoutSessionExpirationPolicy
,IdleTimeoutSessionExpirationPolicy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The
SessionExpirationPolicy
interface is a Strategy Interface defining a contract for users to implement
custom application expiration policies and rules for Session
state management.
Examples of different Session
expiration strategies might include, but are not limited to:
idle expiration timeouts, fixed duration expiration timeouts, Time-To-Live (TTL) expiration, and so on.- Since:
- 2.1.0
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Enumeration of different actions to take when aSession
expires. -
Method Summary
Modifier and TypeMethodDescriptiondetermineExpirationTimeout
(org.springframework.session.Session session) Specifies theaction
to take when theSession
expires.
-
Method Details
-
determineExpirationTimeout
Determines anOptional
length of time
until the givenSession
will expire. AZero
orNegative Duration
indicates that theSession
has expired. May returnOptional.EMPTY
as a "suggestion" that the Session should not expire or that the expiration determination should be handled by the next expiration policy in a chain of policies. Implementors are free to compose 2 or more expiration policies using Composite Software Design Pattern as necessary. In Apache Geode or Pivotal GemFire's case, anOptional.EMPTY
return value will indicate that it should default to the configured Entry Idle Timeout (TTI) Expiration Policy of theRegion
managingSession
state to determine exactly when theSession
will expire. -
getExpirationAction
Specifies theaction
to take when theSession
expires. Defaults toSessionExpirationPolicy.ExpirationAction.INVALIDATE
.- Returns:
- an
SessionExpirationPolicy.ExpirationAction
specifying the action to take when theSession
expires. - See Also:
-