Class BackgroundJobDAO
- java.lang.Object
-
- com.atlassian.confluence.impl.backgroundjob.dao.BackgroundJobDAO
-
public class BackgroundJobDAO extends Object
DAO for background job records.- Since:
- 8.1.0
-
-
Constructor Summary
Constructors Constructor Description BackgroundJobDAO(org.hibernate.SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(BackgroundJob job)
Physically removes a records from the DB.List<BackgroundJob>
findActiveJobsByType(String type)
Returns all active jobs with the particular type.BackgroundJob
getActiveJobById(long id)
Find an active record by id.List<BackgroundJob>
getAllJobsReadyToRunSortedById(Instant now)
Returns all active jobs with "runAt" field older or equal to "now".ArchivedBackgroundJob
getArchivedJobById(long id)
Find an archived record by id.List<ArchivedBackgroundJob>
getObsoleteArchivedJobs(Instant date, int limit)
Returns all non-active records that haven't been touched since "date".void
remove(BackgroundJob job)
Physically removes a records from the DB.void
removeArchivedJob(ArchivedBackgroundJob job)
void
save(BackgroundJob job)
void
saveArchived(ArchivedBackgroundJob job)
-
-
-
Method Detail
-
save
public void save(BackgroundJob job)
-
saveArchived
public void saveArchived(ArchivedBackgroundJob job)
-
delete
public void delete(BackgroundJob job)
Physically removes a records from the DB.
-
getAllJobsReadyToRunSortedById
public List<BackgroundJob> getAllJobsReadyToRunSortedById(Instant now)
Returns all active jobs with "runAt" field older or equal to "now".
-
findActiveJobsByType
public List<BackgroundJob> findActiveJobsByType(String type)
Returns all active jobs with the particular type.
-
remove
public void remove(BackgroundJob job)
Physically removes a records from the DB.
-
removeArchivedJob
public void removeArchivedJob(ArchivedBackgroundJob job)
-
getObsoleteArchivedJobs
public List<ArchivedBackgroundJob> getObsoleteArchivedJobs(Instant date, int limit)
Returns all non-active records that haven't been touched since "date".
-
getActiveJobById
public BackgroundJob getActiveJobById(long id)
Find an active record by id.
-
getArchivedJobById
public ArchivedBackgroundJob getArchivedJobById(long id)
Find an archived record by id.
-
-