org.apache.solr.client.solrj.impl

## Class HttpSolrClient.Builder

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

- Enclosing class:
    HttpSolrClient

      public static class HttpSolrClient.Builder
      extends Object

  Constructs `HttpSolrClient` instances from provided configuration.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder()`
    `Builder(String baseSolrUrl)` Create a Builder object, based on the provided Solr URL.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `HttpSolrClient.Builder` | `allowCompression(boolean compression)` Chooses whether created `HttpSolrClient`s use compression by default.
    `HttpSolrClient` | `build()` Create a `HttpSolrClient` based on provided configuration.
    `HttpSolrClient.Builder` | `withBaseSolrUrl(String baseSolrUrl)`
    `HttpSolrClient.Builder` | `withDelegationToken(String delegationToken)` Deprecated.
    `HttpSolrClient.Builder` | `withHttpClient(org.apache.http.client.HttpClient httpClient)` Provides a `HttpClient` for the builder to use when creating clients.
    `HttpSolrClient.Builder` | `withKerberosDelegationToken(String delegationToken)` Use a delegation token for authenticating via the KerberosPlugin
    `HttpSolrClient.Builder` | `withResponseParser(ResponseParser responseParser)` Provides a `ResponseParser` for created clients to use when handling requests.

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

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

- - ### Constructor Detail

    - #### Builder

          public Builder()

    - #### Builder

          public Builder(String baseSolrUrl)

      Create a Builder object, based on the provided Solr URL. By default, compression is not enabled in created HttpSolrClient objects.
      Parameters:
        `baseSolrUrl` - the base URL of the Solr server that will be targeted by any created clients.

  - ### Method Detail

    - #### withBaseSolrUrl

          public HttpSolrClient.Builder withBaseSolrUrl(String baseSolrUrl)

    - #### withHttpClient

          public HttpSolrClient.Builder withHttpClient(org.apache.http.client.HttpClient httpClient)

      Provides a `HttpClient` for the builder to use when creating clients.

    - #### withResponseParser

          public HttpSolrClient.Builder withResponseParser(ResponseParser responseParser)

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

    - #### allowCompression

          public HttpSolrClient.Builder allowCompression(boolean compression)

      Chooses whether created `HttpSolrClient`s use compression by default.

    - #### withKerberosDelegationToken

          public HttpSolrClient.Builder withKerberosDelegationToken(String delegationToken)

      Use a delegation token for authenticating via the KerberosPlugin

    - #### withDelegationToken

          @Deprecated
          public HttpSolrClient.Builder withDelegationToken(String delegationToken)

      Deprecated.

    - #### build

          public HttpSolrClient build()

      Create a `HttpSolrClient` based on provided configuration.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.