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      /**
16       * Schedule the given job.
17       *
18       * <p> <strong>WARNING</strong>: it is very important not to try to call this method until the underlying application
19       * is fully started. You should implement {@link com.atlassian.sal.api.lifecycle.LifecycleAware} and call scheduleJob()
20       * only on {@link com.atlassian.sal.api.lifecycle.LifecycleAware#onStart()}
21       *
22       * @param jobKey         A unique key of the job
23       * @param jobClass       The class for the job
24       * @param jobDataMap     Any data that needs to be passed to the job.  This map instance will always be the same
25       *                       instance that is given to the job when it executes.
26       * @param startTime      The time the job is to start.
27       * @param repeatInterval How long the interval between repeats, in milliseconds.  Note, some implementations
28       */
29      void scheduleJob(String jobKey,
30                       Class<? extends PluginJob> jobClass, Map<String, Object> jobDataMap,
31                       Date startTime, long repeatInterval);
32  
33      /**
34       * Unschedule the given job. If the job doesn't exist then IllegalArgumentException will be thrown.
35       *
36       * @param jobKey The job key to unschedule
37       * @throws  IllegalArgumentException If the job doesn't exist thus cannot be unscheduled.
38       */
39      void unscheduleJob(String jobKey);
40  }