Class RetryConfig.BuilderBase.RetryConfigImpl

java.lang.Object
io.helidon.faulttolerance.RetryConfig.BuilderBase.RetryConfigImpl
All Implemented Interfaces:
Prototype.Api, Prototype.Factory<Retry>, RetryConfig, Supplier<Retry>
Enclosing class:
RetryConfig.BuilderBase<BUILDER extends RetryConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends RetryConfig>

protected static class RetryConfig.BuilderBase.RetryConfigImpl extends Object implements RetryConfig, Supplier<Retry>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
  • Field Details

    • DEFAULT_CALLS

      static final int DEFAULT_CALLS
      Default calls to make.
      See Also:
    • DEFAULT_DELAY

      static final Duration DEFAULT_DELAY
      Default delay between retries.
      See Also:
    • DEFAULT_OVERALL_TIMEOUT

      static final Duration DEFAULT_OVERALL_TIMEOUT
      Default overall timeout.
      See Also:
  • Constructor Details

    • RetryConfigImpl

      protected RetryConfigImpl(RetryConfig.BuilderBase<?,?> builder)
      Create an instance providing a builder.
      Parameters:
      builder - extending builder base of this prototype
  • Method Details

    • build

      public Retry build()
      Create a new runtime instance from this prototype.
      Specified by:
      build in interface Prototype.Factory<Retry>
      Returns:
      new configured runtime instance
    • get

      public Retry get()
      Specified by:
      get in interface Supplier<Retry>
    • name

      public Optional<String> name()
      Description copied from interface: RetryConfig
      Name for debugging, error reporting, monitoring.
      Specified by:
      name in interface RetryConfig
      Returns:
      name of this retry
    • calls

      public int calls()
      Description copied from interface: RetryConfig
      Number of calls, including the initial call and retries, which must be at least 1.
      Specified by:
      calls in interface RetryConfig
      Returns:
      number of desired calls, must be 1 (means no retries) or higher.
    • delay

      public Duration delay()
      Description copied from interface: RetryConfig
      Non-negative base delay between the initial call and retries, which defaults to 200 ms.
      Specified by:
      delay in interface RetryConfig
      Returns:
      delay between retries (combines with retry policy)
    • delayFactor

      public double delayFactor()
      Description copied from interface: RetryConfig
      Delay multiplier that must be -1 or finite and non-negative; -1 selects 2 unless either jitter option is configured, and an explicit multiplier is applied before jitter.
      Specified by:
      delayFactor in interface RetryConfig
      Returns:
      delay factor for delaying retry policy
    • jitter

      public Duration jitter()
      Description copied from interface: RetryConfig
      Absolute random jitter that must be PT-1S (disabled) or non-negative; it cannot be combined with jitter-factor, is applied independently after delay-factor, does not affect later base-delay calculations, and is capped by max-delay when present.
      Specified by:
      jitter in interface RetryConfig
      Returns:
      jitter
    • jitterFactor

      public double jitterFactor()
      Description copied from interface: RetryConfig
      Relative random jitter that must be -1 (disabled) or from 0 (inclusive) to 1 (exclusive); it cannot be combined with jitter, is applied independently after delay-factor, does not affect later base-delay calculations, and is capped by max-delay when present. A value of 0.2 applies a random jitter of up to twenty percent in either direction.
      Specified by:
      jitterFactor in interface RetryConfig
      Returns:
      relative jitter factor
    • maxDelay

      public Optional<Duration> maxDelay()
      Description copied from interface: RetryConfig
      Optional non-negative maximum delay applied after jitter; when absent, the delay is not capped.
      Specified by:
      maxDelay in interface RetryConfig
      Returns:
      maximum delay, if configured
    • overallTimeout

      public Duration overallTimeout()
      Description copied from interface: RetryConfig
      Positive overall timeout used to bound the complete retry sequence.
      Specified by:
      overallTimeout in interface RetryConfig
      Returns:
      overall timeout
    • skipOn

      public Set<Class<? extends Throwable>> skipOn()
      Description copied from interface: RetryConfig
      These throwables will not be considered retriable, all other will.
      Specified by:
      skipOn in interface RetryConfig
      Returns:
      throwable classes to skip retries
      See Also:
    • applyOn

      public Set<Class<? extends Throwable>> applyOn()
      Description copied from interface: RetryConfig
      These throwables will be considered retriable.
      Specified by:
      applyOn in interface RetryConfig
      Returns:
      throwable classes to trigger retries
      See Also:
    • retryPolicy

      public Optional<Retry.RetryPolicy> retryPolicy()
      Description copied from interface: RetryConfig
      Explicitly configured retry policy. The most recently configured policy-related option takes precedence. Configuring calls, delay, delay factor, jitter, jitter factor, or maximum delay after this option clears it so a new policy is derived from those settings.
      Specified by:
      retryPolicy in interface RetryConfig
      Returns:
      retry policy
    • enableMetrics

      public boolean enableMetrics()
      Description copied from interface: RetryConfig
      Flag to enable metrics for this instance. The value of this flag is combined with the global config entry FaultTolerance.FT_METRICS_DEFAULT_ENABLED. If either of these flags is true, then metrics will be enabled for the instance.
      Specified by:
      enableMetrics in interface RetryConfig
      Returns:
      metrics enabled flag
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object