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
-
Field Summary
Fields inherited from interface com.atlassian.confluence.schedule.managers.SchedulerRunDetailsManager
ALL_JOBS_TTL_MILLIS, UNSUCCESSFUL_JOBS_TTL_MILLIS
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSchedulerRunDetailsManager
(InternalRunDetailsDao internalRunDetailsDao, com.atlassian.scheduler.SchedulerService schedulerService) -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.scheduler.status.RunDetails
addRunDetails
(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-onlong
count
(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 millisecondsThis method purges the old run details, i.e.
-
Constructor Details
-
DefaultSchedulerRunDetailsManager
public DefaultSchedulerRunDetailsManager(InternalRunDetailsDao internalRunDetailsDao, com.atlassian.scheduler.SchedulerService schedulerService)
-
-
Method Details
-
purgeOldRunDetails
Description copied from interface:SchedulerRunDetailsManager
This method purges the old run details, i.e. beforeor 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 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:SchedulerRunDetailsManager
Count the job's run details that are stored before a time-to-live threshold in milliseconds- Specified by:
count
in interfaceSchedulerRunDetailsManager
timeToLiveThreshold
- 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:SchedulerRunDetailsManager
Delegates the task to the underlying Scheduler Service since the ConfluenceSchedulerService bean is not accessible from the add-on- Specified by:
addRunDetails
in interfaceSchedulerRunDetailsManager
- Parameters:
jobId
- the Job IDstartedAt
- when the job is startedrunOutcome
- the run outcomemessage
- the message
-