Class AbstractSchedTaskJobDelegate<T extends org.apache.syncope.core.persistence.api.entity.task.SchedTask>

    • 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 SecurityProperties securityProperties  
      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  
      • Fields inherited from interface org.apache.syncope.core.provisioning.api.job.JobDelegate

        OPERATION_ID
    • 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
    • Constructor Detail

      • AbstractSchedTaskJobDelegate

        public AbstractSchedTaskJobDelegate()
    • Method Detail

      • setStatus

        protected void setStatus​(String status)
      • interrupt

        public void interrupt()
        Specified by:
        interrupt in interface org.apache.syncope.core.provisioning.api.job.JobDelegate
      • isInterrupted

        public boolean isInterrupted()
        Specified by:
        isInterrupted in interface org.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 interface org.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 data
        executor - the user executing this task
        context - 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)