public class FixedTimeoutSessionExpirationPolicy extends IdleTimeoutSessionExpirationPolicy
SessionExpirationPolicy
interface that specifies an expiration policy based on
a fixed duration of time
.
In other words, the Session
will timeout after a fixed duration of time
even if
the Session
is still active (i.e. not idle).Duration
,
Session
,
SessionExpirationPolicy
,
IdleTimeoutSessionExpirationPolicy
SessionExpirationPolicy.ExpirationAction
DEFAULT_IDLE_TIMEOUT
Constructor and Description |
---|
FixedTimeoutSessionExpirationPolicy(java.time.Duration fixedTimeout)
Constructs a new
FixedTimeoutSessionExpirationPolicy initialized with
the given fixed, expiration timeout . |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.time.Duration> |
determineExpirationTimeout(org.springframework.session.Session session)
Determines an
Optional length of time until the given Session will expire. |
protected java.time.Duration |
getFixedTimeout()
Return the configured
fixed expiration timeout . |
getIdleTimeout, setExpirationTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExpirationAction
public FixedTimeoutSessionExpirationPolicy(@NonNull java.time.Duration fixedTimeout)
FixedTimeoutSessionExpirationPolicy
initialized with
the given fixed, expiration timeout
.fixedTimeout
- fixed length of time
until the Session
will expire.java.lang.IllegalArgumentException
- if the fixed timeout
is null.Duration
protected java.time.Duration getFixedTimeout()
fixed expiration timeout
.fixed expiration timeout
.Duration
public java.util.Optional<java.time.Duration> determineExpirationTimeout(@NonNull org.springframework.session.Session session)
SessionExpirationPolicy
Optional
length of time
until the given Session
will expire.
A Zero
or Negative Duration
indicates that
the Session
has expired.
May return Optional.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, an Optional.EMPTY
return value will indicate that it
should default to the configured Entry Idle Timeout (TTI) Expiration Policy of the Region
managing
Session
state to determine exactly when the Session
will expire.determineExpirationTimeout
in interface SessionExpirationPolicy
determineExpirationTimeout
in class IdleTimeoutSessionExpirationPolicy
session
- Session
to evaluate. Session
is required.Optional
Duration
specifying the length of time until the Session
will expire.Session
,
Duration
,
Optional