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 anRateLimitedExceptionis 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 voidapply(okhttp3.Request.Builder builder)Update the supplied builder with the configuration required.intgetAttempts()intgetMaxAttempts()intincrementAndGetAttempts() 
 - 
 
- 
- 
Method Detail
- 
apply
public void apply(okhttp3.Request.Builder builder)
Description copied from interface:RequestConfigurationUpdate 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:
 applyin interfaceRequestConfiguration- Parameters:
 builder- the request builder, someRequestConfigurations may already have been applied to the builder
 
- 
getAttempts
public int getAttempts()
 
- 
getMaxAttempts
public int getMaxAttempts()
 
- 
incrementAndGetAttempts
public int incrementAndGetAttempts()
 
 - 
 
 -