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 Details

    • cookieStore

      protected org.eclipse.jetty.http.HttpCookieStore cookieStore
    • keyStoreReloadIntervalSecs

      protected Long keyStoreReloadIntervalSecs
  • Constructor Details

    • Builder

      public Builder()
    • Builder

      public Builder(String baseSolrUrl)
      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

      public HttpJettySolrClient.Builder addListenerFactory(HttpListenerFactory listenerFactory)
      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

      public HttpJettySolrClient.Builder withKeyStoreReloadInterval(long interval, TimeUnit unit)
      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 checks
      unit - The unit for the interval
      Returns:
      This builder
    • build

      protected <B extends org.apache.solr.client.solrj.impl.HttpSolrClientBase> B build(Class<B> type)
    • build

      public HttpJettySolrClient build()
      Specified by:
      build in class org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<HttpJettySolrClient.Builder,HttpJettySolrClient>
    • withHttpClient

      public HttpJettySolrClient.Builder withHttpClient(HttpJettySolrClient httpJettySolrClient)
      Overrides:
      withHttpClient in class org.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. null will set the default.
      Returns:
      this Builder