View Javadoc

1   package com.atlassian.sal.api.scheduling;
2   
3   import java.util.Date;
4   import java.util.Map;
5   
6   /**
7    * Interface for scheduling jobs
8    *
9    * @since 2.0
10   * @deprecated in 3.0 for removal in 4.0. Use Atlassian Scheduler instead
11   */
12  @Deprecated
13  public interface PluginScheduler {
14      /**
15       * Schedule the given job.
16       *
17       * <p> <strong>WARNING</strong>: it is very important not to try to call this method until the underlying application
18       * is fully started. You should implement {@link com.atlassian.sal.api.lifecycle.LifecycleAware} and call scheduleJob()
19       * only on {@link com.atlassian.sal.api.lifecycle.LifecycleAware#onStart()}
20       *
21       * @param jobKey         A unique key of the job
22       * @param jobClass       The class for the job
23       * @param jobDataMap     Any data that needs to be passed to the job.  This map instance will always be the same
24       *                       instance that is given to the job when it executes.
25       * @param startTime      The time the job is to start.
26       * @param repeatInterval How long the interval between repeats, in milliseconds.  Note, some implementations
27       */
28      void scheduleJob(String jobKey,
29                       Class<? extends PluginJob> jobClass, Map<String, Object> jobDataMap,
30                       Date startTime, long repeatInterval);
31  
32      /**
33       * Unschedule the given job. If the job doesn't exist then IllegalArgumentException will be thrown.
34       *
35       * @param jobKey The job key to unschedule
36       * @throws IllegalArgumentException If the job doesn't exist thus cannot be unscheduled.
37       */
38      void unscheduleJob(String jobKey);
39  }