Class ClusterSafeScheduledJobDao
- All Implemented Interfaces:
ScheduledJobDao
ScheduledJobDao, and is a stripped-down version of
CachedScheduledJobDao.
The job configuration functions remain intact (using Bandana), but the job status and history functions have been stubbed
out due to their non-performant implementations in CachedScheduledJobDao.
The job status and history functions, however, have been stubbed out, as their use required a distributed cache for consistency, but the performance was poor. Stubbing those functions out is the safer option, even though it effectively means that those functions are not available in the Scheduler Admin UI.
- Since:
- 5.6
-
Constructor Summary
Constructors -
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 job) 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.
-
Constructor Details
-
ClusterSafeScheduledJobDao
-
-
Method Details
-
getScheduledJobStatus
public @Nullable ScheduledJobStatus getScheduledJobStatus(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobDaoGets 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.- Specified by:
getScheduledJobStatusin interfaceScheduledJobDao- Parameters:
jobId- the job ID- Returns:
- null if the job does not exist, or the status has expired from the cache.
-
saveScheduledJobStatus
public void saveScheduledJobStatus(com.atlassian.scheduler.config.JobId jobId, ScheduledJobStatus status) Description copied from interface:ScheduledJobDaoStores the status for the specified job.- Specified by:
saveScheduledJobStatusin interfaceScheduledJobDao- Parameters:
jobId- the job IDstatus- stores the job status.
-
updateStatus
Description copied from interface:ScheduledJobDaoUpdates the status in the corresponding ScheduledJobStatus for the job.{link #saveScheduledJobStatus} should be called first, otherwise the update will be ignored.
- Specified by:
updateStatusin interfaceScheduledJobDao
-
addHistory
public void addHistory(com.atlassian.scheduler.config.JobId jobId, @Nullable ScheduledJobHistory history, Date nextOccurrence) Description copied from interface:ScheduledJobDaoAdds to an event to the history to the cache, and updates the nextOccurrence in the ScheduledJobStatus.- Specified by:
addHistoryin interfaceScheduledJobDao- Parameters:
jobId- the job IDhistory- the event that occurrednextOccurrence- the date that the job is expected to execute next
-
updateNextOccurrence
Description copied from interface:ScheduledJobDaoUpdates the nextOccurrence in the ScheduledJobStatus.- Specified by:
updateNextOccurrencein interfaceScheduledJobDao- Parameters:
jobId- the job IDnextOccurrence- the date that the job is expected to execute next
-
saveScheduledJobConfiguration
public void saveScheduledJobConfiguration(com.atlassian.scheduler.config.JobId jobId, ScheduledJobConfiguration job) Description copied from interface:ScheduledJobDaoStores the job configuration.- Specified by:
saveScheduledJobConfigurationin interfaceScheduledJobDao- Parameters:
jobId- the job IDjob- the configuration
-
getScheduledJobConfiguration
public @Nullable ScheduledJobConfiguration getScheduledJobConfiguration(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobDaoGets the job configuration for the specified job.- Specified by:
getScheduledJobConfigurationin interfaceScheduledJobDao- Parameters:
jobId- the job ID- Returns:
- null if not found.
-