Interface JobScheduleManager


  • public interface JobScheduleManager
    Manage scheduling jobs
    Since:
    7/26/17
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void afterExecution​(PreparedExecutionReference execution, java.util.Map<java.lang.String,​java.lang.Object> jobDataMap, com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContext authContext)
      Post-run hook after a job/adhoc is executed
      default JobScheduleManager.BeforeExecutionBehavior beforeExecution​(PreparedExecutionReference execution, java.util.Map<java.lang.String,​java.lang.Object> jobDataMap, com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContext authContext)
      Pre-run hook before a Job/adhoc is executed
      void deleteJobSchedule​(java.lang.String quartzJobName, java.lang.String quartzJobGroup)
      Delete a name/group from the scheduler
      java.lang.String determineExecNode​(JobReference job)
      Return the uuid of the node that will execute the scheduled execution.
      java.util.Date reschedulePendingJob​(java.lang.String quartzJobName, java.lang.String quartzJobGroup)
      Schedule a job that was previously scheduled as pending
      java.util.Date scheduleJob​(java.lang.String quartzJobName, java.lang.String quartzJobGroup, java.util.Map data, java.util.Date atTime, boolean pending)
      Schedule a job for a certain time
      boolean scheduleJobNow​(java.lang.String quartzJobName, java.lang.String quartzJobGroup, java.util.Map data, boolean pending)
      Schedule a job to run now
      default boolean scheduleRemoteJob​(java.util.Map data)
      Schedule a job to run later
      boolean tryAcquireExecCleanerJob​(java.lang.String uuid, java.lang.String project)
      Tries to acquire the history cleaner ownership (only acquired if the owner of the job is dead)
      boolean updateScheduleOwner​(JobReference data)
      In cluster mode, return true if the scheduleOWner should change to current node.
    • Method Detail

      • deleteJobSchedule

        void deleteJobSchedule​(java.lang.String quartzJobName,
                               java.lang.String quartzJobGroup)
        Delete a name/group from the scheduler
        Parameters:
        quartzJobName - QUARTZ job name
        quartzJobGroup - QUARTZ group name
      • scheduleJob

        java.util.Date scheduleJob​(java.lang.String quartzJobName,
                                   java.lang.String quartzJobGroup,
                                   java.util.Map data,
                                   java.util.Date atTime,
                                   boolean pending)
                            throws JobScheduleFailure
        Schedule a job for a certain time
        Parameters:
        quartzJobName - QUARTZ job name
        quartzJobGroup - QUARTZ group name
        data - data
        atTime - time to run
        pending - if job should be in a pending state
        Returns:
        time to run
        Throws:
        JobScheduleFailure
      • scheduleJobNow

        boolean scheduleJobNow​(java.lang.String quartzJobName,
                               java.lang.String quartzJobGroup,
                               java.util.Map data,
                               boolean pending)
                        throws JobScheduleFailure
        Schedule a job to run now
        Parameters:
        quartzJobName - QUARTZ job name
        quartzJobGroup - QUARTZ group name
        data - data
        pending - if job should be scheduled in a pending state
        Returns:
        true if successful
        Throws:
        JobScheduleFailure
      • reschedulePendingJob

        java.util.Date reschedulePendingJob​(java.lang.String quartzJobName,
                                            java.lang.String quartzJobGroup)
                                     throws JobScheduleFailure
        Schedule a job that was previously scheduled as pending
        Parameters:
        quartzJobName - job name
        quartzJobGroup - job group
        Returns:
        time to run
        Throws:
        JobScheduleFailure
      • updateScheduleOwner

        boolean updateScheduleOwner​(JobReference data)
        In cluster mode, return true if the scheduleOWner should change to current node.
        Parameters:
        data - map with job information, jobid and current schedule owner.
        Returns:
        true if the scheduleOWner should change to current node.
      • determineExecNode

        java.lang.String determineExecNode​(JobReference job)
        Return the uuid of the node that will execute the scheduled execution.
        Parameters:
        name - job name
        group - job group
        data - map with job informations.
        project - projectName
        Returns:
        uuid of node for the scheduled execution
      • tryAcquireExecCleanerJob

        boolean tryAcquireExecCleanerJob​(java.lang.String uuid,
                                         java.lang.String project)
        Tries to acquire the history cleaner ownership (only acquired if the owner of the job is dead)
        Parameters:
        uuid - of the server that is trying to acquire ownership
        project - the project where the job runs
        Returns:
        true if the ownership was aquired
      • scheduleRemoteJob

        default boolean scheduleRemoteJob​(java.util.Map data)
        Schedule a job to run later
        Parameters:
        data - dataRundeckproClusterGrailsPlugin
        Returns:
        true if successful
      • beforeExecution

        default JobScheduleManager.BeforeExecutionBehavior beforeExecution​(PreparedExecutionReference execution,
                                                                           java.util.Map<java.lang.String,​java.lang.Object> jobDataMap,
                                                                           com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContext authContext)
        Pre-run hook before a Job/adhoc is executed
        Parameters:
        execution - execution detail
        Returns:
        proceed or skip
      • afterExecution

        default void afterExecution​(PreparedExecutionReference execution,
                                    java.util.Map<java.lang.String,​java.lang.Object> jobDataMap,
                                    com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContext authContext)
        Post-run hook after a job/adhoc is executed
        Parameters:
        execution - execution detail