Package net.lenni0451.commons.httpclient
Class RetryHandler
- java.lang.Object
-
- net.lenni0451.commons.httpclient.RetryHandler
-
public class RetryHandler extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RetryHandler()RetryHandler(int maxConnectRetries, int maxHeaderRetries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxConnectRetries()Get the maximum amount of connect retries.
A connect attempt is counted when the connection times out.intgetMaxHeaderRetries()Get the maximum amount of header retries.
A header retry is counted when theHeaders.RETRY_AFTERheader is present.RetryHandlersetMaxConnectRetries(int maxConnectRetries)Set the maximum amount of connect retries.RetryHandlersetMaxHeaderRetries(int maxHeaderRetries)Set the maximum amount of header retries.
-
-
-
Method Detail
-
getMaxConnectRetries
public int getMaxConnectRetries()
Get the maximum amount of connect retries.
A connect attempt is counted when the connection times out.- Returns:
- The maximum amount of connect retries
-
setMaxConnectRetries
public RetryHandler setMaxConnectRetries(int maxConnectRetries)
Set the maximum amount of connect retries.- Parameters:
maxConnectRetries- The maximum amount of connect retries- Returns:
- This instance for chaining
-
getMaxHeaderRetries
public int getMaxHeaderRetries()
Get the maximum amount of header retries.
A header retry is counted when theHeaders.RETRY_AFTERheader is present.- Returns:
- The maximum amount of header retries
-
setMaxHeaderRetries
public RetryHandler setMaxHeaderRetries(int maxHeaderRetries)
Set the maximum amount of header retries.- Parameters:
maxHeaderRetries- The maximum amount of header retries- Returns:
- This instance for chaining
-
-