Class LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
java.lang.Object
org.springframework.vault.authentication.LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
- All Implemented Interfaces:
LifecycleAwareSessionManagerSupport.RefreshTrigger
- Enclosing class:
- LifecycleAwareSessionManagerSupport
public static class LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
extends Object
implements LifecycleAwareSessionManagerSupport.RefreshTrigger
LifecycleAwareSessionManagerSupport.RefreshTrigger
implementation using a fixed timeout to schedule renewal
before a LoginToken
expires.- Since:
- 1.0.1
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorDescriptionFixedTimeoutRefreshTrigger
(long refreshBeforeExpiry, TimeUnit timeUnit) Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times oftimeout
before theLoginToken
expiresFixedTimeoutRefreshTrigger
(Duration refreshBeforeExpiry) Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times ofrefreshBeforeExpiry
before theLoginToken
expires.FixedTimeoutRefreshTrigger
(Duration refreshBeforeExpiry, Duration expiryThreshold) Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times oftimeout
before theLoginToken
expires. -
Method Summary
Modifier and TypeMethodDescriptiongetValidTtlThreshold
(LoginToken loginToken) Returns the minimum TTL duration to consider a token valid after renewal.nextExecutionTime
(LoginToken loginToken) Determine the next execution time according to the given trigger context.
-
Constructor Details
-
FixedTimeoutRefreshTrigger
Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times oftimeout
before theLoginToken
expires- Parameters:
refreshBeforeExpiry
- timeout value, non-negative long value that schedules an execution oflease duration - refreshBeforeExpiry
.timeUnit
- must not be null.
-
FixedTimeoutRefreshTrigger
Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times ofrefreshBeforeExpiry
before theLoginToken
expires. Valid TTL threshold is set to two seconds longer to compensate for timing issues during scheduling.- Parameters:
refreshBeforeExpiry
- timeout value for the trigger that schedules an execution oflease duration - refreshBeforeExpiry
.- Since:
- 2.0
-
FixedTimeoutRefreshTrigger
Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
to calculate execution times oftimeout
before theLoginToken
expires.- Parameters:
refreshBeforeExpiry
- timeout value for the trigger that schedules an execution oflease 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 thantimeout
to prevent token expiry.- Since:
- 2.0
-
-
Method Details
-
nextExecutionTime
Description copied from interface:LifecycleAwareSessionManagerSupport.RefreshTrigger
Determine the next execution time according to the given trigger context.- Specified by:
nextExecutionTime
in interfaceLifecycleAwareSessionManagerSupport.RefreshTrigger
- Parameters:
loginToken
- login token encapsulating renewability and lease duration.- Returns:
- the next execution time as defined by the trigger, or
null
if the trigger won't fire anymore
-
getValidTtlThreshold
Description copied from interface:LifecycleAwareSessionManagerSupport.RefreshTrigger
Returns the minimum TTL duration to consider a token valid after renewal. Tokens with a shorter TTL are revoked and considered expired.- Specified by:
getValidTtlThreshold
in interfaceLifecycleAwareSessionManagerSupport.RefreshTrigger
- Parameters:
loginToken
- the login token after renewal.- Returns:
- minimum TTL
Duration
to consider a token valid.
-