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

## Class HttpSolrClientBase

- java.lang.Object
- - org.apache.solr.client.solrj.SolrClient
  - - org.apache.solr.client.solrj.impl.HttpSolrClientBase

All Implemented Interfaces:
  `Closeable`, `Serializable`, `AutoCloseable`

Direct Known Subclasses:
  `Http2SolrClient`, `HttpJdkSolrClient`

    public abstract class HttpSolrClientBase
    extends SolrClient

See Also:
  Serialized Form

### Field Summary

Fields
`protected String` `basicAuthAuthorizationStr`
`protected static String` `DEFAULT_PATH`
`protected Set<String>` `defaultParserMimeTypes`
`protected static Charset` `FALLBACK_CHARSET`
`protected ResponseParser` `parser`
`protected long` `requestTimeoutMillis`
`protected RequestWriter` `requestWriter`
`protected String` `serverBaseUrl` The URL of the Solr server.
`protected Set<String>` `urlParamNames`

### Fields inherited from class org.apache.solr.client.solrj.SolrClient

`defaultCollection`

### Constructor Summary

Constructors
`protected` `HttpSolrClientBase​(String serverBaseUrl, HttpSolrClientBuilderBase<?,​?> builder)`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
`protected abstract String` `allProcessorSupportedContentTypesCommaDelimited​(Collection<String> processorSupportedContentTypes)`
`abstract Cancellable` `asyncRequest​(SolrRequest<?> solrRequest, String collection, AsyncListener<NamedList<Object>> asyncListener)` Deprecated. use `requestAsync(SolrRequest, String)`.
`protected static String` `basicAuthCredentialsToAuthorizationString​(String user, String pass)`
`protected ModifiableSolrParams` `calculateQueryParams​(Set<String> queryParamNames, ModifiableSolrParams wparams)`
`String` `getBaseURL()`
`ResponseParser` `getParser()`
`protected String` `getRequestUrl​(SolrRequest<?> solrRequest, String collection)`
`Set<String>` `getUrlParamNames()`
`protected ModifiableSolrParams` `initalizeSolrParams​(SolrRequest<?> solrRequest, ResponseParser parserToUse)` Deprecated, for removal: This API element is subject to removal in a future version.
`protected ModifiableSolrParams` `initializeSolrParams​(SolrRequest<?> solrRequest, ResponseParser parserToUse)`
`protected abstract boolean` `isFollowRedirects()`
`protected boolean` `isMultipart​(Collection<ContentStream> streams)`
`boolean` `isV2ApiRequest​(SolrRequest<?> request)`
`protected NamedList<Object>` `processErrorsAndResponse​(int httpStatus, String responseReason, String responseMethod, ResponseParser processor, InputStream is, String mimeType, String encoding, boolean isV2Api, String urlExceptionMessage)`
`protected abstract boolean` `processorAcceptsMimeType​(Collection<String> processorSupportedContentTypes, String mimeType)`
`CompletableFuture<NamedList<Object>>` `requestAsync​(SolrRequest<?> request)` Execute an asynchronous request against a Solr server using the default collection.
`abstract CompletableFuture<NamedList<Object>>` `requestAsync​(SolrRequest<?> request, String collection)` Execute an asynchronous request against a Solr server for a given collection.
`protected ResponseParser` `responseParser​(SolrRequest<?> solrRequest)`
`protected void` `setParser​(ResponseParser parser)`
`protected abstract void` `updateDefaultMimeTypeForParser()`
`protected void` `validateGetRequest​(SolrRequest<?> solrRequest)`
`protected boolean` `wantStream​(ResponseParser processor)`

### Methods 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, getBinder, 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, request, rollback, rollback`

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

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

### Methods inherited from interface java.io.Closeable

`close`

### Field Detail

#### DEFAULT_PATH

    protected static final String DEFAULT_PATH

See Also:
  Constant Field Values

#### FALLBACK_CHARSET

    protected static final Charset FALLBACK_CHARSET

#### serverBaseUrl

    protected final String serverBaseUrl

The URL of the Solr server.

#### requestTimeoutMillis

    protected final long requestTimeoutMillis

#### urlParamNames

    protected final Set<String> urlParamNames

#### requestWriter

    protected RequestWriter requestWriter

#### parser

    protected ResponseParser parser

#### defaultParserMimeTypes

    protected Set<String> defaultParserMimeTypes

#### basicAuthAuthorizationStr

    protected final String basicAuthAuthorizationStr

### Constructor Detail

#### HttpSolrClientBase

    protected HttpSolrClientBase​(String serverBaseUrl,
                                 HttpSolrClientBuilderBase<?,​?> builder)

### Method Detail

#### getRequestUrl

    protected String getRequestUrl​(SolrRequest<?> solrRequest,
                                   String collection)
                            throws MalformedURLException

Throws:
  `MalformedURLException`

#### responseParser

    protected ResponseParser responseParser​(SolrRequest<?> solrRequest)

#### initalizeSolrParams

    @Deprecated(since="9.8",
                forRemoval=true)
    protected ModifiableSolrParams initalizeSolrParams​(SolrRequest<?> solrRequest,
                                                       ResponseParser parserToUse)

Deprecated, for removal: This API element is subject to removal in a future version.

#### initializeSolrParams

    protected ModifiableSolrParams initializeSolrParams​(SolrRequest<?> solrRequest,
                                                        ResponseParser parserToUse)

#### isMultipart

    protected boolean isMultipart​(Collection<ContentStream> streams)

#### calculateQueryParams

    protected ModifiableSolrParams calculateQueryParams​(Set<String> queryParamNames,
                                                        ModifiableSolrParams wparams)

#### validateGetRequest

    protected void validateGetRequest​(SolrRequest<?> solrRequest)
                               throws IOException

Throws:
  `IOException`

#### isFollowRedirects

    protected abstract boolean isFollowRedirects()

#### processErrorsAndResponse

    protected NamedList<Object> processErrorsAndResponse​(int httpStatus,
                                                         String responseReason,
                                                         String responseMethod,
                                                         ResponseParser processor,
                                                         InputStream is,
                                                         String mimeType,
                                                         String encoding,
                                                         boolean isV2Api,
                                                         String urlExceptionMessage)
                                                  throws SolrServerException

Throws:
  `SolrServerException`

#### wantStream

    protected boolean wantStream​(ResponseParser processor)

#### processorAcceptsMimeType

    protected abstract boolean processorAcceptsMimeType​(Collection<String> processorSupportedContentTypes,
                                                        String mimeType)

#### allProcessorSupportedContentTypesCommaDelimited

    protected abstract String allProcessorSupportedContentTypesCommaDelimited​(Collection<String> processorSupportedContentTypes)

#### basicAuthCredentialsToAuthorizationString

    protected static String basicAuthCredentialsToAuthorizationString​(String user,
                                                                      String pass)

#### setParser

    protected void setParser​(ResponseParser parser)

#### updateDefaultMimeTypeForParser

    protected abstract void updateDefaultMimeTypeForParser()

#### asyncRequest

    @Deprecated
    public abstract Cancellable asyncRequest​(SolrRequest<?> solrRequest,
                                             String collection,
                                             AsyncListener<NamedList<Object>> asyncListener)

Deprecated.
use `requestAsync(SolrRequest, String)`.

Parameters:
  `solrRequest` - the request to perform
  `collection` - if null the default collection is used
  `asyncListener` - callers should provide an implementation to handle events: start, success, exception
Returns:
  Cancellable allowing the caller to attempt cancellation

#### requestAsync

    public abstract CompletableFuture<NamedList<Object>> requestAsync​(SolrRequest<?> request,
                                                                      String collection)

Execute an asynchronous request against a Solr server for a given collection.

Parameters:
  `request` - the request to execute
  `collection` - the collection to execute the request against
Returns:
  a `CompletableFuture` that tracks the progress of the async request. Supports cancelling requests via `CompletableFuture.cancel(boolean)`, adding callbacks/error handling using `CompletableFuture.whenComplete(BiConsumer)` and `CompletableFuture.exceptionally(Function)` methods, and other CompletableFuture functionality. Will complete exceptionally in case of either an `IOException` or `SolrServerException` during the request. Once completed, the CompletableFuture will contain a `NamedList` with the response from the server.

#### requestAsync

    public CompletableFuture<NamedList<Object>> requestAsync​(SolrRequest<?> request)

Execute an asynchronous request against a Solr server using the default collection.

Parameters:
  `request` - the request to execute
Returns:
  a `CompletableFuture` see `requestAsync(SolrRequest, String)`.

#### isV2ApiRequest

    public boolean isV2ApiRequest​(SolrRequest<?> request)

#### getBaseURL

    public String getBaseURL()

#### getParser

    public ResponseParser getParser()

#### getUrlParamNames

    public Set<String> getUrlParamNames()