Class HttpClientUtil
- java.lang.Object
-
- org.apache.solr.client.solrj.impl.HttpClientUtil
-
- All Implemented Interfaces:
SolrHttpConstants
@Deprecated(since="9.0") public class HttpClientUtil extends Object implements SolrHttpConstants
Deprecated.Used to configure the Apache HTTP client. Please use another clientUtility class for creating/configuring ApacheHttpClientinstances.This class can touch internal HttpClient details and is subject to change.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classHttpClientUtil.GzipDecompressingEntityDeprecated.static classHttpClientUtil.SocketFactoryRegistryProviderDeprecated.
-
Field Summary
Fields Modifier and Type Field Description static StringPROP_ALLOW_COMPRESSIONDeprecated.static StringPROP_FOLLOW_REDIRECTSDeprecated.static StringPROP_USE_RETRYDeprecated.static StringSYS_PROP_SOCKET_FACTORY_REGISTRY_PROVIDERDeprecated.A Java system property to select the HttpClientUtil.SocketFactoryRegistryProvider used for configuring the Apache HTTP clients.-
Fields inherited from interface org.apache.solr.client.solrj.impl.SolrHttpConstants
DEFAULT_CONNECT_TIMEOUT, DEFAULT_MAXCONNECTIONS, DEFAULT_MAXCONNECTIONSPERHOST, DEFAULT_SO_TIMEOUT, PROP_BASIC_AUTH_PASS, PROP_BASIC_AUTH_USER, PROP_CONNECTION_TIMEOUT, PROP_MAX_CONNECTIONS, PROP_MAX_CONNECTIONS_PER_HOST, PROP_SO_TIMEOUT, SYS_PROP_CHECK_PEER_NAME, SYS_PROP_HTTP_CLIENT_BUILDER_FACTORY
-
-
Constructor Summary
Constructors Constructor Description HttpClientUtil()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor)Deprecated.static voidclearRequestInterceptors()Deprecated.static voidclose(org.apache.http.client.HttpClient httpClient)Deprecated.static voidconsumeFully(org.apache.http.HttpEntity entity)Deprecated.If the passed entity has content, make sure it is fully read and closed.static org.apache.http.impl.client.CloseableHttpClientcreateClient(SolrParams params)Deprecated.Creates new http client by using the provided configuration.static org.apache.http.impl.client.CloseableHttpClientcreateClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm)Deprecated.static org.apache.http.impl.client.CloseableHttpClientcreateClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm, boolean sharedConnectionManager)Deprecated.Creates new http client by using the provided configuration.static org.apache.http.impl.client.CloseableHttpClientcreateClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm, boolean sharedConnectionManager, org.apache.http.protocol.HttpRequestExecutor httpRequestExecutor)Deprecated.static org.apache.http.client.config.RequestConfig.BuildercreateDefaultRequestConfigBuilder()Deprecated.static org.apache.http.client.protocol.HttpClientContextcreateNewHttpClientRequestContext()Deprecated.Create a HttpClientContext object andHttpClientContext.setUserToken(Object)to an internal singleton.static <T> TexecuteGET(org.apache.http.client.HttpClient client, String url, Utils.InputStreamConsumer<T> consumer)Deprecated.static <T> TexecuteHttpMethod(org.apache.http.client.HttpClient client, String url, Utils.InputStreamConsumer<T> consumer, org.apache.http.client.methods.HttpRequestBase httpMethod)Deprecated.static SolrHttpClientBuildergetHttpClientBuilder()Deprecated.static HttpClientUtil.SocketFactoryRegistryProvidergetSocketFactoryRegistryProvider()Deprecated.static voidremoveRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor)Deprecated.static voidresetHttpClientBuilder()Deprecated.static voidsetCookiePolicy(String policyName)Deprecated.static voidsetHttpClientBuilder(SolrHttpClientBuilder newHttpClientBuilder)Deprecated.static voidsetHttpClientProvider(SolrHttpClientBuilder newHttpClientBuilder)Deprecated.static voidsetHttpClientRequestContextBuilder(SolrHttpClientContextBuilder httpClientContextBuilder)Deprecated.static voidsetSocketFactoryRegistryProvider(HttpClientUtil.SocketFactoryRegistryProvider newRegistryProvider)Deprecated.
-
-
-
Field Detail
-
PROP_USE_RETRY
public static final String PROP_USE_RETRY
Deprecated.- See Also:
- Constant Field Values
-
PROP_ALLOW_COMPRESSION
public static final String PROP_ALLOW_COMPRESSION
Deprecated.- See Also:
- Constant Field Values
-
PROP_FOLLOW_REDIRECTS
public static final String PROP_FOLLOW_REDIRECTS
Deprecated.- See Also:
- Constant Field Values
-
SYS_PROP_SOCKET_FACTORY_REGISTRY_PROVIDER
public static final String SYS_PROP_SOCKET_FACTORY_REGISTRY_PROVIDER
Deprecated.A Java system property to select the HttpClientUtil.SocketFactoryRegistryProvider used for configuring the Apache HTTP clients.- See Also:
- Constant Field Values
-
-
Method Detail
-
executeGET
public static <T> T executeGET(org.apache.http.client.HttpClient client, String url, Utils.InputStreamConsumer<T> consumer) throws SolrExceptionDeprecated.- Throws:
SolrException
-
executeHttpMethod
public static <T> T executeHttpMethod(org.apache.http.client.HttpClient client, String url, Utils.InputStreamConsumer<T> consumer, org.apache.http.client.methods.HttpRequestBase httpMethod)Deprecated.
-
consumeFully
public static void consumeFully(org.apache.http.HttpEntity entity)
Deprecated.If the passed entity has content, make sure it is fully read and closed.- Parameters:
entity- to consume or null
-
setHttpClientBuilder
public static void setHttpClientBuilder(SolrHttpClientBuilder newHttpClientBuilder)
Deprecated.
-
setHttpClientProvider
public static void setHttpClientProvider(SolrHttpClientBuilder newHttpClientBuilder)
Deprecated.
-
setSocketFactoryRegistryProvider
public static void setSocketFactoryRegistryProvider(HttpClientUtil.SocketFactoryRegistryProvider newRegistryProvider)
Deprecated.
-
getHttpClientBuilder
public static SolrHttpClientBuilder getHttpClientBuilder()
Deprecated.
-
getSocketFactoryRegistryProvider
public static HttpClientUtil.SocketFactoryRegistryProvider getSocketFactoryRegistryProvider()
Deprecated.
-
resetHttpClientBuilder
public static void resetHttpClientBuilder()
Deprecated.
-
createClient
public static org.apache.http.impl.client.CloseableHttpClient createClient(SolrParams params)
Deprecated.Creates new http client by using the provided configuration.- Parameters:
params- http client configuration, if null a client with default configuration (no additional configuration) is created.
-
createClient
public static org.apache.http.impl.client.CloseableHttpClient createClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm)
Deprecated.
-
createClient
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)
Deprecated.
-
createClient
public static org.apache.http.impl.client.CloseableHttpClient createClient(SolrParams params, org.apache.http.impl.conn.PoolingHttpClientConnectionManager cm, boolean sharedConnectionManager)
Deprecated.Creates new http client by using the provided configuration.
-
close
public static void close(org.apache.http.client.HttpClient httpClient)
Deprecated.
-
addRequestInterceptor
public static void addRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor)
Deprecated.
-
removeRequestInterceptor
public static void removeRequestInterceptor(org.apache.http.HttpRequestInterceptor interceptor)
Deprecated.
-
clearRequestInterceptors
public static void clearRequestInterceptors()
Deprecated.
-
setHttpClientRequestContextBuilder
public static void setHttpClientRequestContextBuilder(SolrHttpClientContextBuilder httpClientContextBuilder)
Deprecated.
-
createNewHttpClientRequestContext
public static org.apache.http.client.protocol.HttpClientContext createNewHttpClientRequestContext()
Deprecated.Create a HttpClientContext object andHttpClientContext.setUserToken(Object)to an internal singleton. It allows reusing underlyingHttpClientin connection pools if client authentication is enabled.
-
createDefaultRequestConfigBuilder
public static org.apache.http.client.config.RequestConfig.Builder createDefaultRequestConfigBuilder()
Deprecated.
-
setCookiePolicy
public static void setCookiePolicy(String policyName)
Deprecated.
-
-