Class DefaultSchedulerRunDetailsManager

java.lang.Object
com.atlassian.confluence.schedule.managers.DefaultSchedulerRunDetailsManager
All Implemented Interfaces:
SchedulerRunDetailsManager

@Internal public class DefaultSchedulerRunDetailsManager extends Object implements SchedulerRunDetailsManager
The default implementation of the SchedulerRunDetailsManager interface. It mostly delegates the work to the InternalRunDetailsDao object.
Since:
6.4.3
  • Constructor Details

    • DefaultSchedulerRunDetailsManager

      public DefaultSchedulerRunDetailsManager(InternalRunDetailsDao internalRunDetailsDao, com.atlassian.scheduler.SchedulerService schedulerService)
  • Method Details

    • purgeOldRunDetails

      public org.apache.commons.lang3.tuple.Pair<Integer,Integer> purgeOldRunDetails()
      Description copied from interface: SchedulerRunDetailsManager
      This method purges the old run details, i.e. before or DefaultSchedulerRunDetailsManager#UNSUCCESSFUL_JOBS_TTL_MILLIS This prevents the table space from growing without bounds, and it is unlikely that you really care about the results of a scheduled job that hasn't run in that long, anyway.
      Specified by:
      purgeOldRunDetails in interface SchedulerRunDetailsManager
      Returns:
      a Pair in which the left value is the number of total records purged and the right values is the number of batches
    • count

      public long count(com.atlassian.scheduler.config.JobId jobId, long timeToLiveThreshold, com.atlassian.scheduler.status.RunOutcome runOutcome)
      Description copied from interface: SchedulerRunDetailsManager
      Count the job's run details that are stored before a time-to-live threshold in milliseconds
      Specified by:
      count in interface SchedulerRunDetailsManager
      timeToLiveThreshold - the TTL threshold
      runOutcome - the run outcome that should be matched
      Returns:
      the total count of job runs that satisfies the timeToLiveThreshold
    • addRunDetails

      public com.atlassian.scheduler.status.RunDetails addRunDetails(com.atlassian.scheduler.config.JobId jobId, Date startedAt, com.atlassian.scheduler.status.RunOutcome runOutcome, @Nullable String message)
      Description copied from interface: SchedulerRunDetailsManager
      Delegates the task to the underlying Scheduler Service since the ConfluenceSchedulerService bean is not accessible from the add-on
      Specified by:
      addRunDetails in interface SchedulerRunDetailsManager
      Parameters:
      jobId - the Job ID
      startedAt - when the job is started
      runOutcome - the run outcome
      message - the message