Class DefaultBackupRestoreJobDao
java.lang.Object
com.atlassian.confluence.impl.backuprestore.dao.DefaultBackupRestoreJobDao
- All Implemented Interfaces:
- BackupRestoreJobDao
Dao for backup/restore jobs.
- Since:
- 9.3
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultBackupRestoreJobDao(@NonNull org.hibernate.SessionFactory sessionFactory) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleancancelQueuedJobWithOptimisticLock(long jobId, String terminator) Cancels the job only if it's state was not modified.booleancancelRunningJobWithOptimisticLock(long jobId, String terminator) Cancels the job only if it's state was not modified.voiddelete(long jobId) Deletes given job with its settings and statisticsfindJobs(BackupRestoreJobsSearchFilter backupRestoreJobsSearchFilter) This gets all jobs where the file delete time is expired and the backup zip file still existsgetSettingsById(long id) getStatisticsById(long id) save(BackupRestoreJob job) save(BackupRestoreJobSettingsRecord backupRestoreJobSettingsRecord) voidsave(BackupRestoreJobStatisticsRecord statisticsRecord) Regular save generates the new id if the object does not exist.booleanstartProcessingJobWithOptimisticLock(long jobId) Changes jobs state to PROCESSING only if it's state was not modified.voidupdate(BackupRestoreJob job) voidintupdateStatistics(long jobId, String statistics) 
- 
Field Details- 
NEW_STATE- See Also:
 
- 
EXISTING_EXPECTED_STATE- See Also:
 
- 
CANCEL_TIME- See Also:
 
- 
TERMINATOR- See Also:
 
- 
ID- See Also:
 
- 
FINISH_PROCESSING_TIME- See Also:
 
- 
START_PROCESSING_TIME- See Also:
 
- 
STATISTICS- See Also:
 
 
- 
- 
Constructor Details- 
DefaultBackupRestoreJobDaopublic DefaultBackupRestoreJobDao(@NonNull org.hibernate.SessionFactory sessionFactory) 
 
- 
- 
Method Details- 
getById- Specified by:
- getByIdin interface- BackupRestoreJobDao
 
- 
save- Specified by:
- savein interface- BackupRestoreJobDao
 
- 
update- Specified by:
- updatein interface- BackupRestoreJobDao
 
- 
updateInNewTransaction- Specified by:
- updateInNewTransactionin interface- BackupRestoreJobDao
 
- 
findJobs@Transactional(readOnly=true) public List<BackupRestoreJob> findJobs(BackupRestoreJobsSearchFilter backupRestoreJobsSearchFilter) - Specified by:
- findJobsin interface- BackupRestoreJobDao
 
- 
cancelRunningJobWithOptimisticLockCancels the job only if it's state was not modified.- Specified by:
- cancelRunningJobWithOptimisticLockin interface- BackupRestoreJobDao
- Parameters:
- jobId- job id
- terminator- user who wants to cancel the job
- Returns:
- true if job was cancelled
 
- 
cancelQueuedJobWithOptimisticLockCancels the job only if it's state was not modified.- Specified by:
- cancelQueuedJobWithOptimisticLockin interface- BackupRestoreJobDao
- Parameters:
- jobId- job id
- terminator- user who wants to cancel the job
- Returns:
- true if job was cancelled
 
- 
startProcessingJobWithOptimisticLock@Transactional public boolean startProcessingJobWithOptimisticLock(long jobId) Changes jobs state to PROCESSING only if it's state was not modified.- Specified by:
- startProcessingJobWithOptimisticLockin interface- BackupRestoreJobDao
- Parameters:
- jobId- job id
- Returns:
- true if job changed it's state to processing
 
- 
getNextJobForProcessing- Specified by:
- getNextJobForProcessingin interface- BackupRestoreJobDao
 
- 
getNextActiveJob- Specified by:
- getNextActiveJobin interface- BackupRestoreJobDao
 
- 
getSettingsById@Transactional(readOnly=true) public BackupRestoreJobSettingsRecord getSettingsById(long id) throws IllegalStateException - Specified by:
- getSettingsByIdin interface- BackupRestoreJobDao
- Throws:
- IllegalStateException
 
- 
getStatisticsById- Specified by:
- getStatisticsByIdin interface- BackupRestoreJobDao
 
- 
save- Specified by:
- savein interface- BackupRestoreJobDao
 
- 
save- Specified by:
- savein interface- BackupRestoreJobDao
 
- 
updateStatistics- Specified by:
- updateStatisticsin interface- BackupRestoreJobDao
 
- 
saveAndKeepIdRegular save generates the new id if the object does not exist. This method reuses existing id.- Specified by:
- saveAndKeepIdin interface- BackupRestoreJobDao
 
- 
findJobsWithExpiredZipsThis gets all jobs where the file delete time is expired and the backup zip file still exists- Specified by:
- findJobsWithExpiredZipsin interface- BackupRestoreJobDao
- Returns:
- list of jobs to delete
 
- 
delete@Transactional public void delete(long jobId) Deletes given job with its settings and statistics- Specified by:
- deletein interface- BackupRestoreJobDao
- Parameters:
- jobId- - job id of the job to be deleted
 
 
-