Class AbstractSchedTaskJobDelegate<T extends org.apache.syncope.core.persistence.api.entity.task.SchedTask>
- java.lang.Object
-
- org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate<T>
-
- All Implemented Interfaces:
org.apache.syncope.core.provisioning.api.job.JobDelegate
,org.apache.syncope.core.provisioning.api.job.SchedTaskJobDelegate
- Direct Known Subclasses:
AbstractProvisioningJobDelegate
,ExpiredAccessTokenCleanup
,ExpiredBatchCleanup
,GroupMemberProvisionTaskJobDelegate
public abstract class AbstractSchedTaskJobDelegate<T extends org.apache.syncope.core.persistence.api.entity.task.SchedTask> extends Object implements org.apache.syncope.core.provisioning.api.job.SchedTaskJobDelegate
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.syncope.core.provisioning.api.AuditManager
auditManager
Audit manager.protected boolean
interrupt
protected boolean
interrupted
protected static org.slf4j.Logger
LOG
protected org.apache.syncope.core.provisioning.api.notification.NotificationManager
notificationManager
Notification manager.protected org.springframework.context.ApplicationEventPublisher
publisher
protected T
task
The actual task to be executed.protected org.apache.syncope.core.persistence.api.dao.TaskDAO
taskDAO
Task DAO.protected org.apache.syncope.core.provisioning.api.data.TaskDataBinder
taskDataBinder
protected org.apache.syncope.core.persistence.api.dao.TaskExecDAO
taskExecDAO
Task execution DAO.protected org.apache.syncope.common.lib.types.TaskType
taskType
protected org.apache.syncope.core.persistence.api.entity.task.TaskUtilsFactory
taskUtilsFactory
-
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(org.apache.syncope.common.lib.types.TaskType taskType, String taskKey, boolean dryRun, org.quartz.JobExecutionContext context)
protected boolean
hasToBeRegistered(org.apache.syncope.core.persistence.api.entity.task.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(org.apache.syncope.core.persistence.api.entity.task.TaskExec<?> execution)
protected void
setStatus(String status)
-
-
-
Field Detail
-
LOG
protected static final org.slf4j.Logger LOG
-
taskType
protected org.apache.syncope.common.lib.types.TaskType taskType
-
task
protected T extends org.apache.syncope.core.persistence.api.entity.task.SchedTask task
The actual task to be executed.
-
taskExecDAO
@Autowired protected org.apache.syncope.core.persistence.api.dao.TaskExecDAO taskExecDAO
Task execution DAO.
-
taskDAO
@Autowired protected org.apache.syncope.core.persistence.api.dao.TaskDAO taskDAO
Task DAO.
-
taskUtilsFactory
@Autowired protected org.apache.syncope.core.persistence.api.entity.task.TaskUtilsFactory taskUtilsFactory
-
taskDataBinder
@Autowired protected org.apache.syncope.core.provisioning.api.data.TaskDataBinder taskDataBinder
-
notificationManager
@Autowired protected org.apache.syncope.core.provisioning.api.notification.NotificationManager notificationManager
Notification manager.
-
auditManager
@Autowired protected org.apache.syncope.core.provisioning.api.AuditManager auditManager
Audit manager.
-
publisher
@Autowired protected org.springframework.context.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 interfaceorg.apache.syncope.core.provisioning.api.job.JobDelegate
-
isInterrupted
public boolean isInterrupted()
- Specified by:
isInterrupted
in interfaceorg.apache.syncope.core.provisioning.api.job.JobDelegate
-
execute
@Transactional public void execute(org.apache.syncope.common.lib.types.TaskType taskType, String taskKey, boolean dryRun, org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException
- Specified by:
execute
in interfaceorg.apache.syncope.core.provisioning.api.job.SchedTaskJobDelegate
- Throws:
org.quartz.JobExecutionException
-
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(org.apache.syncope.core.persistence.api.entity.task.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(org.apache.syncope.core.persistence.api.entity.task.TaskExec<?> execution)
-
-