public static class LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger extends Object implements LifecycleAwareSessionManagerSupport.RefreshTrigger
LifecycleAwareSessionManagerSupport.RefreshTrigger
implementation using a fixed timeout to schedule renewal
before a LoginToken
expires.Constructor and Description |
---|
FixedTimeoutRefreshTrigger(Duration timeout)
Create a new
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger to calculate execution times of
timeout before the LoginToken expires. |
FixedTimeoutRefreshTrigger(Duration timeout,
Duration validTtlThreshold)
Create a new
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger to calculate execution times of
timeout before the LoginToken expires. |
FixedTimeoutRefreshTrigger(long timeout,
TimeUnit timeUnit)
Create a new
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger to calculate execution times of
timeout before the LoginToken expires |
Modifier and Type | Method and Description |
---|---|
Duration |
getValidTtlThreshold(LoginToken loginToken)
Returns the minimum TTL duration to consider a token valid after renewal.
|
Date |
nextExecutionTime(LoginToken loginToken)
Determine the next execution time according to the given trigger context.
|
public FixedTimeoutRefreshTrigger(long timeout, TimeUnit timeUnit)
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times of
timeout
before the LoginToken
expirestimeout
- timeout value, non-negative long value.timeUnit
- must not be null.public FixedTimeoutRefreshTrigger(Duration timeout)
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times of
timeout
before the LoginToken
expires. Valid TTL threshold is
set to two seconds longer to compensate for timing issues during scheduling.timeout
- timeout value.public FixedTimeoutRefreshTrigger(Duration timeout, Duration validTtlThreshold)
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times of
timeout
before the LoginToken
expires.timeout
- timeout value.validTtlThreshold
- minimum TTL duration to consider a Token as valid.
Tokens with a shorter TTL are not used anymore. Should be greater than
timeout
to prevent token expiry.public Date nextExecutionTime(LoginToken loginToken)
LifecycleAwareSessionManagerSupport.RefreshTrigger
nextExecutionTime
in interface LifecycleAwareSessionManagerSupport.RefreshTrigger
loginToken
- login token encapsulating renewability and lease duration.null
if
the trigger won't fire anymorepublic Duration getValidTtlThreshold(LoginToken loginToken)
LifecycleAwareSessionManagerSupport.RefreshTrigger
getValidTtlThreshold
in interface LifecycleAwareSessionManagerSupport.RefreshTrigger
loginToken
- the login token after renewal.Duration
to consider a token valid.Copyright © 2016–2019 Pivotal Software, Inc.. All rights reserved.