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 refreshBeforeExpiry)
Create a new
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger to calculate execution times of
refreshBeforeExpiry before the LoginToken expires. |
FixedTimeoutRefreshTrigger(Duration refreshBeforeExpiry,
Duration expiryThreshold)
Create a new
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger to calculate execution times of
timeout before the LoginToken expires. |
FixedTimeoutRefreshTrigger(long refreshBeforeExpiry,
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 refreshBeforeExpiry, TimeUnit timeUnit)
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times of
timeout
before the LoginToken
expiresrefreshBeforeExpiry
- timeout value, non-negative long value that
schedules an execution of lease duration - refreshBeforeExpiry
.timeUnit
- must not be null.public FixedTimeoutRefreshTrigger(Duration refreshBeforeExpiry)
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times of
refreshBeforeExpiry
before the LoginToken
expires. Valid TTL
threshold is set to two seconds longer to compensate for timing issues during
scheduling.refreshBeforeExpiry
- timeout value for the trigger that schedules an
execution of lease duration - refreshBeforeExpiry
.public FixedTimeoutRefreshTrigger(Duration refreshBeforeExpiry, Duration expiryThreshold)
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times of
timeout
before the LoginToken
expires.refreshBeforeExpiry
- timeout value for the trigger that schedules an
execution of lease duration - refreshBeforeExpiry
.expiryThreshold
- minimum TTL duration to consider a Token as valid.
Tokens with a shorter TTL are considered expired and are not used anymore.
Should be greater than 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–2022 Pivotal Software, Inc.. All rights reserved.