public class DefaultSolrClientProvider extends AbstractLogEnabled implements SolrClientProvider, Component, Serviceable, Initializable, Disposable
Modifier and Type | Field and Description |
---|---|
private static String |
__SOLR_CORE_PREFIX_CONFIG |
private static String |
__SOLR_URL_CONFIG |
protected String |
_solrCorePrefix
The solr core prefix.
|
protected SolrClient |
_solrReadClient
The Solr read client.
|
protected Map<String,SolrClient> |
_solrUpdateClients
The Solr update clients, per workspace
|
protected WorkspaceSelector |
_workspaceSelector
The workspace selector.
|
ROLE
Constructor and Description |
---|
DefaultSolrClientProvider() |
Modifier and Type | Method and Description |
---|---|
private SolrClient |
_createUpdateClient(String url,
String workspaceName) |
private String |
_nonNullWorkspaceName(String workspaceName) |
void |
dispose() |
String |
getCollectionName()
Get the name of the collection to use.
|
String |
getCollectionName(String workspaceName)
Get the collection to use.
|
SolrClient |
getReadClient()
Get the "read" mode solr client.
|
SolrClient |
getUpdateClient(String workspaceName)
Get a Solr client suited to update.
|
void |
initialize() |
void |
service(ServiceManager serviceManager) |
getLogger, setLogger
private static final String __SOLR_URL_CONFIG
private static final String __SOLR_CORE_PREFIX_CONFIG
protected WorkspaceSelector _workspaceSelector
protected SolrClient _solrReadClient
protected Map<String,SolrClient> _solrUpdateClients
protected String _solrCorePrefix
public DefaultSolrClientProvider()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
private SolrClient _createUpdateClient(String url, String workspaceName)
public void dispose()
dispose
in interface Disposable
public SolrClient getReadClient()
SolrClientProvider
getReadClient
in interface SolrClientProvider
public SolrClient getUpdateClient(String workspaceName)
SolrClientProvider
getUpdateClient
in interface SolrClientProvider
workspaceName
- The name of the workspacepublic String getCollectionName()
SolrClientProvider
getCollectionName
in interface SolrClientProvider
public String getCollectionName(String workspaceName)
SolrClientProvider
getCollectionName
in interface SolrClientProvider
workspaceName
- The workspace name.private String _nonNullWorkspaceName(String workspaceName)