Package net.snowflake.ingest.utils
Class HttpUtil
- java.lang.Object
-
- net.snowflake.ingest.utils.HttpUtil
-
public class HttpUtil extends Object
Created by hyu on 8/10/17.
-
-
Field Summary
Fields Modifier and Type Field Description static String
HTTP_PROXY_PASSWORD
static String
HTTP_PROXY_USER
static String
NON_PROXY_HOSTS
static String
PROXY_HOST
static String
PROXY_PORT
static String
USE_PROXY
-
Constructor Summary
Constructors Constructor Description HttpUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Properties
generateProxyPropertiesForJDBC()
Helper method to decide whether to add any properties related to proxy server.static net.snowflake.client.jdbc.internal.apache.http.impl.client.CloseableHttpClient
getHttpClient(String accountName)
static Boolean
shouldBypassProxy(String accountName)
Changes the account name to the format accountName.snowflakecomputing.com then returns a boolean to indicate if we should go through a proxy or not.static void
shutdownHttpConnectionManagerDaemonThread()
Shuts down the daemon thread.
-
-
-
Field Detail
-
USE_PROXY
public static final String USE_PROXY
- See Also:
- Constant Field Values
-
PROXY_HOST
public static final String PROXY_HOST
- See Also:
- Constant Field Values
-
PROXY_PORT
public static final String PROXY_PORT
- See Also:
- Constant Field Values
-
NON_PROXY_HOSTS
public static final String NON_PROXY_HOSTS
- See Also:
- Constant Field Values
-
HTTP_PROXY_USER
public static final String HTTP_PROXY_USER
- See Also:
- Constant Field Values
-
HTTP_PROXY_PASSWORD
public static final String HTTP_PROXY_PASSWORD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getHttpClient
public static net.snowflake.client.jdbc.internal.apache.http.impl.client.CloseableHttpClient getHttpClient(String accountName)
- Returns:
- Instance of CloseableHttpClient
-
generateProxyPropertiesForJDBC
public static Properties generateProxyPropertiesForJDBC()
Helper method to decide whether to add any properties related to proxy server. These properties are passed on to snowflake JDBC while calling put API.- Returns:
- proxy parameters that could be used by JDBC
-
shutdownHttpConnectionManagerDaemonThread
public static void shutdownHttpConnectionManagerDaemonThread()
Shuts down the daemon thread.
-
-