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

## Class Http2SolrClient.Builder

- java.lang.Object
- - org.apache.solr.client.solrj.impl.Http2SolrClient.Builder

Enclosing class:
  Http2SolrClient

    public static class Http2SolrClient.Builder
    extends Object

### Field Summary

Fields
`protected String` `baseSolrUrl`
`protected RequestWriter` `requestWriter`
`protected ResponseParser` `responseParser`

### Constructor Summary

Constructors
`Builder()`
`Builder​(String baseSolrUrl)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`Http2SolrClient` `build()`
`Http2SolrClient.Builder` `connectionTimeout​(int connectionTimeout)` Deprecated. Please use `withConnectionTimeout(long, TimeUnit)`
`Long` `getConnectionTimeout()`
`Long` `getIdleTimeoutMillis()`
`Http2SolrClient.Builder` `idleTimeout​(int idleConnectionTimeout)` Deprecated. Please use `withIdleTimeout(long, TimeUnit)`
`Http2SolrClient.Builder` `maxConnectionsPerHost​(int max)` Deprecated. Please use `withMaxConnectionsPerHost(int)`
`Http2SolrClient.Builder` `requestTimeout​(int requestTimeout)` Deprecated. Please use `withRequestTimeout(long, TimeUnit)`
`Http2SolrClient.Builder` `useHttp1_1​(boolean useHttp1_1)`
`Http2SolrClient.Builder` `withBasicAuthCredentials​(String user, String pass)`
`Http2SolrClient.Builder` `withConnectionTimeout​(long connectionTimeout, TimeUnit unit)`
`Http2SolrClient.Builder` `withCookieStore​(CookieStore cookieStore)` Set a cookieStore other than the default (`java.net.InMemoryCookieStore`)
`Http2SolrClient.Builder` `withExecutor​(ExecutorService executor)`
`Http2SolrClient.Builder` `withFollowRedirects​(boolean followRedirects)`
`Http2SolrClient.Builder` `withHttpClient​(Http2SolrClient http2SolrClient)` Provide a seed Http2SolrClient for the builder values, values can still be overridden by using builder methods
`Http2SolrClient.Builder` `withIdleTimeout​(long idleConnectionTimeout, TimeUnit unit)`
`Http2SolrClient.Builder` `withMaxConnectionsPerHost​(int max)` Set maxConnectionsPerHost for http1 connections, maximum number http2 connections is limited to 4
`Http2SolrClient.Builder` `withProxyConfiguration​(String host, int port, boolean isSocks4, boolean isSecure)` Setup a proxy
`Http2SolrClient.Builder` `withRequestTimeout​(long requestTimeout, TimeUnit unit)` Set a timeout in milliseconds for requests issued by this client.
`Http2SolrClient.Builder` `withRequestWriter​(RequestWriter requestWriter)` Provides a `RequestWriter` for created clients to use when handing requests.
`Http2SolrClient.Builder` `withResponseParser​(ResponseParser responseParser)` Provides a `ResponseParser` for created clients to use when handling requests.
`Http2SolrClient.Builder` `withSSLConfig​(SSLConfig sslConfig)`
`Http2SolrClient.Builder` `withTheseParamNamesInTheUrl​(Set<String> urlParamNames)` Expert Method

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

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

### Field Detail

#### baseSolrUrl

    protected String baseSolrUrl

#### requestWriter

    protected RequestWriter requestWriter

#### responseParser

    protected ResponseParser responseParser

### Constructor Detail

#### Builder

    public Builder()

#### Builder

    public Builder​(String baseSolrUrl)

### Method Detail

#### build

    public Http2SolrClient build()

#### withHttpClient

    public Http2SolrClient.Builder withHttpClient​(Http2SolrClient http2SolrClient)

Provide a seed Http2SolrClient for the builder values, values can still be overridden by using builder methods

#### withRequestWriter

    public Http2SolrClient.Builder withRequestWriter​(RequestWriter requestWriter)

Provides a `RequestWriter` for created clients to use when handing requests.

#### withResponseParser

    public Http2SolrClient.Builder withResponseParser​(ResponseParser responseParser)

Provides a `ResponseParser` for created clients to use when handling requests.

#### withFollowRedirects

    public Http2SolrClient.Builder withFollowRedirects​(boolean followRedirects)

#### withExecutor

    public Http2SolrClient.Builder withExecutor​(ExecutorService executor)

#### withSSLConfig

    public Http2SolrClient.Builder withSSLConfig​(SSLConfig sslConfig)

#### withBasicAuthCredentials

    public Http2SolrClient.Builder withBasicAuthCredentials​(String user,
                                                            String pass)

#### withTheseParamNamesInTheUrl

    public Http2SolrClient.Builder withTheseParamNamesInTheUrl​(Set<String> urlParamNames)

Expert Method

Parameters:
  `urlParamNames` - set of param keys that are only sent via the query string. Note that the param will be sent as a query string if the key is part of this Set or the SolrRequest's query params.
See Also:
  `SolrRequest.getQueryParams()`

#### maxConnectionsPerHost

    @Deprecated(since="9.2")
    public Http2SolrClient.Builder maxConnectionsPerHost​(int max)

Deprecated.
Please use `withMaxConnectionsPerHost(int)`
Set maxConnectionsPerHost for http1 connections, maximum number http2 connections is limited to 4

#### withMaxConnectionsPerHost

    public Http2SolrClient.Builder withMaxConnectionsPerHost​(int max)

Set maxConnectionsPerHost for http1 connections, maximum number http2 connections is limited to 4

#### idleTimeout

    @Deprecated(since="9.2")
    public Http2SolrClient.Builder idleTimeout​(int idleConnectionTimeout)

Deprecated.
Please use `withIdleTimeout(long, TimeUnit)`

#### withIdleTimeout

    public Http2SolrClient.Builder withIdleTimeout​(long idleConnectionTimeout,
                                                   TimeUnit unit)

#### getIdleTimeoutMillis

    public Long getIdleTimeoutMillis()

#### useHttp1_1

    public Http2SolrClient.Builder useHttp1_1​(boolean useHttp1_1)

#### connectionTimeout

    @Deprecated(since="9.2")
    public Http2SolrClient.Builder connectionTimeout​(int connectionTimeout)

Deprecated.
Please use `withConnectionTimeout(long, TimeUnit)`

#### withConnectionTimeout

    public Http2SolrClient.Builder withConnectionTimeout​(long connectionTimeout,
                                                         TimeUnit unit)

#### getConnectionTimeout

    public Long getConnectionTimeout()

#### requestTimeout

    @Deprecated(since="9.2")
    public Http2SolrClient.Builder requestTimeout​(int requestTimeout)

Deprecated.
Please use `withRequestTimeout(long, TimeUnit)`
Set a timeout in milliseconds for requests issued by this client.

Parameters:
  `requestTimeout` - The timeout in milliseconds
Returns:
  this Builder.

#### withRequestTimeout

    public Http2SolrClient.Builder withRequestTimeout​(long requestTimeout,
                                                      TimeUnit unit)

Set a timeout in milliseconds for requests issued by this client.

Parameters:
  `requestTimeout` - The timeout in milliseconds
Returns:
  this Builder.

#### withCookieStore

    public Http2SolrClient.Builder withCookieStore​(CookieStore cookieStore)

Set a cookieStore other than the default (`java.net.InMemoryCookieStore`)

Parameters:
  `cookieStore` - The CookieStore to set. `null` will set the default.
Returns:
  this Builder

#### withProxyConfiguration

    public Http2SolrClient.Builder withProxyConfiguration​(String host,
                                                          int port,
                                                          boolean isSocks4,
                                                          boolean isSecure)

Setup a proxy

Parameters:
  `host` - The proxy host
  `port` - The proxy port
  `isSocks4` - If true creates an SOCKS 4 proxy, otherwise creates an HTTP proxy
  `isSecure` - If true enables the secure flag on the proxy
Returns:
  this Builder