Class HttpJettySolrClient.Builder
java.lang.Object
org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<HttpJettySolrClient.Builder,HttpJettySolrClient>
org.apache.solr.client.solrj.jetty.HttpJettySolrClient.Builder
- Enclosing class:
HttpJettySolrClient
public static class HttpJettySolrClient.Builder
extends org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<HttpJettySolrClient.Builder,HttpJettySolrClient>
-
Field Summary
FieldsFields inherited from class org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase
baseSolrUrl, basicAuthAuthorizationStr, connectionTimeoutMillis, defaultCollection, defaultUseHttp1_1, executor, followRedirects, idleTimeoutMillis, maxConnectionsPerHost, proxyHost, proxyIsSecure, proxyIsSocks4, proxyPort, requestTimeoutMillis, requestWriter, responseParser, urlParamNames, useHttp1_1 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListenerFactory(HttpListenerFactory listenerFactory) specify a listener factory, which will be appended to any existing values.build()protected <B extends org.apache.solr.client.solrj.impl.HttpSolrClientBase>
BwithCookieStore(org.eclipse.jetty.http.HttpCookieStore cookieStore) Set a cookieStore other than the default (java.net.InMemoryCookieStore)withHttpClient(HttpJettySolrClient httpJettySolrClient) withKeyStoreReloadInterval(long interval, TimeUnit unit) Set the scanning interval to check for updates in the Key Store used by this client.withListenerFactories(List<HttpListenerFactory> listenerFactories) Specify listener factories, which will replace any existing values.org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<HttpJettySolrClient.Builder, HttpJettySolrClient> withSSLConfig(SSLConfig sslConfig) Methods inherited from class org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase
getConnectionTimeoutMillis, getExecutor, getFollowRedirects, getIdleTimeoutMillis, getMaxConnectionsPerHost, getProxyHost, getProxyPort, getRequestTimeoutMillis, isProxyIsSecure, isProxyIsSocks4, shouldUseHttp1_1, useHttp1_1, withBaseSolrUrl, withBasicAuthCredentials, withConnectionTimeout, withDefaultCollection, withExecutor, withFollowRedirects, withIdleTimeout, withMaxConnectionsPerHost, withOptionalBasicAuthCredentials, withProxyConfiguration, withRequestTimeout, withRequestWriter, withResponseParser, withTheseParamNamesInTheUrl
-
Field Details
-
cookieStore
protected org.eclipse.jetty.http.HttpCookieStore cookieStore -
keyStoreReloadIntervalSecs
-
-
Constructor Details
-
Builder
public Builder() -
Builder
Initialize a Builder object, based on the provided Solr URL.The provided URL must point to the root Solr path ("/solr"), for example:
SolrClient client = new HttpJettySolrClient.Builder("http://my-solr-server:8983/solr") .withDefaultCollection("core1") .build(); QueryResponse resp = client.query(new SolrQuery("*:*"));- Parameters:
baseSolrUrl- a URL to the root Solr path (i.e. "/solr") that will be targeted by any created clients.
-
-
Method Details
-
addListenerFactory
specify a listener factory, which will be appended to any existing values.- Parameters:
listenerFactory- a HttpListenerFactory- Returns:
- This Builder
-
withListenerFactories
public HttpJettySolrClient.Builder withListenerFactories(List<HttpListenerFactory> listenerFactories) Specify listener factories, which will replace any existing values.- Parameters:
listenerFactories- a list of HttpListenerFactory instances- Returns:
- This Builder
-
withSSLConfig
public org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<HttpJettySolrClient.Builder,HttpJettySolrClient> withSSLConfig(SSLConfig sslConfig) -
withKeyStoreReloadInterval
Set the scanning interval to check for updates in the Key Store used by this client. If the interval is unset, 0 or less, then the Key Store Scanner is not created, and the client will not attempt to update key stores. The minimum value between checks is 1 second.- Parameters:
interval- Interval between checksunit- The unit for the interval- Returns:
- This builder
-
build
-
build
- Specified by:
buildin classorg.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<HttpJettySolrClient.Builder,HttpJettySolrClient>
-
withHttpClient
- Overrides:
withHttpClientin classorg.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<HttpJettySolrClient.Builder,HttpJettySolrClient>
-
withCookieStore
public HttpJettySolrClient.Builder withCookieStore(org.eclipse.jetty.http.HttpCookieStore cookieStore) Set a cookieStore other than the default (java.net.InMemoryCookieStore)- Parameters:
cookieStore- The CookieStore to set.nullwill set the default.- Returns:
- this Builder
-