Class RenewalOptions

java.lang.Object
codes.grow.packages.vault.RenewalOptions

public final class RenewalOptions extends Object
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).
  • Method Details

    • defaults

      public static RenewalOptions defaults()
      Returns the defaults.
      Returns:
      the default options
    • builder

      public static RenewalOptions.Builder builder()
      Starts a builder.
      Returns:
      a new builder
    • increment

      public Optional<Duration> 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

      public Duration minDelay()
      Returns the minimum delay between two renewals.
      Returns:
      the delay (default 500 ms)
    • scheduler

      public Scheduler 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)