@Internal public class ClusterSafeScheduledJobDao extends Object implements 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 consistentcy, 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.
Constructor and Description |
---|
ClusterSafeScheduledJobDao(com.atlassian.bandana.BandanaManager bandanaManager) |
Modifier and Type | Method and Description |
---|---|
void |
addHistory(ScheduledJobKey key,
ScheduledJobHistory history,
Date nextOccurrence)
Adds to an event to the history to the cache, and updates the nextOccurrence in the ScheduledJobStatus.
|
ScheduledJobConfiguration |
getScheduledJobConfiguration(ScheduledJobKey key)
Gets the job configuration for the specified job.
|
ScheduledJobStatus |
getScheduledJobStatus(ScheduledJobKey key)
Gets the specified job's status.
|
void |
saveScheduledJobConfiguration(ScheduledJobKey key,
ScheduledJobConfiguration job)
Stores the job configuration.
|
void |
saveScheduledJobStatus(ScheduledJobKey key,
ScheduledJobStatus status)
Stores the status for the specified job.
|
void |
updateNextOccurence(ScheduledJobKey key,
Date nextOccurence)
Updates the nextOccurence in the ScheduledJobStatus.
|
void |
updateStatus(ScheduledJobKey key,
ExecutionStatus status)
Updates the status in the corresponding ScheduledJobStatus for the job.
|
public ClusterSafeScheduledJobDao(com.atlassian.bandana.BandanaManager bandanaManager)
@Nullable public ScheduledJobStatus getScheduledJobStatus(ScheduledJobKey key)
ScheduledJobDao
It's recommended that ScheduleJobStatusManager
be used for
access to a job's status, rather than this call directly. The manager handles cache expiry automatically.
getScheduledJobStatus
in interface ScheduledJobDao
key
- the job keypublic void saveScheduledJobStatus(ScheduledJobKey key, ScheduledJobStatus status)
ScheduledJobDao
saveScheduledJobStatus
in interface ScheduledJobDao
key
- the job keystatus
- stores the job status.public void updateStatus(ScheduledJobKey key, ExecutionStatus status)
ScheduledJobDao
{link #saveScheduledJobStatus} should be called first, otherwise the update will be ignored.
updateStatus
in interface ScheduledJobDao
public void addHistory(ScheduledJobKey key, @Nullable ScheduledJobHistory history, Date nextOccurrence)
ScheduledJobDao
addHistory
in interface ScheduledJobDao
key
- the job keyhistory
- the event that occurrednextOccurrence
- the date that the job is expected to execute nextpublic void updateNextOccurence(ScheduledJobKey key, Date nextOccurence)
ScheduledJobDao
updateNextOccurence
in interface ScheduledJobDao
key
- the job keynextOccurence
- the date that the job is expected to execute nextpublic void saveScheduledJobConfiguration(ScheduledJobKey key, ScheduledJobConfiguration job)
ScheduledJobDao
saveScheduledJobConfiguration
in interface ScheduledJobDao
key
- the job keyjob
- the configuration@Nullable public ScheduledJobConfiguration getScheduledJobConfiguration(ScheduledJobKey key)
ScheduledJobDao
getScheduledJobConfiguration
in interface ScheduledJobDao
key
- the job keyCopyright © 2003–2017 Atlassian. All rights reserved.