Class CronScheduledQueryBasedTemplateActionDefinition
- java.lang.Object
-
- org.alfresco.repo.action.scheduled.AbstractScheduledAction
-
- org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition
-
- All Implemented Interfaces:
ScheduledActionDefinition,org.springframework.beans.factory.InitializingBean
public class CronScheduledQueryBasedTemplateActionDefinition extends AbstractScheduledAction
A scheduled action for which the trigger is defined in the standard cron format and the nodes to which the action should be run is defined from the nodes selected by query.- Author:
- Andy Hind
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.alfresco.repo.action.scheduled.AbstractScheduledAction
AbstractScheduledAction.CompensatingActionMode, AbstractScheduledAction.JobDefinition, AbstractScheduledAction.Pair<FIRST,SECOND>, AbstractScheduledAction.TransactionMode
-
-
Constructor Summary
Constructors Constructor Description CronScheduledQueryBasedTemplateActionDefinition()Default constructore
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Register with the scheduler.ActiongetAction(org.alfresco.service.cmr.repository.NodeRef nodeRef)Generate the actual action for the given node from the action template.java.lang.StringgetCronExpression()Get the cron expression.java.lang.StringgetJobGroup()Get the job group.java.lang.StringgetJobName()Get the job namejava.util.List<org.alfresco.service.cmr.repository.NodeRef>getNodes()Get the list of nodes against which this action should run.java.lang.StringgetQueryLanguage()Get the query language.java.lang.StringgetQueryTemplate()Get the template from which to build the query.org.quartz.SchedulergetScheduler()Get the scheduler.org.alfresco.service.cmr.search.SearchServicegetSearchService()Get the search service.java.util.List<java.lang.String>getStores()Get the list of stores.TemplateActionModelFactorygetTemplateActionModelFactory()Get the template action model factory.TemplateServicegetTemplateService()Get the template service.org.quartz.TriggergetTrigger()Get the trigger definition for this job.java.lang.StringgetTriggerGroup()Get the name of the trigger group.java.lang.StringgetTriggerName()Get the trigger namevoidsetCronExpression(java.lang.String cronExpression)Set the cron expression - see the wiki for examples.voidsetJobGroup(java.lang.String jobGroup)Set the job group.voidsetJobName(java.lang.String jobName)Set the job name.voidsetQueryLanguage(java.lang.String queryLanguage)Set the query languagevoidsetQueryTemplate(java.lang.String queryTemplate)Set the template for the query.voidsetScheduler(org.quartz.Scheduler scheduler)Set the scheduler.voidsetSearchService(org.alfresco.service.cmr.search.SearchService searchService)Set the search service.voidsetStores(java.util.List<java.lang.String> stores)Set alist of stores to use.voidsetTemplateActionModelFactory(TemplateActionModelFactory templateActionModelFactory)Set the template action model factory.voidsetTemplateService(TemplateService templateService)Set the template service.voidsetTriggerGroup(java.lang.String triggerGroup)Set the trigger group.voidsetTriggerName(java.lang.String triggerName)Set the trigger name.-
Methods inherited from class org.alfresco.repo.action.scheduled.AbstractScheduledAction
getActionService, getCompensatingActionModeEnum, getRunAsUser, getTemplateActionDefinition, getTransactionModeEnum, getTransactionService, register, setActionService, setCompensatingActionMode, setRunAsUser, setTemplateActionDefinition, setTransactionMode, setTransactionService
-
-
-
-
Method Detail
-
getSearchService
public org.alfresco.service.cmr.search.SearchService getSearchService()
Get the search service.- Returns:
- - the serach service.
-
setSearchService
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Set the search service.- Parameters:
searchService- SearchService
-
getTemplateService
public TemplateService getTemplateService()
Get the template service.- Returns:
- - the template service.
-
setTemplateService
public void setTemplateService(TemplateService templateService)
Set the template service.- Parameters:
templateService- TemplateService
-
getScheduler
public org.quartz.Scheduler getScheduler()
Get the scheduler.- Returns:
- - the scheduler.
-
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler)
Set the scheduler.- Parameters:
scheduler- Scheduler
-
getTemplateActionModelFactory
public TemplateActionModelFactory getTemplateActionModelFactory()
Get the template action model factory.- Returns:
- - the template action model factory.
-
setTemplateActionModelFactory
public void setTemplateActionModelFactory(TemplateActionModelFactory templateActionModelFactory)
Set the template action model factory.- Parameters:
templateActionModelFactory- TemplateActionModelFactory
-
getTrigger
public org.quartz.Trigger getTrigger()
Description copied from class:AbstractScheduledActionGet the trigger definition for this job. Used to register with the injected scheduler.- Specified by:
getTriggerin classAbstractScheduledAction- Returns:
- - the trigger definition for this scheduled action.
-
getNodes
public java.util.List<org.alfresco.service.cmr.repository.NodeRef> getNodes()
Description copied from class:AbstractScheduledActionGet the list of nodes against which this action should run.- Specified by:
getNodesin classAbstractScheduledAction- Returns:
- - the list of node refs for which to run this action.
-
getAction
public Action getAction(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from class:AbstractScheduledActionGenerate the actual action for the given node from the action template.- Specified by:
getActionin classAbstractScheduledAction- Parameters:
nodeRef- NodeRef- Returns:
- - the action to execute.
-
setQueryLanguage
public void setQueryLanguage(java.lang.String queryLanguage)
Set the query language- Parameters:
queryLanguage- String
-
getQueryLanguage
public java.lang.String getQueryLanguage()
Get the query language.- Returns:
- - the query language.
-
setStores
public void setStores(java.util.List<java.lang.String> stores)
Set alist of stores to use.- Parameters:
stores- - the list of stores.
-
getStores
public java.util.List<java.lang.String> getStores()
Get the list of stores.- Returns:
- - the list of stores.
-
setQueryTemplate
public void setQueryTemplate(java.lang.String queryTemplate)
Set the template for the query.- Parameters:
queryTemplate- String
-
getQueryTemplate
public java.lang.String getQueryTemplate()
Get the template from which to build the query.- Returns:
- - the template for the query.
-
setCronExpression
public void setCronExpression(java.lang.String cronExpression)
Set the cron expression - see the wiki for examples.- Parameters:
cronExpression- String
-
getCronExpression
public java.lang.String getCronExpression()
Get the cron expression.- Returns:
- - the cron expression.
-
setJobName
public void setJobName(java.lang.String jobName)
Set the job name.- Parameters:
jobName- String
-
getJobName
public java.lang.String getJobName()
Get the job name- Returns:
- - the job name.
-
setJobGroup
public void setJobGroup(java.lang.String jobGroup)
Set the job group.- Parameters:
jobGroup- String
-
getJobGroup
public java.lang.String getJobGroup()
Get the job group.- Returns:
- - the job group.
-
setTriggerName
public void setTriggerName(java.lang.String triggerName)
Set the trigger name.- Parameters:
triggerName- String
-
getTriggerName
public java.lang.String getTriggerName()
Get the trigger name- Returns:
- - the trigger name.
-
setTriggerGroup
public void setTriggerGroup(java.lang.String triggerGroup)
Set the trigger group.- Parameters:
triggerGroup- String
-
getTriggerGroup
public java.lang.String getTriggerGroup()
Get the name of the trigger group.- Returns:
- - the trigger group.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.ExceptionRegister with the scheduler.- Throws:
java.lang.Exception
-
-