public interface

ScheduledJobDao

com.atlassian.confluence.schedule.persistence.dao.ScheduledJobDao
Known Indirect Subclasses

Class Overview

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 - peristent store and memory / cache
  • ScheduledJobConfiguration - memory / cache (runtime only)
  • Default Cron Configuration - (sourced from spring/plugin) - memory / cache (runtime only)

Summary

Public Methods
abstract void addHistory(ScheduledJobKey key, ScheduledJobHistory history, Date nextOccurence, boolean persistHistory)
Adds to an event to the history, and updates the nextOccurence in the ScheduledJobStatus.
abstract ScheduledJobConfiguration getScheduledJobConfiguration(ScheduledJobKey key)
Gets the job configuration for the specified job.
abstract String getScheduledJobDefaultCronExpression(ScheduledJobKey key)
Gets the default cron expression for the job.
abstract List<ScheduledJobHistory> getScheduledJobHistory(ScheduledJobKey key)
The the job history for a specified job.
abstract ScheduledJobStatus getScheduledJobStatus(ScheduledJobKey key)
Gets the specified job's status.
abstract void saveScheduledJobConfiguration(ScheduledJobKey key, ScheduledJobConfiguration jobConfiguration)
Stores the job configuration.
abstract void saveScheduledJobDefaultCronExpression(ScheduledJobKey key, String cronExpressionDefault)
Stores the default cron expression for a job.
abstract void saveScheduledJobStatus(ScheduledJobKey key, ScheduledJobStatus status)
Stores the status for the specified job.
abstract void updateNextOccurence(ScheduledJobKey key, Date nextOccurence)
Updates the nextOccurence in the ScheduledJobStatus.
abstract void updateStatus(ScheduledJobKey key, ExecutionStatus status)
Updates the status in the corresponding ScheduledJobStatus for the job.

Public Methods

public abstract void addHistory (ScheduledJobKey key, ScheduledJobHistory history, Date nextOccurence, boolean persistHistory)

Adds to an event to the history, and updates the nextOccurence in the ScheduledJobStatus.

Parameters
key the job key
history the event that occurred
nextOccurence the date that the job is expected to execute next
persistHistory true the history will be persisted

public abstract ScheduledJobConfiguration getScheduledJobConfiguration (ScheduledJobKey key)

Gets the job configuration for the specified job.

Parameters
key the job key
Returns
  • null if not found.

public abstract String getScheduledJobDefaultCronExpression (ScheduledJobKey key)

Gets the default cron expression for the job.

Parameters
key the job key
Returns
  • null if job not found.

public abstract List<ScheduledJobHistory> getScheduledJobHistory (ScheduledJobKey key)

The the job history for a specified job.

Parameters
key the job key
Returns
  • a list of ScheduledJobHistory. Null if no history has been recorded or persisted.

public abstract ScheduledJobStatus getScheduledJobStatus (ScheduledJobKey key)

Gets the specified job's status.

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.

Parameters
key the job key
Returns
  • null if the job does not exist, or the status has expired from the cache.

public abstract void saveScheduledJobConfiguration (ScheduledJobKey key, ScheduledJobConfiguration jobConfiguration)

Stores the job configuration.

Parameters
key the job key
jobConfiguration the configuration

public abstract void saveScheduledJobDefaultCronExpression (ScheduledJobKey key, String cronExpressionDefault)

Stores the default cron expression for a job.

Parameters
key the job key

public abstract void saveScheduledJobStatus (ScheduledJobKey key, ScheduledJobStatus status)

Stores the status for the specified job.

Parameters
key the job key
status stores the job status.

public abstract void updateNextOccurence (ScheduledJobKey key, Date nextOccurence)

Updates the nextOccurence in the ScheduledJobStatus.

Parameters
key the job key
nextOccurence the date that the job is expected to execute next

public abstract void updateStatus (ScheduledJobKey key, ExecutionStatus status)

Updates the status in the corresponding ScheduledJobStatus for the job. {link #saveScheduledJobStatus} should be called first, otherwise the update will be ignored.