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)
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)
throws IOException,
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 notIOException - java io exceptionSnowflakeSQLException - Request timeout Exception or Illegal State Exception i.e.
connection is already shutdown etcCopyright © 2018. All rights reserved.