public class RestRequest extends Object
Currently it only has one method for retrying http request execution so that the same logic doesn't have to be replicated at difference places where retry is needed.
Constructor and Description |
---|
RestRequest() |
Modifier and Type | Method and Description |
---|---|
static org.apache.http.client.methods.CloseableHttpResponse |
execute(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.apache.http.client.methods.HttpRequestBase httpRequest,
long retryTimeout,
int injectSocketTimeout,
AtomicBoolean canceling,
boolean withoutCookies,
boolean includeRetryParameters,
boolean includeRequestGuid,
boolean retryHTTP403)
Execute an http request with retry logic.
|
public static org.apache.http.client.methods.CloseableHttpResponse execute(org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.client.methods.HttpRequestBase httpRequest, long retryTimeout, int injectSocketTimeout, AtomicBoolean canceling, boolean withoutCookies, boolean includeRetryParameters, boolean includeRequestGuid, boolean retryHTTP403) throws SnowflakeSQLException
httpClient
- client object used to communicate with other machinehttpRequest
- request object contains all the request informationretryTimeout
- : retry timeout (in seconds)injectSocketTimeout
- : simulate socket timeoutcanceling
- canceling flagwithoutCookies
- whether the cookie spec should be set to IGNORE
or notincludeRetryParameters
- whether to include retry parameters in retried
requestsincludeRequestGuid
- whether to include request_guid parameterretryHTTP403
- whether to retry on HTTP 403 or notSnowflakeSQLException
- Request timeout Exception or Illegal State Exception i.e.
connection is already shutdown etcCopyright © 2020. All rights reserved.