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
ConstructorsConstructorDescriptionFixedTimeoutRefreshTrigger(long refreshBeforeExpiry, TimeUnit timeUnit) Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTriggerto calculate execution times oftimeoutbefore theLoginTokenexpiresFixedTimeoutRefreshTrigger(Duration refreshBeforeExpiry) Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTriggerto calculate execution times ofrefreshBeforeExpirybefore theLoginTokenexpires.FixedTimeoutRefreshTrigger(Duration refreshBeforeExpiry, Duration expiryThreshold) Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTriggerto calculate execution times oftimeoutbefore theLoginTokenexpires. -
Method Summary
Modifier and TypeMethodDescriptiongetValidTtlThreshold(LoginToken loginToken) Returns the minimum TTL duration to consider a token valid after renewal.nextExecution(LoginToken loginToken) Determine the next execution time according to the given trigger context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.vault.authentication.LifecycleAwareSessionManagerSupport.RefreshTrigger
nextExecutionTime
-
Constructor Details
-
FixedTimeoutRefreshTrigger
Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTriggerto calculate execution times oftimeoutbefore theLoginTokenexpires- Parameters:
refreshBeforeExpiry- timeout value, non-negative long value that schedules an execution oflease duration - refreshBeforeExpiry.timeUnit- must not be null.
-
FixedTimeoutRefreshTrigger
Create a newLifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTriggerto calculate execution times ofrefreshBeforeExpirybefore theLoginTokenexpires. 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.FixedTimeoutRefreshTriggerto calculate execution times oftimeoutbefore theLoginTokenexpires.- 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 thantimeoutto prevent token expiry.- Since:
- 2.0
-
-
Method Details
-
nextExecution
Description copied from interface:LifecycleAwareSessionManagerSupport.RefreshTriggerDetermine the next execution time according to the given trigger context.- Specified by:
nextExecutionin interfaceLifecycleAwareSessionManagerSupport.RefreshTrigger- Parameters:
loginToken- login token encapsulating renewability and lease duration.- Returns:
- the next execution time as defined by the trigger, or
nullif the trigger won't fire anymore.
-
getValidTtlThreshold
Description copied from interface:LifecycleAwareSessionManagerSupport.RefreshTriggerReturns the minimum TTL duration to consider a token valid after renewal. Tokens with a shorter TTL are revoked and considered expired.- Specified by:
getValidTtlThresholdin interfaceLifecycleAwareSessionManagerSupport.RefreshTrigger- Parameters:
loginToken- the login token after renewal.- Returns:
- minimum TTL
Durationto consider a token valid.
-