Interface ScheduledJobDao
- All Known Implementing Classes:
CachedScheduledJobDao,ClusterSafeScheduledJobDao
public interface ScheduledJobDao
Provides the DAO for storing the various scheduled job objects.
Persistence may be in memory, local cache, clustered cache or to a persistent store.
Intended storage (see implementations):
- ScheduledJobStatus - memory / cache (runtime only)
- ExecutionStatus - memory / cache (runtime only)
- ScheduledJobHistory - persistent store and memory / cache
- ScheduledJobConfiguration - memory / cache (runtime only)
- Default Cron Configuration - (sourced from spring/plugin) - memory / cache (runtime only)
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddHistory(com.atlassian.scheduler.config.JobId jobId, @Nullable ScheduledJobHistory history, Date nextOccurrence) Adds to an event to the history to the cache, and updates the nextOccurrence in the ScheduledJobStatus.@Nullable ScheduledJobConfigurationgetScheduledJobConfiguration(com.atlassian.scheduler.config.JobId jobId) Gets the job configuration for the specified job.@Nullable ScheduledJobStatusgetScheduledJobStatus(com.atlassian.scheduler.config.JobId jobId) Gets the specified job's status.voidsaveScheduledJobConfiguration(com.atlassian.scheduler.config.JobId jobId, ScheduledJobConfiguration jobConfiguration) Stores the job configuration.voidsaveScheduledJobStatus(com.atlassian.scheduler.config.JobId jobId, ScheduledJobStatus status) Stores the status for the specified job.voidupdateNextOccurrence(com.atlassian.scheduler.config.JobId jobId, Date nextOccurrence) Updates the nextOccurrence in the ScheduledJobStatus.voidupdateStatus(com.atlassian.scheduler.config.JobId jobId, ExecutionStatus status) Updates the status in the corresponding ScheduledJobStatus for the job.
-
Method Details
-
getScheduledJobStatus
Gets the specified job's status.It's recommended that
ScheduledJobStatusManagerbe used for access to a job's status, rather than this call directly. The manager handles cache expiry automatically.- Parameters:
jobId- the job ID- Returns:
- null if the job does not exist, or the status has expired from the cache.
-
saveScheduledJobStatus
Stores the status for the specified job.- Parameters:
jobId- the job IDstatus- stores the job status.
-
updateStatus
Updates the status in the corresponding ScheduledJobStatus for the job.{link #saveScheduledJobStatus} should be called first, otherwise the update will be ignored.
-
addHistory
void addHistory(com.atlassian.scheduler.config.JobId jobId, @Nullable ScheduledJobHistory history, Date nextOccurrence) Adds to an event to the history to the cache, and updates the nextOccurrence in the ScheduledJobStatus.- Parameters:
jobId- the job IDhistory- the event that occurrednextOccurrence- the date that the job is expected to execute next
-
updateNextOccurrence
Updates the nextOccurrence in the ScheduledJobStatus.- Parameters:
jobId- the job IDnextOccurrence- the date that the job is expected to execute next
-
saveScheduledJobConfiguration
void saveScheduledJobConfiguration(com.atlassian.scheduler.config.JobId jobId, ScheduledJobConfiguration jobConfiguration) Stores the job configuration.- Parameters:
jobId- the job IDjobConfiguration- the configuration
-
getScheduledJobConfiguration
@Nullable ScheduledJobConfiguration getScheduledJobConfiguration(com.atlassian.scheduler.config.JobId jobId) Gets the job configuration for the specified job.- Parameters:
jobId- the job ID- Returns:
- null if not found.
-