com.snowflake.client.jdbc

## Class RestRequest

- java.lang.Object
- - com.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.HttpResponse` `execute(org.apache.http.client.HttpClient httpClient, org.apache.http.client.methods.HttpRequestBase httpRequest, long retryTimeout, int injectSocketTimeout, AtomicBoolean canceling)` 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.HttpResponse execute(org.apache.http.client.HttpClient httpClient,
                                                       org.apache.http.client.methods.HttpRequestBase httpRequest,
                                                       long retryTimeout,
                                                       int injectSocketTimeout,
                                                       AtomicBoolean canceling)
                                                throws IOException,
                                                       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)
  `injectSocketTimeout` - : simulate socket timeout
  `canceling` - canceling flag
Returns:
  HttpResponse Object get from server
Throws:
  `IOException` - jave io exception
  `SnowflakeSQLException` - Request timeout Exception or Illegal State Exception i.e. connection is already shutdown etc