Class HttpJettySolrClient
java.lang.Object
org.apache.solr.client.solrj.SolrClient
org.apache.solr.client.solrj.impl.HttpSolrClientBase
org.apache.solr.client.solrj.jetty.HttpJettySolrClient
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable
public class HttpJettySolrClient
extends org.apache.solr.client.solrj.impl.HttpSolrClientBase
An HTTP
SolrClient using Jetty HttpClient. This is Solr's most mature client for
direct HTTP.
Despite the name, this client supports HTTP 1.1 and 2 -- toggle with HttpSolrClientBuilderBase.useHttp1_1(boolean). In retrospect, the name should have been
HttpJettySolrClient.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrClient
org.apache.solr.client.solrj.SolrClient.SolrClientFunction<C extends org.apache.solr.client.solrj.SolrClient,R> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.solr.client.solrj.jetty.HttpJettySolrClient.AsyncTrackerstatic final StringA Java system property to select the SolrClientCustomizer used for configuring this client.static final StringFields inherited from class org.apache.solr.client.solrj.impl.HttpSolrClientBase
basicAuthAuthorizationStr, DEFAULT_PATH, defaultParserMimeTypes, FALLBACK_CHARSET, parser, requestTimeoutMillis, requestWriter, serverBaseUrl, urlParamNamesFields inherited from class org.apache.solr.client.solrj.SolrClient
defaultCollection -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpJettySolrClient(String serverBaseUrl, HttpJettySolrClient.Builder builder) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListenerFactory(HttpListenerFactory factory) Deprecated.protected StringallProcessorSupportedContentTypesCommaDelimited(Collection<String> processorSupportedContentTypes) protected static StringbasicAuthCredentialsToAuthorizationString(String user, String pass) org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<?, ?> builder()voidclose()protected org.apache.solr.client.solrj.impl.LBSolrClientprotected voiddecorateRequest(org.eclipse.jetty.client.Request req, org.apache.solr.client.solrj.SolrRequest<?> solrRequest, boolean isAsync) org.eclipse.jetty.client.HttpClientinternal use onlylong(visible for testing)protected org.apache.solr.common.params.ModifiableSolrParamsinitializeSolrParams(org.apache.solr.client.solrj.SolrRequest<?> solrRequest, org.apache.solr.client.solrj.response.ResponseParser parserToUse) protected booleanprotected booleanprocessorAcceptsMimeType(Collection<String> processorSupportedContentTypes, String mimeType) org.apache.solr.common.util.NamedList<Object> CompletableFuture<org.apache.solr.common.util.NamedList<Object>> requestAsync(org.apache.solr.client.solrj.SolrRequest<?> solrRequest, String collection) <R> RrequestWithBaseUrl(String baseUrl, org.apache.solr.client.solrj.SolrClient.SolrClientFunction<HttpJettySolrClient, R> clientFunction) Temporarily modifies the client to use a different base URL and runs the provided lambdaorg.apache.solr.common.util.NamedList<Object> requestWithBaseUrl(String baseUrl, org.apache.solr.client.solrj.SolrRequest<?> solrRequest, String collection) static voidprotected org.apache.solr.client.solrj.response.ResponseParserresponseParser(org.apache.solr.client.solrj.SolrRequest<?> solrRequest) voidsetAuthenticationStore(org.eclipse.jetty.client.AuthenticationStore authenticationStore) static voidsetDefaultSSLConfig(SSLConfig sslConfig) protected voidMethods inherited from class org.apache.solr.client.solrj.impl.HttpSolrClientBase
calculateQueryParams, getBaseURL, getParser, getRequestUrl, getRequestWriter, getUrlParamNames, isMultipart, isV2ApiRequest, processErrorsAndResponse, requestAsync, setParser, validateGetRequest, wantStreamMethods inherited from class org.apache.solr.client.solrj.SolrClient
add, add, add, add, add, add, add, add, add, add, addBean, addBean, addBean, addBean, addBeans, addBeans, addBeans, addBeans, addBeans, addBeans, commit, commit, commit, commit, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, deleteByQuery, deleteByQuery, getById, getById, getById, getById, getById, getById, getById, getById, getContext, getDefaultCollection, optimize, optimize, optimize, optimize, optimize, optimize, ping, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback
-
Field Details
-
CLIENT_CUSTOMIZER_SYSPROP
A Java system property to select the SolrClientCustomizer used for configuring this client.- See Also:
-
REQ_PRINCIPAL_KEY
- See Also:
-
asyncTracker
protected org.apache.solr.client.solrj.jetty.HttpJettySolrClient.AsyncTracker asyncTracker
-
-
Constructor Details
-
HttpJettySolrClient
-
-
Method Details
-
addListenerFactory
Deprecated. -
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient()internal use only -
close
public void close() -
setAuthenticationStore
public void setAuthenticationStore(org.eclipse.jetty.client.AuthenticationStore authenticationStore) -
getIdleTimeoutMillis
public long getIdleTimeoutMillis()(visible for testing) -
requestAsync
public CompletableFuture<org.apache.solr.common.util.NamedList<Object>> requestAsync(org.apache.solr.client.solrj.SolrRequest<?> solrRequest, String collection) - Specified by:
requestAsyncin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
request
public org.apache.solr.common.util.NamedList<Object> request(org.apache.solr.client.solrj.SolrRequest<?> solrRequest, String collection) throws org.apache.solr.client.solrj.SolrServerException, IOException - Specified by:
requestin classorg.apache.solr.client.solrj.SolrClient- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
requestWithBaseUrl
public org.apache.solr.common.util.NamedList<Object> requestWithBaseUrl(String baseUrl, org.apache.solr.client.solrj.SolrRequest<?> solrRequest, String collection) throws org.apache.solr.client.solrj.SolrServerException, IOException - Specified by:
requestWithBaseUrlin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
requestWithBaseUrl
public <R> R requestWithBaseUrl(String baseUrl, org.apache.solr.client.solrj.SolrClient.SolrClientFunction<HttpJettySolrClient, R> clientFunction) throws org.apache.solr.client.solrj.SolrServerException, IOExceptionTemporarily modifies the client to use a different base URL and runs the provided lambda- Type Parameters:
R- the type returned by the provided function (and by this method)- Parameters:
baseUrl- the base URL to use on any requests made within the 'clientFunction' lambdaclientFunction- a Function that consumes a HttpJettySolrClient and returns an arbitrary value- Returns:
- the value returned after invoking 'clientFunction'
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
createLBSolrClient
protected org.apache.solr.client.solrj.impl.LBSolrClient createLBSolrClient()- Specified by:
createLBSolrClientin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
builder
public org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<?,?> builder()- Specified by:
builderin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
initializeSolrParams
protected org.apache.solr.common.params.ModifiableSolrParams initializeSolrParams(org.apache.solr.client.solrj.SolrRequest<?> solrRequest, org.apache.solr.client.solrj.response.ResponseParser parserToUse) - Overrides:
initializeSolrParamsin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
responseParser
protected org.apache.solr.client.solrj.response.ResponseParser responseParser(org.apache.solr.client.solrj.SolrRequest<?> solrRequest) - Overrides:
responseParserin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
basicAuthCredentialsToAuthorizationString
-
decorateRequest
protected void decorateRequest(org.eclipse.jetty.client.Request req, org.apache.solr.client.solrj.SolrRequest<?> solrRequest, boolean isAsync) -
isFollowRedirects
protected boolean isFollowRedirects()- Specified by:
isFollowRedirectsin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
processorAcceptsMimeType
protected boolean processorAcceptsMimeType(Collection<String> processorSupportedContentTypes, String mimeType) - Specified by:
processorAcceptsMimeTypein classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
updateDefaultMimeTypeForParser
protected void updateDefaultMimeTypeForParser()- Specified by:
updateDefaultMimeTypeForParserin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
allProcessorSupportedContentTypesCommaDelimited
protected String allProcessorSupportedContentTypesCommaDelimited(Collection<String> processorSupportedContentTypes) - Specified by:
allProcessorSupportedContentTypesCommaDelimitedin classorg.apache.solr.client.solrj.impl.HttpSolrClientBase
-
setDefaultSSLConfig
-
resetSslContextFactory
public static void resetSslContextFactory()
-