Interface SchedulesManager


  • public interface SchedulesManager
    Manage jobs schedules
    Since:
    12/16/19
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.util.Map<java.lang.String,​java.util.Date> bulkNextExecutionTime​(java.lang.String project, java.util.List<java.lang.String> jobUuids)
      Return the calculated next execution time for the given job uuids in a project.
      TriggerBuilderHelper createTriggerBuilder​(java.lang.String jobUUID, java.lang.String cronExpression, java.lang.String triggerName)
      It creates a job trigger
      TriggerBuilderHelper createTriggerBuilder​(java.lang.String jobName, java.lang.String jobGroup, java.lang.String cronExpression, int priority)
      It creates a job trigger
      java.util.List getAllScheduled​(java.lang.String serverUUID, java.lang.String project)
      list scheduled jobs which match the given serverUUID, or all jobs if it is null.
      java.util.List getJobsWithAdhocScheduledExecutionsToClaim​(java.lang.String toServerUUID, java.lang.String fromServerUUID, boolean selectAll, java.lang.String projectFilter)
      Gets a list of scheduled jobs with adhoc scheduled executions
      java.util.List getSchedulesJobToClaim​(java.lang.String toServerUUID, java.lang.String fromServerUUID, boolean selectAll, java.lang.String projectFilter, java.util.List<java.lang.String> jobids)
      Gets a list of scheduled executions
      java.util.Map handleScheduleDefinitions​(java.lang.String jobUUID, boolean isUpdate)
      It handles the cleaning of no longer associated schedule definitions and triggers the new ones
      default boolean hasExtendedScheduling()
      Returns true if extended scheduling features are installed
      boolean isScheduled​(java.lang.String uuid)
      Returns true if the job is set to schedule
      java.util.List<java.util.Date> nextExecutions​(java.lang.String jobUuid, java.util.Date to, boolean past)
      Returns a list of dates in a time lapse between now and the to Date.
      java.util.Date nextExecutionTime​(java.lang.String jobUUID, boolean require)
      Return the next scheduled or predicted execution time for the scheduled job, and if it is not scheduled return a time in the future.
      boolean shouldScheduleExecution​(java.lang.String uuid)
      Returns true if the job should be scheduled either by its own schedule or by an schedule definition
    • Method Detail

      • handleScheduleDefinitions

        java.util.Map handleScheduleDefinitions​(java.lang.String jobUUID,
                                                boolean isUpdate)
        It handles the cleaning of no longer associated schedule definitions and triggers the new ones
        Parameters:
        jobUUID -
        isUpdate - it forces to recreate the job trigger
        Returns:
        boolean it returns true if at least one job was scheduled
      • createTriggerBuilder

        TriggerBuilderHelper createTriggerBuilder​(java.lang.String jobName,
                                                  java.lang.String jobGroup,
                                                  java.lang.String cronExpression,
                                                  int priority)
        It creates a job trigger
        Parameters:
        jobName -
        jobGroup -
        cronExpression -
        priority -
      • createTriggerBuilder

        TriggerBuilderHelper createTriggerBuilder​(java.lang.String jobUUID,
                                                  java.lang.String cronExpression,
                                                  java.lang.String triggerName)
        It creates a job trigger
        Parameters:
        jobUUID -
        cronExpression -
        triggerName -
      • nextExecutionTime

        java.util.Date nextExecutionTime​(java.lang.String jobUUID,
                                         boolean require)
        Return the next scheduled or predicted execution time for the scheduled job, and if it is not scheduled return a time in the future. If the job is not scheduled on the current server (cluster mode), returns the time that the job is expected to run on its configured server.
        Parameters:
        jobUUID -
        require -
        Returns:
        Date
      • bulkNextExecutionTime

        default java.util.Map<java.lang.String,​java.util.Date> bulkNextExecutionTime​(java.lang.String project,
                                                                                           java.util.List<java.lang.String> jobUuids)
        Return the calculated next execution time for the given job uuids in a project. If the job is not owned by the project the schedule time will not be calculated.
        Parameters:
        project - Project that owns the jobs
        jobUuids - A list of job uuids
        Returns:
        a map with the job uuid as the key and it's next execution time as the value
      • hasExtendedScheduling

        default boolean hasExtendedScheduling()
        Returns true if extended scheduling features are installed
        Returns:
        boolean
      • isScheduled

        boolean isScheduled​(java.lang.String uuid)
        Returns true if the job is set to schedule
        Parameters:
        uuid -
        Returns:
        boolean
      • getAllScheduled

        java.util.List getAllScheduled​(java.lang.String serverUUID,
                                       java.lang.String project)
        list scheduled jobs which match the given serverUUID, or all jobs if it is null.
        Parameters:
        serverUUID -
        project -
        Returns:
      • shouldScheduleExecution

        boolean shouldScheduleExecution​(java.lang.String uuid)
        Returns true if the job should be scheduled either by its own schedule or by an schedule definition
        Parameters:
        uuid -
        Returns:
        boolean
      • getSchedulesJobToClaim

        java.util.List getSchedulesJobToClaim​(java.lang.String toServerUUID,
                                              java.lang.String fromServerUUID,
                                              boolean selectAll,
                                              java.lang.String projectFilter,
                                              java.util.List<java.lang.String> jobids)
        Gets a list of scheduled executions
        Parameters:
        toServerUUID -
        fromServerUUID -
        selectAll -
        projectFilter -
        jobids -
        Returns:
        List
      • getJobsWithAdhocScheduledExecutionsToClaim

        java.util.List getJobsWithAdhocScheduledExecutionsToClaim​(java.lang.String toServerUUID,
                                                                  java.lang.String fromServerUUID,
                                                                  boolean selectAll,
                                                                  java.lang.String projectFilter)
        Gets a list of scheduled jobs with adhoc scheduled executions
        Parameters:
        toServerUUID -
        fromServerUUID -
        selectAll -
        projectFilter -
        Returns:
      • nextExecutions

        java.util.List<java.util.Date> nextExecutions​(java.lang.String jobUuid,
                                                      java.util.Date to,
                                                      boolean past)
        Returns a list of dates in a time lapse between now and the to Date.
        Parameters:
        jobUuid -
        to - Date in the future
        past - It will be used to calculate to current date
        Returns:
        list of dates