Class HttpSolrClientBuilderBase<B extends HttpSolrClientBuilderBase<?,?>,C extends HttpSolrClientBase>
java.lang.Object
org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<B,C>
- Direct Known Subclasses:
HttpJdkSolrClient.Builder
public abstract class HttpSolrClientBuilderBase<B extends HttpSolrClientBuilderBase<?,?>,C extends HttpSolrClientBase>
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Longprotected Stringprotected final booleanprotected ExecutorServiceprotected Booleanprotected Longprotected Integerprotected Stringprotected booleanprotected booleanprotected intprotected Longprotected RequestWriterprotected ResponseParserprotected Boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Cbuild()longlongintlongbooleanbooleanbooleanReturn whether the HttpSolrClient built will prefer http1.1 over http2.useHttp1_1(boolean useHttp1_1) If true, prefer http1.1 over http2.withBaseSolrUrl(String baseSolrUrl) Provides the Base Solr Url.withBasicAuthCredentials(String user, String pass) withConnectionTimeout(long connectionTimeout, TimeUnit unit) The max time a connection can take to connect to destinations.withDefaultCollection(String defaultCoreOrCollection) Sets a default for core or collection based requests.withExecutor(ExecutorService executor) withFollowRedirects(boolean followRedirects) withHttpClient(C httpSolrClient) Provide a seed HttpSolrClient for the builder values, values can still be overridden by using builder methodswithIdleTimeout(long idleConnectionTimeout, TimeUnit unit) The max time a connection can be idle (that is, without traffic of bytes in either direction).withMaxConnectionsPerHost(int max) Set maxConnectionsPerHost for http1 connections, maximum number http2 connections is limited to 4withOptionalBasicAuthCredentials(String credentials) Setup basic authentication from a string formatted as username:password.withProxyConfiguration(String host, int port, boolean isSocks4, boolean isSecure) Setup a proxywithRequestTimeout(long requestTimeout, TimeUnit unit) Set a timeout for requests to receive a response.withRequestWriter(RequestWriter requestWriter) Provides aRequestWriterfor created clients to use when handing requests.withResponseParser(ResponseParser responseParser) Provides aResponseParserfor created clients to use when handling requests.withTheseParamNamesInTheUrl(Set<String> urlParamNames) Expert Method
-
Field Details
-
idleTimeoutMillis
-
connectionTimeoutMillis
-
requestTimeoutMillis
-
basicAuthAuthorizationStr
-
followRedirects
-
baseSolrUrl
-
requestWriter
-
responseParser
-
defaultCollection
-
urlParamNames
-
maxConnectionsPerHost
-
executor
-
defaultUseHttp1_1
protected final boolean defaultUseHttp1_1 -
useHttp1_1
-
proxyHost
-
proxyPort
protected int proxyPort -
proxyIsSocks4
protected boolean proxyIsSocks4 -
proxyIsSecure
protected boolean proxyIsSecure
-
-
Constructor Details
-
HttpSolrClientBuilderBase
public HttpSolrClientBuilderBase()
-
-
Method Details
-
build
-
withHttpClient
Provide a seed HttpSolrClient for the builder values, values can still be overridden by using builder methods -
withBaseSolrUrl
Provides the Base Solr Url. -
withRequestWriter
Provides aRequestWriterfor created clients to use when handing requests. -
withResponseParser
Provides aResponseParserfor created clients to use when handling requests. -
withDefaultCollection
Sets a default for core or collection based requests. -
withFollowRedirects
-
withExecutor
-
withBasicAuthCredentials
-
withTheseParamNamesInTheUrl
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:
-
withMaxConnectionsPerHost
Set maxConnectionsPerHost for http1 connections, maximum number http2 connections is limited to 4 -
withIdleTimeout
The max time a connection can be idle (that is, without traffic of bytes in either direction). Sometimes called a "socket timeout". Note: not applicable to the JDK HttpClient. -
getIdleTimeoutMillis
public long getIdleTimeoutMillis() -
withConnectionTimeout
The max time a connection can take to connect to destinations. -
getConnectionTimeoutMillis
public long getConnectionTimeoutMillis() -
withRequestTimeout
Set a timeout for requests to receive a response. -
getRequestTimeoutMillis
public long getRequestTimeoutMillis() -
useHttp1_1
If true, prefer http1.1 over http2. If not set, the default is determined by system property 'solr.http1'. Otherwise, false.- Parameters:
useHttp1_1- prefer http1.1?- Returns:
- this Builder
-
shouldUseHttp1_1
public boolean shouldUseHttp1_1()Return whether the HttpSolrClient built will prefer http1.1 over http2.- Returns:
- whether to prefer http1.1
-
withProxyConfiguration
Setup a proxy- Parameters:
host- The proxy hostport- The proxy portisSocks4- If true creates an SOCKS 4 proxy, otherwise creates an HTTP proxyisSecure- If true enables the secure flag on the proxy- Returns:
- this Builder
-
withOptionalBasicAuthCredentials
Setup basic authentication from a string formatted as username:password. If the string is Null then it doesn't do anything.- Parameters:
credentials- The username and password formatted as username:password- Returns:
- this Builder
-
getMaxConnectionsPerHost
-
getFollowRedirects
-
getProxyHost
-
getProxyPort
public int getProxyPort() -
isProxyIsSocks4
public boolean isProxyIsSocks4() -
isProxyIsSecure
public boolean isProxyIsSecure() -
getExecutor
-