Package org.apache.solr.client.solrj.impl

## Class HttpClientUtil

- java.lang.Object
- - org.apache.solr.client.solrj.impl.HttpClientUtil

    @Deprecated(since="9.0")
    public class HttpClientUtil
    extends Object

Deprecated.
Used to configure the Apache HTTP client. Please use The Http2 client
Utility class for creating/configuring httpclient instances.

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
`protected static class` `HttpClientUtil.GzipDecompressingEntity` Deprecated.
`static class` `HttpClientUtil.SocketFactoryRegistryProvider` Deprecated.

### Field Summary

Fields
`static int` `DEFAULT_CONNECT_TIMEOUT` Deprecated.
`static int` `DEFAULT_MAXCONNECTIONS` Deprecated.
`static int` `DEFAULT_MAXCONNECTIONSPERHOST` Deprecated.
`static int` `DEFAULT_SO_TIMEOUT` Deprecated.
`static String` `PROP_ALLOW_COMPRESSION` Deprecated.
`static String` `PROP_BASIC_AUTH_PASS` Deprecated.
`static String` `PROP_BASIC_AUTH_USER` Deprecated.
`static String` `PROP_CONNECTION_TIMEOUT` Deprecated.
`static String` `PROP_FOLLOW_REDIRECTS` Deprecated.
`static String` `PROP_MAX_CONNECTIONS` Deprecated.
`static String` `PROP_MAX_CONNECTIONS_PER_HOST` Deprecated.
`static String` `PROP_SO_TIMEOUT` Deprecated.
`static String` `PROP_USE_RETRY` Deprecated.
`static String` `SYS_PROP_CHECK_PEER_NAME` Deprecated. System property consulted to determine if the default `HttpClientUtil.SocketFactoryRegistryProvider` will require hostname validation of SSL Certificates.
`static String` `SYS_PROP_HTTP_CLIENT_BUILDER_FACTORY` Deprecated. A Java system property to select the HttpClientBuilderFactory used for configuring the HttpClientBuilder instance by default.
`static String` `SYS_PROP_SOCKET_FACTORY_REGISTRY_PROVIDER` Deprecated. A Java system property to select the HttpClientUtil.SocketFactoryRegistryProvider used for configuring the Apache HTTP clients.

### Constructor Summary

Constructors
`HttpClientUtil()` Deprecated.

### Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods
`static void` `addRequestInterceptor​(org.apache.http.HttpRequestInterceptor interceptor)` Deprecated.
`static void` `clearRequestInterceptors()` Deprecated.
`static void` `close​(org.apache.http.client.HttpClient httpClient)` Deprecated.
`static org.apache.http.impl.client.CloseableHttpClient` `createClient​(SolrParams params)` Deprecated. 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)` Deprecated.
`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.
`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.
`static org.apache.http.client.config.RequestConfig.Builder` `createDefaultRequestConfigBuilder()` Deprecated.
`static org.apache.http.client.protocol.HttpClientContext` `createNewHttpClientRequestContext()` Deprecated. Create a HttpClientContext object and `HttpClientContext.setUserToken(Object)` to an internal singleton.
`static SolrHttpClientBuilder` `getHttpClientBuilder()` Deprecated.
`static HttpClientUtil.SocketFactoryRegistryProvider` `getSocketFactoryRegistryProvider()` Deprecated.
`static void` `removeRequestInterceptor​(org.apache.http.HttpRequestInterceptor interceptor)` Deprecated.
`static void` `resetHttpClientBuilder()` Deprecated.
`static void` `setCookiePolicy​(String policyName)` Deprecated.
`static void` `setHttpClientBuilder​(SolrHttpClientBuilder newHttpClientBuilder)` Deprecated.
`static void` `setHttpClientProvider​(SolrHttpClientBuilder newHttpClientBuilder)` Deprecated.
`static void` `setHttpClientRequestContextBuilder​(SolrHttpClientContextBuilder httpClientContextBuilder)` Deprecated.
`static void` `setSocketFactoryRegistryProvider​(HttpClientUtil.SocketFactoryRegistryProvider newRegistryProvider)` Deprecated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_CONNECT_TIMEOUT

    public static final int DEFAULT_CONNECT_TIMEOUT

Deprecated.

See Also:
  Constant Field Values

#### DEFAULT_SO_TIMEOUT

    public static final int DEFAULT_SO_TIMEOUT

Deprecated.

See Also:
  Constant Field Values

#### DEFAULT_MAXCONNECTIONSPERHOST

    public static final int DEFAULT_MAXCONNECTIONSPERHOST

Deprecated.

See Also:
  Constant Field Values

#### DEFAULT_MAXCONNECTIONS

    public static final int DEFAULT_MAXCONNECTIONS

Deprecated.

See Also:
  Constant Field Values

#### PROP_MAX_CONNECTIONS_PER_HOST

    public static final String PROP_MAX_CONNECTIONS_PER_HOST

Deprecated.

See Also:
  Constant Field Values

#### PROP_MAX_CONNECTIONS

    public static final String PROP_MAX_CONNECTIONS

Deprecated.

See Also:
  Constant Field Values

#### 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_BASIC_AUTH_USER

    public static final String PROP_BASIC_AUTH_USER

Deprecated.

See Also:
  Constant Field Values

#### PROP_BASIC_AUTH_PASS

    public static final String PROP_BASIC_AUTH_PASS

Deprecated.

See Also:
  Constant Field Values

#### SYS_PROP_CHECK_PEER_NAME

    public static final String SYS_PROP_CHECK_PEER_NAME

Deprecated.
System property consulted to determine if the default `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`

See Also:
  Constant Field Values

#### PROP_FOLLOW_REDIRECTS

    public static final String PROP_FOLLOW_REDIRECTS

Deprecated.

See Also:
  Constant Field Values

#### PROP_SO_TIMEOUT

    public static final String PROP_SO_TIMEOUT

Deprecated.

See Also:
  Constant Field Values

#### PROP_CONNECTION_TIMEOUT

    public static final String PROP_CONNECTION_TIMEOUT

Deprecated.

See Also:
  Constant Field Values

#### SYS_PROP_HTTP_CLIENT_BUILDER_FACTORY

    public static final String SYS_PROP_HTTP_CLIENT_BUILDER_FACTORY

Deprecated.
A Java system property to select the HttpClientBuilderFactory used for configuring the HttpClientBuilder instance by default.

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

### Constructor Detail

#### HttpClientUtil

    public HttpClientUtil()

Deprecated.

### Method Detail

#### 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.

See Also:
  `SYS_PROP_CHECK_PEER_NAME`

#### getHttpClientBuilder

    public static SolrHttpClientBuilder getHttpClientBuilder()

Deprecated.

#### getSocketFactoryRegistryProvider

    public static HttpClientUtil.SocketFactoryRegistryProvider getSocketFactoryRegistryProvider()

Deprecated.

See Also:
  `SYS_PROP_CHECK_PEER_NAME`

#### 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 and `HttpClientContext.setUserToken(Object)` to an internal singleton. It allows to reuse underneath `HttpClient` in 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.