net.snowflake.client.jdbc

## Class RestRequest

- java.lang.Object
- - net.snowflake.client.jdbc.RestRequest

    public class RestRequest
    extends Object

This is an abstraction on top of http client.

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.

Author:
  jhuang

### Constructor Summary

Constructors
Constructor and Description
`RestRequest()`

### Method Summary

All Methods Static Methods Concrete Methods

`static org.apache.http.client.methods.CloseableHttpResponse`

`execute(org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.client.methods.HttpRequestBase httpRequest, long retryTimeout, long authTimeout, int socketTimeout, int retryCount, int injectSocketTimeout, AtomicBoolean canceling, boolean withoutCookies, boolean includeRetryParameters, boolean includeRequestGuid, boolean retryHTTP403)`
Execute an http request with retry logic.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RestRequest

    public RestRequest()

### Method Detail

#### execute

    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,
                                                                               long authTimeout,
                                                                               int socketTimeout,
                                                                               int retryCount,
                                                                               int injectSocketTimeout,
                                                                               AtomicBoolean canceling,
                                                                               boolean withoutCookies,
                                                                               boolean includeRetryParameters,
                                                                               boolean includeRequestGuid,
                                                                               boolean retryHTTP403)
                                                                        throws SnowflakeSQLException

Execute an http request with retry logic.

Parameters:
  `httpClient` - client object used to communicate with other machine
  `httpRequest` - request object contains all the request information
  `retryTimeout` - : retry timeout (in seconds)
  `authTimeout` - : authenticator specific timeout (in seconds)
  `socketTimeout` - : curl timeout (in ms)
  `retryCount` - : retry count for the request
  `injectSocketTimeout` - : simulate socket timeout
  `canceling` - canceling flag
  `withoutCookies` - whether the cookie spec should be set to IGNORE or not
  `includeRetryParameters` - whether to include retry parameters in retried requests
  `includeRequestGuid` - whether to include request_guid parameter
  `retryHTTP403` - whether to retry on HTTP 403 or not
Returns:
  HttpResponse Object get from server
Throws:
  `SnowflakeSQLException` - Request timeout Exception or Illegal State Exception i.e. connection is already shutdown etc