Class RetryHandlerOption
java.lang.Object
com.microsoft.kiota.http.middleware.options.RetryHandlerOption
- All Implemented Interfaces:
com.microsoft.kiota.RequestOption
The options to be passed to the retry middleware.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault retry delaystatic final intDefault maximum number of retriesstatic final IShouldRetryDefault retry evaluation, always retry.static final longAbsolute maximum retry delaystatic final intAbsolute maximum number of retries -
Constructor Summary
ConstructorsConstructorDescriptionCreate default instance of retry options, with default values of delay, max retries and shouldRetry callback.RetryHandlerOption(IShouldRetry shouldRetry, int maxRetries, long delay) Create an instance with provided values -
Method Summary
-
Field Details
-
DEFAULT_SHOULD_RETRY
Default retry evaluation, always retry. -
MAX_RETRIES
public static final int MAX_RETRIESAbsolute maximum number of retries- See Also:
-
DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_RETRIESDefault maximum number of retries- See Also:
-
DEFAULT_DELAY
public static final long DEFAULT_DELAYDefault retry delay- See Also:
-
MAX_DELAY
public static final long MAX_DELAYAbsolute 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
Create an instance with provided values- Parameters:
shouldRetry- Retry callback to be called before making a retrymaxRetries- Number of max retires for a requestdelay- Delay in seconds between retries
-
-
Method Details
-
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
- Specified by:
getTypein interfacecom.microsoft.kiota.RequestOption
-