Class CachedSolrClient

java.lang.Object
org.apache.solr.client.solrj.SolrClient
de.hybris.platform.solrfacetsearch.solr.impl.CachedSolrClient
All Implemented Interfaces:
Closeable, Serializable, AutoCloseable

public class CachedSolrClient extends org.apache.solr.client.solrj.SolrClient
The cached SolrClient instance. This is a wrapper around the real SolrClient.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    CachedSolrClient(org.apache.solr.client.solrj.SolrClient delegate)
     
    CachedSolrClient(org.apache.solr.client.solrj.SolrClient delegate, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod, org.apache.http.auth.Credentials credentials)
     
    CachedSolrClient(org.apache.solr.client.solrj.SolrClient delegate, org.apache.http.auth.Credentials credentials)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Notifies this client that there is a new consumer.
    void
    Notifies this client to remove one consumer.
    Consumer<org.apache.solr.client.solrj.SolrClient>
    Returns the method used to release resources associated with the delegate Solr client.
    protected org.apache.http.auth.Credentials
    Returns the credentials that will be used for authentication.
    org.apache.solr.client.solrj.SolrClient
    Returns the delegate Solr client.
    org.apache.solr.common.util.NamedList<Object>
    request(org.apache.solr.client.solrj.SolrRequest solrRequest, String collection)
     

    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, optimize, optimize, optimize, optimize, optimize, optimize, ping, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CachedSolrClient

      public CachedSolrClient(org.apache.solr.client.solrj.SolrClient delegate)
    • CachedSolrClient

      public CachedSolrClient(org.apache.solr.client.solrj.SolrClient delegate, org.apache.http.auth.Credentials credentials)
    • CachedSolrClient

      public CachedSolrClient(org.apache.solr.client.solrj.SolrClient delegate, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod, org.apache.http.auth.Credentials credentials)
  • Method Details

    • 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:
      request in class org.apache.solr.client.solrj.SolrClient
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • close

      public void close()
      Notifies this client to remove one consumer. If this client is no longer required (consumersNumber < 0), Closeable.close() is called on the delegate client.
    • addConsumer

      public void addConsumer()
      Notifies this client that there is a new consumer.
    • getDelegate

      public org.apache.solr.client.solrj.SolrClient getDelegate()
      Returns the delegate Solr client.
      Returns:
      the delegate Solr client
    • getCloseMethod

      public Consumer<org.apache.solr.client.solrj.SolrClient> getCloseMethod()
      Returns the method used to release resources associated with the delegate Solr client.
      Returns:
      the close method
    • getCredentials

      protected org.apache.http.auth.Credentials getCredentials()
      Returns the credentials that will be used for authentication.
      Returns:
      the credentials