Class AbstractSchedTaskJobDelegate<T extends SchedTask>
java.lang.Object
org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate<T>
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionprotected AuditManager
Audit manager.protected String
protected static final Logger
protected boolean
protected NotificationManager
Notification manager.protected ApplicationEventPublisher
protected SecurityProperties
protected T
The actual task to be executed.protected TaskDAO
Task DAO.protected TaskExecDAO
Task execution DAO.protected TaskType
protected TaskUtilsFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
doExecute
(JobExecutionContext context) The actual execution, delegated to child classes.protected void
end()
protected void
endExecution
(TaskExec<SchedTask> execution, String message, String status, OpEvent.Outcome result) void
execute
(TaskType taskType, String taskKey, JobExecutionContext context) Executes a 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.protected void
init
(TaskType taskType, String taskKey, JobExecutionContext context) protected void
protected void
-
Field Details
-
LOG
-
securityProperties
-
taskType
-
task
The actual task to be executed. -
taskExecDAO
Task execution DAO. -
taskDAO
Task DAO. -
taskUtilsFactory
-
notificationManager
Notification manager. -
auditManager
Audit manager. -
publisher
-
manageOperationId
protected boolean manageOperationId -
executor
-
-
Constructor Details
-
AbstractSchedTaskJobDelegate
public AbstractSchedTaskJobDelegate()
-
-
Method Details
-
setStatus
-
init
protected void init(TaskType taskType, String taskKey, JobExecutionContext context) throws JobExecutionException - Throws:
JobExecutionException
-
initExecution
-
endExecution
protected void endExecution(TaskExec<SchedTask> execution, String message, String status, OpEvent.Outcome result) -
end
protected void end() -
execute
@Transactional public void execute(TaskType taskType, String taskKey, JobExecutionContext context) throws JobExecutionException Description copied from interface:SchedTaskJobDelegate
Executes a Job to run the given Task.- Specified by:
execute
in interfaceSchedTaskJobDelegate
- Parameters:
taskType
- Type of task to runtaskKey
- Task key to runcontext
- execution context, can be used to pass parameters to the job- Throws:
JobExecutionException
- if anything goes wrong
-
doExecute
The actual execution, delegated to child classes.- Parameters:
context
- job execution context, can be used to pass parameters to the job- Returns:
- the task execution status to be set
- Throws:
JobExecutionException
- if anything goes wrong
-
hasToBeRegistered
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
-