Class RetryOnRateLimitConfig
- java.lang.Object
-
- com.atlassian.bitbucket.jenkins.internal.http.RetryOnRateLimitConfig
-
- All Implemented Interfaces:
RequestConfiguration
public class RetryOnRateLimitConfig extends Object implements RequestConfiguration
Configuration for request re-try. The request will be tried up to {code maxAttempts} times with a wait between requests as directed by the remote server (defaults to 5s for Bitbucket Server). A retry will happen if the remote side responds with a HTTP status code of {code 429}. If the request is not successful within the allowed number of attempts anRateLimitedException
is thrown.- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description RetryOnRateLimitConfig(int maxAttempts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(okhttp3.Request.Builder builder)
Update the supplied builder with the configuration required.int
getAttempts()
int
getMaxAttempts()
int
incrementAndGetAttempts()
-
-
-
Method Detail
-
apply
public void apply(okhttp3.Request.Builder builder)
Description copied from interface:RequestConfiguration
Update the supplied builder with the configuration required. The order in which configurations are applied is not defined nor guaranteed to be the same between invocations.- Specified by:
apply
in interfaceRequestConfiguration
- Parameters:
builder
- the request builder, someRequestConfiguration
s may already have been applied to the builder
-
getAttempts
public int getAttempts()
-
getMaxAttempts
public int getMaxAttempts()
-
incrementAndGetAttempts
public int incrementAndGetAttempts()
-
-