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
ConstructorsConstructorDescriptionCachedSolrClient(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 TypeMethodDescriptionvoidNotifies this client that there is a new consumer.voidclose()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.CredentialsReturns the credentials that will be used for authentication.org.apache.solr.client.solrj.SolrClientReturns the delegate Solr client.org.apache.solr.common.util.NamedList<Object>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
-
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:
requestin classorg.apache.solr.client.solrj.SolrClient- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
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
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
-