Interface ScheduleService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addJob​(JobEntry je)
      Add a new job to the queue.
      JobEntry getJob​(int oid)
      Get a specific Job from Storage.
      boolean isEnabled()
      Determines if the scheduler service is currently active.
      List<? extends JobEntry> listJobs()
      List jobs in the queue.
      JobEntry newJob​(int sec, int min, int hour, int wd, int day_mo, String task)
      Factory method for a new Job Schedule a job to run on a certain point of time.
      Example 1: Run the DefaultScheduledJob at 8:00am every 15th of the month -
      JobEntry je = newJob(0,0,8,-1,15,"DefaultScheduledJob");
      Example 2: Run the DefaultScheduledJob at 8:00am every day -
      JobEntry je = newJob(0,0,8,-1,-1,"DefaultScheduledJob");
      Example 3: Run the DefaultScheduledJob every 2 hours. -
      JobEntry je = newJob(0,120,-1,-1,-1,"DefaultScheduledJob");
      Example 4: Run the DefaultScheduledJob every 30 seconds. -
      JobEntry je = newJob(30,-1,-1,-1,-1,"DefaultScheduledJob");
      void removeJob​(JobEntry je)
      Remove a job from the queue.
      void startScheduler()
      Starts the scheduler if not already running.
      void stopScheduler()
      Stops the scheduler if ti is currently running.
      void updateJob​(JobEntry je)
      Modify a Job.
    • Method Detail

      • newJob

        JobEntry newJob​(int sec,
                        int min,
                        int hour,
                        int wd,
                        int day_mo,
                        String task)
                 throws TurbineException
        Factory method for a new Job Schedule a job to run on a certain point of time.
        Example 1: Run the DefaultScheduledJob at 8:00am every 15th of the month -
        JobEntry je = newJob(0,0,8,-1,15,"DefaultScheduledJob");
        Example 2: Run the DefaultScheduledJob at 8:00am every day -
        JobEntry je = newJob(0,0,8,-1,-1,"DefaultScheduledJob");
        Example 3: Run the DefaultScheduledJob every 2 hours. -
        JobEntry je = newJob(0,120,-1,-1,-1,"DefaultScheduledJob");
        Example 4: Run the DefaultScheduledJob every 30 seconds. -
        JobEntry je = newJob(30,-1,-1,-1,-1,"DefaultScheduledJob");
        Parameters:
        sec - Value for entry "seconds".
        min - Value for entry "minutes".
        hour - Value for entry "hours".
        wd - Value for entry "week days".
        day_mo - Value for entry "month days".
        task - Task to execute.
        Returns:
        A JobEntry.
        Throws:
        TurbineException - could not create job
      • listJobs

        List<? extends JobEntrylistJobs()
        List jobs in the queue. This is used by the scheduler UI.
        Returns:
        A List of jobs.
      • isEnabled

        boolean isEnabled()
        Determines if the scheduler service is currently active.
        Returns:
        Status of the scheduler service.
      • startScheduler

        void startScheduler()
        Starts the scheduler if not already running.
      • stopScheduler

        void stopScheduler()
        Stops the scheduler if ti is currently running.