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 AuditManagerauditManagerAudit manager.protected booleaninterruptprotected booleaninterruptedprotected static LoggerLOGprotected NotificationManagernotificationManagerNotification manager.protected ApplicationEventPublisherpublisherprotected SecurityPropertiessecurityPropertiesprotected TtaskThe actual task to be executed.protected TaskDAOtaskDAOTask DAO.protected TaskDataBindertaskDataBinderprotected TaskExecDAOtaskExecDAOTask execution DAO.protected TaskTypetaskTypeprotected TaskUtilsFactorytaskUtilsFactory-
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 StringdoExecute(boolean dryRun, String executor, org.quartz.JobExecutionContext context)The actual execution, delegated to child classes.voidexecute(TaskType taskType, String taskKey, boolean dryRun, org.quartz.JobExecutionContext context)Executes a Quartz Job to run the given Task.protected booleanhasToBeRegistered(TaskExec<?> execution)Template method to determine whether this job's task execution has to be persisted or not.voidinterrupt()booleanisInterrupted()protected voidregister(TaskExec<?> execution)protected voidsetStatus(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:
interruptin interfaceJobDelegate
-
isInterrupted
public boolean isInterrupted()
- Specified by:
isInterruptedin interfaceJobDelegate
-
execute
@Transactional public void execute(TaskType taskType, String taskKey, boolean dryRun, org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException
Description copied from interface:SchedTaskJobDelegateExecutes a Quartz Job to run the given Task.- Specified by:
executein 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)
-
-