public class CachedScheduledJobDao extends Object implements ScheduledJobDao
Constructor and Description |
---|
CachedScheduledJobDao(com.atlassian.cache.Cache scheduledJobStatusCache,
com.atlassian.bandana.BandanaManager bandanaManager) |
Modifier and Type | Method and Description |
---|---|
void |
addHistory(ScheduledJobKey key,
ScheduledJobHistory history,
Date nextOccurence,
boolean persistHistory)
Adds to an event to the history, and updates the nextOccurence in the ScheduledJobStatus.
|
ScheduledJobConfiguration |
getScheduledJobConfiguration(ScheduledJobKey key)
Gets the job configuration for the specified job.
|
String |
getScheduledJobDefaultCronExpression(ScheduledJobKey key)
Gets the default cron expression for the job.
|
List<ScheduledJobHistory> |
getScheduledJobHistory(ScheduledJobKey key)
The the job history for a specified job.
|
ScheduledJobStatus |
getScheduledJobStatus(ScheduledJobKey key)
Gets the specified job's status.
|
void |
saveScheduledJobConfiguration(ScheduledJobKey key,
ScheduledJobConfiguration job)
Stores the job configuration.
|
void |
saveScheduledJobDefaultCronExpression(ScheduledJobKey key,
String cronExpressionDefault)
Stores the default cron expression for a job.
|
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 CachedScheduledJobDao(com.atlassian.cache.Cache scheduledJobStatusCache, com.atlassian.bandana.BandanaManager bandanaManager)
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 addHistory(ScheduledJobKey key, ScheduledJobHistory history, Date nextOccurence, boolean persistHistory)
ScheduledJobDao
addHistory
in interface ScheduledJobDao
key
- the job keyhistory
- the event that occurrednextOccurence
- the date that the job is expected to execute nextpersistHistory
- true the history will be persistedpublic List<ScheduledJobHistory> getScheduledJobHistory(ScheduledJobKey key)
ScheduledJobDao
getScheduledJobHistory
in interface ScheduledJobDao
key
- the job keypublic void updateStatus(ScheduledJobKey key, ExecutionStatus status)
ScheduledJobDao
updateStatus
in interface ScheduledJobDao
public 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 configurationpublic ScheduledJobConfiguration getScheduledJobConfiguration(ScheduledJobKey key)
ScheduledJobDao
getScheduledJobConfiguration
in interface ScheduledJobDao
key
- the job keypublic void saveScheduledJobDefaultCronExpression(ScheduledJobKey key, String cronExpressionDefault)
ScheduledJobDao
saveScheduledJobDefaultCronExpression
in interface ScheduledJobDao
key
- the job keypublic String getScheduledJobDefaultCronExpression(ScheduledJobKey key)
ScheduledJobDao
getScheduledJobDefaultCronExpression
in interface ScheduledJobDao
key
- the job keyCopyright © 2003–2015 Atlassian. All rights reserved.