Class ExponentialBackoffRetryHandler
- java.lang.Object
-
- io.jenkins.plugins.google.analyze.code.security.accessor.ExponentialBackoffRetryHandler
-
- All Implemented Interfaces:
org.apache.http.client.HttpRequestRetryHandler
public class ExponentialBackoffRetryHandler extends Object implements org.apache.http.client.HttpRequestRetryHandler
ExponentialBackoffRetryHandler provides implementation for Backoff Retry Strategy.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExponentialBackoffRetryHandler
getDefault(int maxRetryCount)
Provides implementation ofExponentialBackoffRetryHandler
with configurable maxRetryCount.boolean
retryRequest(IOException exception, int executionCount, org.apache.http.protocol.HttpContext context)
boolean
retryRequestWithDelay(int executionCount)
Evaluates whether the request should be retried based on executionCount and adds a delay for scenarios where request should be retried.
-
-
-
Method Detail
-
retryRequest
public boolean retryRequest(IOException exception, int executionCount, org.apache.http.protocol.HttpContext context)
- Specified by:
retryRequest
in interfaceorg.apache.http.client.HttpRequestRetryHandler
-
retryRequestWithDelay
public boolean retryRequestWithDelay(int executionCount)
Evaluates whether the request should be retried based on executionCount and adds a delay for scenarios where request should be retried.- Parameters:
executionCount
- current attempt count
-
getDefault
public static ExponentialBackoffRetryHandler getDefault(int maxRetryCount)
Provides implementation ofExponentialBackoffRetryHandler
with configurable maxRetryCount.- Parameters:
maxRetryCount
- max number of retries.- Returns:
- instance of
ExponentialBackoffRetryHandler
-
-