public class HttpUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpUtil.HttpInputStream |
| Constructor and Description |
|---|
HttpUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
configureCustomProxyProperties(Map<SFSessionProperty,Object> connectionPropertiesMap)
configure custom proxy properties from connectionPropertiesMap
|
static String |
executeRequest(org.apache.http.client.methods.HttpRequestBase httpRequest,
int retryTimeout,
int injectSocketTimeout,
AtomicBoolean canceling)
Executes a HTTP request for Snowflake.
|
static String |
executeRequest(org.apache.http.client.methods.HttpRequestBase httpRequest,
int retryTimeout,
int injectSocketTimeout,
AtomicBoolean canceling,
boolean includeRetryParameters)
Executes a HTTP request for Snowflake.
|
static org.apache.http.client.config.RequestConfig |
getDefaultRequestConfigWithSocketTimeout(int soTimeoutMs,
boolean withoutCookies)
Return a request configuration inheriting from the default request
configuration of the shared HttpClient with a different socket timeout.
|
static org.apache.http.impl.client.CloseableHttpClient |
getHttpClient()
Gets HttpClient with insecureMode false
|
static org.apache.http.client.config.RequestConfig |
getRequestConfigWithoutcookies()
Return a request configuration inheriting from the default request
configuration of the shared HttpClient with the coopkie spec set to ignore.
|
static org.apache.http.impl.client.CloseableHttpClient |
initHttpClient(boolean insecureMode,
File ocspCacheFile)
Accessor for the HTTP client singleton.
|
static boolean |
isSocksProxyDisabled()
Returns whether the SOCKS proxy is disabled for this JVM
|
static void |
setSocksProxyDisabled(boolean socksProxyDisabled)
Enables/disables use of the SOCKS proxy when creating sockets
|
public static org.apache.http.impl.client.CloseableHttpClient getHttpClient()
public static org.apache.http.impl.client.CloseableHttpClient initHttpClient(boolean insecureMode,
File ocspCacheFile)
insecureMode - skip OCSP revocation check if true.ocspCacheFile - OCSP response cache file name. if null, the default
file will be used.public static org.apache.http.client.config.RequestConfig getDefaultRequestConfigWithSocketTimeout(int soTimeoutMs,
boolean withoutCookies)
soTimeoutMs - - custom socket timeout in milli-secondswithoutCookies - - whether this request should ignore cookies or notpublic static org.apache.http.client.config.RequestConfig getRequestConfigWithoutcookies()
public static void setSocksProxyDisabled(boolean socksProxyDisabled)
socksProxyDisabled - new valuepublic static boolean isSocksProxyDisabled()
public static String executeRequest(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int injectSocketTimeout, AtomicBoolean canceling) throws SnowflakeSQLException, IOException
httpRequest - HttpRequestBaseretryTimeout - retry timeoutinjectSocketTimeout - injecting socket timeoutcanceling - canceling?SnowflakeSQLException - if Snowflake error occursIOException - raises if a general IO error occurspublic static String executeRequest(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int injectSocketTimeout, AtomicBoolean canceling, boolean includeRetryParameters) throws SnowflakeSQLException, IOException
httpRequest - HttpRequestBaseretryTimeout - retry timeoutinjectSocketTimeout - injecting socket timeoutcanceling - canceling?includeRetryParameters - whether to include retry parameters in
retried requestsSnowflakeSQLException - if Snowflake error occursIOException - raises if a general IO error occurspublic static void configureCustomProxyProperties(Map<SFSessionProperty,Object> connectionPropertiesMap)
Copyright © 2019. All rights reserved.