public class HttpClientUtil extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
HttpClientUtil.GzipDecompressingEntity |
static class |
HttpClientUtil.SocketFactoryRegistryProvider |
Constructor and Description |
---|
HttpClientUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor) |
static void |
clearRequestInterceptors() |
static void |
close(org.apache.http.client.HttpClient httpClient) |
static org.apache.http.impl.client.CloseableHttpClient |
createClient(SolrParams params)
Creates new http client by using the provided configuration.
|
static org.apache.http.impl.client.CloseableHttpClient |
createClient(SolrParams params,
org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm) |
static org.apache.http.impl.client.CloseableHttpClient |
createClient(SolrParams params,
org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm,
boolean sharedConnectionManager)
Creates new http client by using the provided configuration.
|
static org.apache.http.impl.client.CloseableHttpClient |
createClient(SolrParams params,
org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm,
boolean sharedConnectionManager,
org.apache.http.protocol.HttpRequestExecutor httpRequestExecutor) |
static org.apache.http.client.config.RequestConfig.Builder |
createDefaultRequestConfigBuilder() |
static org.apache.http.client.protocol.HttpClientContext |
createNewHttpClientRequestContext()
Create a HttpClientContext object and
HttpClientContext.setUserToken(Object)
to an internal singleton. |
static SolrHttpClientBuilder |
getHttpClientBuilder() |
static HttpClientUtil.SocketFactoryRegistryProvider |
getSocketFactoryRegistryProvider() |
static void |
removeRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor) |
static void |
resetHttpClientBuilder() |
static void |
setCookiePolicy(String policyName) |
static void |
setHttpClientBuilder(SolrHttpClientBuilder newHttpClientBuilder) |
static void |
setHttpClientProvider(SolrHttpClientBuilder newHttpClientBuilder) |
static void |
setHttpClientRequestContextBuilder(SolrHttpClientContextBuilder httpClientContextBuilder) |
static void |
setSocketFactoryRegistryProvider(HttpClientUtil.SocketFactoryRegistryProvider newRegistryProvider) |
public static final int DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_SO_TIMEOUT
public static final int DEFAULT_MAXCONNECTIONSPERHOST
public static final int DEFAULT_MAXCONNECTIONS
public static final String PROP_MAX_CONNECTIONS_PER_HOST
public static final String PROP_MAX_CONNECTIONS
public static final String PROP_USE_RETRY
public static final String PROP_ALLOW_COMPRESSION
public static final String PROP_BASIC_AUTH_USER
public static final String PROP_BASIC_AUTH_PASS
public static final String SYS_PROP_CHECK_PEER_NAME
HttpClientUtil.SocketFactoryRegistryProvider
will require hostname validation of SSL Certificates. The default behavior is to enforce
peer name validation.
This property will have no effect if setSocketFactoryRegistryProvider(org.apache.solr.client.solrj.impl.HttpClientUtil.SocketFactoryRegistryProvider)
is used to override
the default HttpClientUtil.SocketFactoryRegistryProvider
public static final String PROP_FOLLOW_REDIRECTS
public static final String PROP_SO_TIMEOUT
public static final String PROP_CONNECTION_TIMEOUT
public static final String SYS_PROP_HTTP_CLIENT_BUILDER_FACTORY
public static final String SYS_PROP_SOCKET_FACTORY_REGISTRY_PROVIDER
public static void setHttpClientBuilder(SolrHttpClientBuilder newHttpClientBuilder)
public static void setHttpClientProvider(SolrHttpClientBuilder newHttpClientBuilder)
public static void setSocketFactoryRegistryProvider(HttpClientUtil.SocketFactoryRegistryProvider newRegistryProvider)
SYS_PROP_CHECK_PEER_NAME
public static SolrHttpClientBuilder getHttpClientBuilder()
public static HttpClientUtil.SocketFactoryRegistryProvider getSocketFactoryRegistryProvider()
SYS_PROP_CHECK_PEER_NAME
public static void resetHttpClientBuilder()
public static org.apache.http.impl.client.CloseableHttpClient createClient(SolrParams params)
params
- http client configuration, if null a client with default
configuration (no additional configuration) is created.public static org.apache.http.impl.client.CloseableHttpClient createClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm)
public static org.apache.http.impl.client.CloseableHttpClient createClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm, boolean sharedConnectionManager, org.apache.http.protocol.HttpRequestExecutor httpRequestExecutor)
public static org.apache.http.impl.client.CloseableHttpClient createClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm, boolean sharedConnectionManager)
public static void close(org.apache.http.client.HttpClient httpClient)
public static void addRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor)
public static void removeRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor)
public static void clearRequestInterceptors()
public static void setHttpClientRequestContextBuilder(SolrHttpClientContextBuilder httpClientContextBuilder)
public static org.apache.http.client.protocol.HttpClientContext createNewHttpClientRequestContext()
HttpClientContext.setUserToken(Object)
to an internal singleton. It allows to reuse underneath HttpClient
in connection pools if client authentication is enabled.public static org.apache.http.client.config.RequestConfig.Builder createDefaultRequestConfigBuilder()
public static void setCookiePolicy(String policyName)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.