Package org.alfresco.repo.solr
Class SOLRAdminClient
- java.lang.Object
-
- org.alfresco.repo.search.impl.solr.AbstractSolrAdminHTTPClient
-
- org.alfresco.repo.solr.SOLRAdminClient
-
- All Implemented Interfaces:
SolrAdminClientInterface,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware
public class SOLRAdminClient extends AbstractSolrAdminHTTPClient implements org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.DisposableBean, SolrAdminClientInterface
Provides an interface to the Solr admin APIs, used by the Alfresco Enterprise JMX layer. Also tracks whether Solr is available, sending Spring events when its availability changes.- Since:
- 4.0
-
-
Field Summary
-
Fields inherited from interface org.alfresco.repo.search.impl.solr.SolrAdminClientInterface
JSON_PARAM
-
-
Constructor Summary
Constructors Constructor Description SOLRAdminClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voiddestroy()JSONAPIResultexecuteAction(java.lang.String core, JSONAPIResultFactory.ACTION action, java.util.Map<java.lang.String,java.lang.String> parameters)Execute an ACTION from the SOLR CoreAdmin APIJSONAPIResultexecuteCommand(java.lang.String core, JSONAPIResultFactory.HANDLER handler, JSONAPIResultFactory.COMMAND command, java.util.Map<java.lang.String,java.lang.String> parameters)Execute a COMMAND from the SOLR APIjava.util.List<java.lang.String>getRegisteredCores()voidinit()voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)voidsetBaseUrl(java.lang.String baseUrl)voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)voidsetScheduler(org.quartz.Scheduler scheduler)voidsetShardRegistry(ShardRegistry shardRegistry)voidsetSolrPingCronExpression(java.lang.String solrPingCronExpression)voidsetStoreMappings(java.util.List<SolrStoreMapping> storeMappings)SOLR properties identified by store like "alfresco" or "archive"voidsetUseDynamicShardRegistration(boolean useDynamicShardRegistration)-
Methods inherited from class org.alfresco.repo.search.impl.solr.AbstractSolrAdminHTTPClient
getOperation
-
-
-
-
Method Detail
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
- Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
setSolrPingCronExpression
public void setSolrPingCronExpression(java.lang.String solrPingCronExpression)
-
setBaseUrl
public void setBaseUrl(java.lang.String baseUrl)
-
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler)
- Parameters:
scheduler- the scheduler to set
-
setStoreMappings
public void setStoreMappings(java.util.List<SolrStoreMapping> storeMappings)
SOLR properties identified by store like "alfresco" or "archive"- Parameters:
storeMappings-
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
setShardRegistry
public void setShardRegistry(ShardRegistry shardRegistry)
-
setUseDynamicShardRegistration
public void setUseDynamicShardRegistration(boolean useDynamicShardRegistration)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
init
public void init()
-
executeAction
public JSONAPIResult executeAction(java.lang.String core, JSONAPIResultFactory.ACTION action, java.util.Map<java.lang.String,java.lang.String> parameters)
Description copied from interface:SolrAdminClientInterfaceExecute an ACTION from the SOLR CoreAdmin API- Specified by:
executeActionin interfaceSolrAdminClientInterface- Parameters:
core- Name of the core to execute the command, when null the action is executed for all existing coresaction- SOLR CoreAdmin API Action nameparameters- Action parameters in pairs of key, value- Returns:
-
executeCommand
public JSONAPIResult executeCommand(java.lang.String core, JSONAPIResultFactory.HANDLER handler, JSONAPIResultFactory.COMMAND command, java.util.Map<java.lang.String,java.lang.String> parameters)
Description copied from interface:SolrAdminClientInterfaceExecute a COMMAND from the SOLR API- Specified by:
executeCommandin interfaceSolrAdminClientInterface- Parameters:
core- Name of the core to execute the commandhandler- Name of the handler for the SOLR REST APIcommand- Name of the command to be invokedparameters- Action parameters in pairs of key, value- Returns:
-
getRegisteredCores
public java.util.List<java.lang.String> getRegisteredCores()
-
destroy
public void destroy() throws java.lang.Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
java.lang.Exception
-
-