View Javadoc

1   package com.atlassian.scheduler;
2   
3   import com.atlassian.annotations.PublicApi;
4   import com.atlassian.scheduler.config.JobId;
5   import com.atlassian.scheduler.status.RunDetails;
6   
7   import javax.annotation.CheckForNull;
8   
9   /**
10   * Allows you to retrieve data about previous runs of a job.
11   */
12  @PublicApi
13  public interface SchedulerHistoryService {
14      /**
15       * Returns the result of the most recent attempt to run this job.
16       *
17       * @param jobId the job ID of interest
18       * @return the result information for the most recent run attempt, or {@code null} if there
19       * is no recorded run history for this job
20       */
21      @CheckForNull
22      RunDetails getLastRunForJob(JobId jobId);
23  
24      /**
25       * Returns the result of the most recent successful run of this job.
26       *
27       * @param jobId the job ID of interest
28       * @return the result information for the most recent run attempt, or {@code null} if there
29       * is no successful result recorded for this job
30       */
31      @CheckForNull
32      RunDetails getLastSuccessfulRunForJob(JobId jobId);
33  }