Package codes.grow.packages.vault
Class RenewalOptions
java.lang.Object
codes.grow.packages.vault.RenewalOptions
Options of
TokenRenewer and LeaseManager.manage(codes.grow.packages.vault.Lease<?>, codes.grow.packages.vault.RenewalOptions): renew at renewFraction
of the TTL (default 2/3) until the maximum TTL is reached, then call onExpire once at
expiry (or log in again for a token renewer with a re-login method).-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RenewalOptions.Builderbuilder()Starts a builder.static RenewalOptionsdefaults()Returns the defaults.Returns the TTL requested on each renewal.minDelay()Returns the minimum delay between two renewals.doubleReturns the fraction of the TTL after which a renewal runs.booleanReturns whether a managed lease is revoked when stopped.Returns the scheduler.
-
Method Details
-
defaults
Returns the defaults.- Returns:
- the default options
-
builder
Starts a builder.- Returns:
- a new builder
-
increment
Returns the TTL requested on each renewal.- Returns:
- the increment, or empty to keep the server default
-
renewFraction
public double renewFraction()Returns the fraction of the TTL after which a renewal runs.- Returns:
- a value in (0, 1), default 2/3
-
minDelay
Returns the minimum delay between two renewals.- Returns:
- the delay (default 500 ms)
-
scheduler
Returns the scheduler.- Returns:
- the scheduler
-
revokeOnStop
public boolean revokeOnStop()Returns whether a managed lease is revoked when stopped.- Returns:
- the flag (default false)
-