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 theSchedulerRunDetailsManagerinterface. It mostly delegates the work to theInternalRunDetailsDaoobject.- Since:
- 6.4.3
-
-
Field Summary
-
Fields inherited from interface com.atlassian.confluence.schedule.managers.SchedulerRunDetailsManager
ALL_JOBS_TTL_MILLIS, UNSUCCESSFUL_JOBS_TTL_MILLIS
-
-
Constructor Summary
Constructors Constructor Description DefaultSchedulerRunDetailsManager(InternalRunDetailsDao internalRunDetailsDao, com.atlassian.scheduler.SchedulerService schedulerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.atlassian.scheduler.status.RunDetailsaddRunDetails(com.atlassian.scheduler.config.JobId jobId, Date startedAt, com.atlassian.scheduler.status.RunOutcome runOutcome, @Nullable String message)Delegates the task to the underlying Scheduler Service since the ConfluenceSchedulerService bean is not accessible from the add-onlongcount(com.atlassian.scheduler.config.JobId jobId, long timeToLiveThreshold, com.atlassian.scheduler.status.RunOutcome runOutcome)Count the job's run details that are stored before a time-to-live threshold in millisecondsorg.apache.commons.lang3.tuple.Pair<Integer,Integer>purgeOldRunDetails()This method purges the old run details, i.e.
-
-
-
Constructor Detail
-
DefaultSchedulerRunDetailsManager
public DefaultSchedulerRunDetailsManager(InternalRunDetailsDao internalRunDetailsDao, com.atlassian.scheduler.SchedulerService schedulerService)
-
-
Method Detail
-
purgeOldRunDetails
public org.apache.commons.lang3.tuple.Pair<Integer,Integer> purgeOldRunDetails()
Description copied from interface:SchedulerRunDetailsManagerThis method purges the old run details, i.e. beforeor DefaultSchedulerRunDetailsManager#UNSUCCESSFUL_JOBS_TTL_MILLISThis 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:
purgeOldRunDetailsin interfaceSchedulerRunDetailsManager- 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:SchedulerRunDetailsManagerCount the job's run details that are stored before a time-to-live threshold in milliseconds- Specified by:
countin interfaceSchedulerRunDetailsManagertimeToLiveThreshold- the TTL thresholdrunOutcome- 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:SchedulerRunDetailsManagerDelegates the task to the underlying Scheduler Service since the ConfluenceSchedulerService bean is not accessible from the add-on- Specified by:
addRunDetailsin interfaceSchedulerRunDetailsManager- Parameters:
jobId- the Job IDstartedAt- when the job is startedrunOutcome- the run outcomemessage- the message
-
-