public class HttpClientFactory
extends Object
Modifier and Type | Class and Description |
---|---|
class |
HttpClientFactory.FlexibleRedirectStrategy
The Class FlexibleRedirectStrategy.
|
Modifier and Type | Field and Description |
---|---|
static String |
SSL_CLIENT_CERT |
static String |
SSL_CLIENT_CERT_PASSWORD |
static String |
SSL_CLIENT_CERT_TYPE |
static String |
SSL_TRUST_SELF_SIGNED |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close all opened http clients.
|
org.apache.http.client.HttpClient |
getHttpClient(String host)
Gets the http client.
|
org.apache.http.client.HttpClient |
getHttpClient(String host,
String proxyHost,
int proxyPort,
String proxyUser,
String proxyPasswd,
String proxyType,
String user,
String password,
String tlsVersion,
Properties connectionProperties)
Gets the http client.
|
org.apache.http.client.HttpClient |
getHttpClient(String host,
String user,
String password,
String tlsVersion,
Properties connectionProperties)
Gets the http client.
|
org.apache.http.impl.client.HttpClientBuilder |
getHttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder builder,
Properties properties)
Gets the http client builder for the HTTP connection which requires a
client side SSL certificate.
|
org.apache.http.conn.ssl.SSLConnectionSocketFactory |
getTrustAllSSLFactory()
Gets the trust all SSL factory.
|
static HttpClientFactory |
instance()
Returns an instance of the HttpClient.
|
public static final String SSL_TRUST_SELF_SIGNED
public static final String SSL_CLIENT_CERT
public static final String SSL_CLIENT_CERT_TYPE
public static final String SSL_CLIENT_CERT_PASSWORD
public static HttpClientFactory instance()
public void close()
public org.apache.http.client.HttpClient getHttpClient(String host) throws Exception
host
- the hostException
public org.apache.http.client.HttpClient getHttpClient(String host, String proxyHost, int proxyPort, String proxyUser, String proxyPasswd, String proxyType, String user, String password, String tlsVersion, Properties connectionProperties) throws Exception
host
- the hostproxyHost
- the proxy hostproxyPort
- the proxy portproxyUser
- the proxy userproxyPasswd
- the proxy passwordproxyType
- the proxy type (http, https, etc)user
- the userpassword
- the passwordtlsVersion
- the tls versionException
public org.apache.http.client.HttpClient getHttpClient(String host, String user, String password, String tlsVersion, Properties connectionProperties) throws Exception
host
- the hostuser
- the userpassword
- the passwordtlsVersion
- the tls versionException
public org.apache.http.impl.client.HttpClientBuilder getHttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder builder, Properties properties) throws Exception
builder
- the builderproperties
- the propertiesException
- the exceptionpublic org.apache.http.conn.ssl.SSLConnectionSocketFactory getTrustAllSSLFactory() throws Exception
Exception
- the exceptionCopyright © 2010-2020 Toolsverse. All Rights Reserved.