Class RetryHandlerOption

java.lang.Object
com.microsoft.kiota.http.middleware.options.RetryHandlerOption
All Implemented Interfaces:
com.microsoft.kiota.RequestOption

public class RetryHandlerOption extends Object implements com.microsoft.kiota.RequestOption
The options to be passed to the retry middleware.
  • Field Details

    • DEFAULT_SHOULD_RETRY

      @Nonnull public static final IShouldRetry DEFAULT_SHOULD_RETRY
      Default retry evaluation, always retry.
    • MAX_RETRIES

      public static final int MAX_RETRIES
      Absolute maximum number of retries
      See Also:
    • DEFAULT_MAX_RETRIES

      public static final int DEFAULT_MAX_RETRIES
      Default maximum number of retries
      See Also:
    • DEFAULT_DELAY

      public static final long DEFAULT_DELAY
      Default retry delay
      See Also:
    • MAX_DELAY

      public static final long MAX_DELAY
      Absolute maximum retry delay
      See Also:
  • Constructor Details

    • RetryHandlerOption

      public RetryHandlerOption()
      Create default instance of retry options, with default values of delay, max retries and shouldRetry callback.
    • RetryHandlerOption

      public RetryHandlerOption(@Nullable IShouldRetry shouldRetry, int maxRetries, long delay)
      Create an instance with provided values
      Parameters:
      shouldRetry - Retry callback to be called before making a retry
      maxRetries - Number of max retires for a request
      delay - Delay in seconds between retries
  • Method Details

    • shouldRetry

      @Nonnull public IShouldRetry shouldRetry()
      Gets the callback evaluating whether a retry should be made.
      Returns:
      should retry callback
    • maxRetries

      public int maxRetries()
      Gets the maximum number of retries.
      Returns:
      Number of max retries
    • delay

      public long delay()
      Gets the delay in milliseconds between retries.
      Returns:
      Delay in milliseconds between retries
    • getType

      @Nonnull public <T extends com.microsoft.kiota.RequestOption> Class<T> getType()
      Specified by:
      getType in interface com.microsoft.kiota.RequestOption