Class BackgroundJobDAO


  • public class BackgroundJobDAO
    extends Object
    DAO for background job records.
    Since:
    8.1.0
    • Constructor Detail

      • BackgroundJobDAO

        public BackgroundJobDAO​(org.hibernate.SessionFactory sessionFactory)
    • Method Detail

      • 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.
      • 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.