View Javadoc

1   package com.atlassian.scheduler.status;
2   
3   import com.atlassian.annotations.PublicApi;
4   import com.atlassian.scheduler.JobRunnerResponse;
5   import com.atlassian.scheduler.config.RunMode;
6   
7   /**
8    * Indicates what the result was the last time that this job attempted to fire.
9    */
10  @PublicApi
11  public enum RunOutcome {
12      /**
13       * The job ran {@link JobRunnerResponse#success() successfully}.
14       */
15      SUCCESS,
16  
17      /**
18       * The job had no job runner registered when an attempt was made to fire it.
19       * <p>
20       * This likely means that the job is left over from an older version of the
21       * application or from an add-on that is no longer installed.
22       * </p><p>
23       * <strong>Note</strong>: This outcome is only produced by the scheduler
24       * implementations; it cannot be returned in a {@link JobRunnerResponse}.
25       * </p>
26       */
27      UNAVAILABLE,
28  
29      /**
30       * We did not start the job at the scheduled time because it was not ready.
31       * <p>
32       * Some possible causes include:
33       * </p>
34       * <ul>
35       * <li>No job details could be found for that job ID.  It is possible that the
36       * job was deleted right as it was scheduled to run.</li>
37       * <li>The parameter map could not be reconstructed from its serialized form</li>
38       * <li>The job has been registered with inconsistent run modes, probably with this
39       * node using {@link RunMode#RUN_LOCALLY} and another node registering afterwards
40       * using {@link RunMode#RUN_ONCE_PER_CLUSTER}</li>
41       * <li>The job performed its own checks and explicitly returned a {@link JobRunnerResponse}
42       * that indicated the job had been {@link JobRunnerResponse#aborted(String) aborted}.</li>
43       * </ul>
44       */
45      ABORTED,
46  
47      /**
48       * The job was started but it either threw an exception or returned a {@link JobRunnerResponse}
49       * that indicated the job had {@link JobRunnerResponse#failed(String) failed}.
50       */
51      FAILED
52  }