Class AbstractSchedTaskJobDelegate<T extends SchedTask>
- java.lang.Object
-
- org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate<T>
-
- All Implemented Interfaces:
JobDelegate
,SchedTaskJobDelegate
- Direct Known Subclasses:
AbstractProvisioningJobDelegate
,ElasticsearchReindex
,ExpiredAccessTokenCleanup
,ExpiredBatchCleanup
,GroupMemberProvisionTaskJobDelegate
,MacroJobDelegate
,OpenSearchReindex
,TestSampleJobDelegate
public abstract class AbstractSchedTaskJobDelegate<T extends SchedTask> extends Object implements SchedTaskJobDelegate
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditManager
auditManager
Audit manager.protected boolean
interrupt
protected boolean
interrupted
protected static Logger
LOG
protected NotificationManager
notificationManager
Notification manager.protected ApplicationEventPublisher
publisher
protected SecurityProperties
securityProperties
protected T
task
The actual task to be executed.protected TaskDAO
taskDAO
Task DAO.protected TaskDataBinder
taskDataBinder
protected TaskExecDAO
taskExecDAO
Task execution DAO.protected TaskType
taskType
protected TaskUtilsFactory
taskUtilsFactory
-
Fields inherited from interface org.apache.syncope.core.provisioning.api.job.JobDelegate
OPERATION_ID
-
-
Constructor Summary
Constructors Constructor Description AbstractSchedTaskJobDelegate()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract String
doExecute(boolean dryRun, String executor, org.quartz.JobExecutionContext context)
The actual execution, delegated to child classes.void
execute(TaskType taskType, String taskKey, boolean dryRun, org.quartz.JobExecutionContext context)
Executes a Quartz Job to run the given Task.protected boolean
hasToBeRegistered(TaskExec<?> execution)
Template method to determine whether this job's task execution has to be persisted or not.void
interrupt()
boolean
isInterrupted()
protected void
register(TaskExec<?> execution)
protected void
setStatus(String status)
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
securityProperties
@Autowired protected SecurityProperties securityProperties
-
taskType
protected TaskType taskType
-
taskExecDAO
@Autowired protected TaskExecDAO taskExecDAO
Task execution DAO.
-
taskDAO
@Autowired protected TaskDAO taskDAO
Task DAO.
-
taskUtilsFactory
@Autowired protected TaskUtilsFactory taskUtilsFactory
-
taskDataBinder
@Autowired protected TaskDataBinder taskDataBinder
-
notificationManager
@Autowired protected NotificationManager notificationManager
Notification manager.
-
auditManager
@Autowired protected AuditManager auditManager
Audit manager.
-
publisher
@Autowired protected ApplicationEventPublisher publisher
-
interrupt
protected boolean interrupt
-
interrupted
protected boolean interrupted
-
-
Method Detail
-
setStatus
protected void setStatus(String status)
-
interrupt
public void interrupt()
- Specified by:
interrupt
in interfaceJobDelegate
-
isInterrupted
public boolean isInterrupted()
- Specified by:
isInterrupted
in interfaceJobDelegate
-
execute
@Transactional public void execute(TaskType taskType, String taskKey, boolean dryRun, org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException
Description copied from interface:SchedTaskJobDelegate
Executes a Quartz Job to run the given Task.- Specified by:
execute
in interfaceSchedTaskJobDelegate
- Parameters:
taskType
- Type of task to runtaskKey
- Task key to rundryRun
- indicates if execution shall be simulated with no actual changescontext
- Quartz' execution context, can be used to pass parameters to the job- Throws:
org.quartz.JobExecutionException
- if anything goes wrong
-
doExecute
protected abstract String doExecute(boolean dryRun, String executor, org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException
The actual execution, delegated to child classes.- Parameters:
dryRun
- whether to actually touch the dataexecutor
- the user executing this taskcontext
- Quartz' execution context, can be used to pass parameters to the job- Returns:
- the task execution status to be set
- Throws:
org.quartz.JobExecutionException
- if anything goes wrong
-
hasToBeRegistered
protected boolean hasToBeRegistered(TaskExec<?> execution)
Template method to determine whether this job's task execution has to be persisted or not.- Parameters:
execution
- task execution- Returns:
- whether to persist or not
-
register
protected void register(TaskExec<?> execution)
-
-