Class AbstractSchedTaskJobDelegate
- java.lang.Object
-
- org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate
-
- 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 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 org.apache.syncope.core.persistence.api.entity.EntityFactory
entityFactory
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 AtomicReference<String>
status
protected org.apache.syncope.core.persistence.api.entity.task.SchedTask
task
The actual task to be executed.protected org.apache.syncope.core.persistence.api.dao.TaskDAO
taskDAO
Task DAO.protected org.apache.syncope.core.persistence.api.dao.TaskExecDAO
taskExecDAO
Task execution DAO.
-
Constructor Summary
Constructors Constructor Description AbstractSchedTaskJobDelegate()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
currentStatus()
protected abstract String
doExecute(boolean dryRun, String executor, org.quartz.JobExecutionContext context)
The actual execution, delegated to child classes.void
execute(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)
-
-
-
Field Detail
-
LOG
protected static final org.slf4j.Logger LOG
-
task
protected 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.
-
entityFactory
@Autowired protected org.apache.syncope.core.persistence.api.entity.EntityFactory entityFactory
-
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.
-
status
protected final AtomicReference<String> status
-
interrupt
protected boolean interrupt
-
interrupted
protected boolean interrupted
-
-
Method Detail
-
currentStatus
public String currentStatus()
- Specified by:
currentStatus
in interfaceorg.apache.syncope.core.provisioning.api.job.JobDelegate
-
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(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)
-
-