Interface SchedulerService

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String JOB_FAILED  
      static java.lang.String SCHEDULER_STARTED
      This service will fire the following events : SCHEDULER_STARTED = "SCHEDULER_STARTED" SCHEDULER_STOPPED = "SCHEDULER_STOPPED" JOB_FAILED = "JOB_FAILED"
      static java.lang.String SCHEDULER_STOPPED  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean delete​(java.lang.String jobName)
      Deletes a job according to its name.
      void deleteJobs()
      Deletes all jobs.
      void executeAgain​(long jobDescriptorId, int delayInMillis)
      Execute a job again
      java.util.List<java.lang.String> getAllJobs()
      Get all jobs on all tenants \/!\Must be replaced by a platform scheduler/!\
      java.util.List<java.lang.String> getJobs()
      Get all jobs on the current tenant
      boolean isExistingJob​(java.lang.String jobName)
      Check if a job exists.
      boolean isStarted()
      Checks whether the service is started.
      boolean isStopped()
      Checks whether the service is shutdown.
      boolean mayFireAgain​(java.lang.String groupName, java.lang.String jobName)  
      void pauseJobs​(long tenantId)
      Pause all jobs running on the tenant
      void rescheduleErroneousTriggers()  
      java.util.Date rescheduleJob​(java.lang.String triggerName, java.lang.String groupName, java.util.Date triggerStartTime)
      Remove (delete) the Trigger with the given key, and store the new given one - which must be associated with the same job (the new trigger must have the job name & group specified) - however, the new trigger need not have the same name as the old trigger.
      void resumeJobs​(long tenantId)
      Resume all jobs paused on the tenant
      void retryJobThatFailed​(long jobDescriptorId)
      Retry a job once In addition to executing the job again, this will also delete failed job logs
      void retryJobThatFailed​(long jobDescriptorId, java.util.List<SJobParameter> parameters)
      Change parameters of a job and retry it once In addition to executing the job again, this will also delete failed job logs
      void schedule​(SJobDescriptor jobDescriptor, java.util.List<SJobParameter> parameters, Trigger trigger)
      Schedules a job.
      void schedule​(SJobDescriptor jobDescriptor, Trigger trigger)
      Schedules a job.
      void start()
      Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.
      void stop()
      Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.
    • Field Detail

      • SCHEDULER_STARTED

        static final java.lang.String SCHEDULER_STARTED
        This service will fire the following events :
        • SCHEDULER_STARTED = "SCHEDULER_STARTED"
        • SCHEDULER_STOPPED = "SCHEDULER_STOPPED"
        • JOB_FAILED = "JOB_FAILED"
        See Also:
        Constant Field Values
    • Method Detail

      • isStarted

        boolean isStarted()
                   throws SSchedulerException
        Checks whether the service is started.
        Returns:
        true if the service is started; false otherwise.
        Throws:
        SSchedulerException - if an exception occurs.
      • executeAgain

        void executeAgain​(long jobDescriptorId,
                          int delayInMillis)
                   throws SSchedulerException
        Execute a job again
        Parameters:
        jobDescriptorId - the job to re execute
        delayInMillis -
        Throws:
        SSchedulerException
      • retryJobThatFailed

        void retryJobThatFailed​(long jobDescriptorId)
                         throws SSchedulerException
        Retry a job once In addition to executing the job again, this will also delete failed job logs
        Parameters:
        jobDescriptorId - the job to retry
        Throws:
        SSchedulerException
      • retryJobThatFailed

        void retryJobThatFailed​(long jobDescriptorId,
                                java.util.List<SJobParameter> parameters)
                         throws SSchedulerException
        Change parameters of a job and retry it once In addition to executing the job again, this will also delete failed job logs
        Parameters:
        jobDescriptorId - the job to retry
        parameters - the new parameters for the job
        Throws:
        SSchedulerException
      • delete

        boolean delete​(java.lang.String jobName)
                throws SSchedulerException
        Deletes a job according to its name.
        Parameters:
        jobName - the job name
        Returns:
        true if delete a job, otherwise return false.
        Throws:
        SSchedulerException - if an exception occurs.
      • getJobs

        java.util.List<java.lang.String> getJobs()
                                          throws SSchedulerException
        Get all jobs on the current tenant
        Returns:
        all jobs on the current tenant
        Throws:
        SSchedulerException - if an exception occurs.
      • getAllJobs

        java.util.List<java.lang.String> getAllJobs()
                                             throws SSchedulerException
        Get all jobs on all tenants \/!\Must be replaced by a platform scheduler/!\
        Returns:
        all jobs on the current tenant
        Throws:
        SSchedulerException - if an exception occurs.
      • rescheduleJob

        java.util.Date rescheduleJob​(java.lang.String triggerName,
                                     java.lang.String groupName,
                                     java.util.Date triggerStartTime)
                              throws SSchedulerException
        Remove (delete) the Trigger with the given key, and store the new given one - which must be associated with the same job (the new trigger must have the job name & group specified) - however, the new trigger need not have the same name as the old trigger.
        Parameters:
        triggerName - The name of the trigger to replace
        groupName - The group name of the trigger to replace
        triggerStartTime - The start date of the new trigger
        Returns:
        null if a Trigger with the given name & group was not found and removed from the store (and the new trigger is therefore not stored), otherwise the first fire time of the newly scheduled trigger is returned.
        Throws:
        SSchedulerException
        Since:
        6.4.0
      • isExistingJob

        boolean isExistingJob​(java.lang.String jobName)
                       throws SSchedulerException
        Check if a job exists.
        Parameters:
        jobName - The name of the job
        Returns:
        True if the job exists, else False.
        Throws:
        SSchedulerException
        Since:
        6.4.0