Class JobService


@Service @Transactional(readOnly=true) public class JobService extends AbstractGenericEntityService<Job, JobRepository>
Read and retention service for durable Job attempts. Execution belongs to the durable lifecycle services; nothing here runs work.
Version:
3.0.6
Author:
Stephen Prizio
  • Constructor Details

  • Method Details

    • deleteStaleRunningJobs

      @Transactional public int deleteStaleRunningJobs()
      Deletes attempts that are still marked as running a week after they started. Lease recovery moves abandoned work to a terminal state within minutes, so anything still running after a week is residue rather than work in flight.
      Returns:
      count of deleted attempts
    • deleteOldJobs

      @Transactional public int deleteOldJobs()
      Deletes terminal attempts older than the configured lookback period.
      Returns:
      count of deleted attempts
    • findJobByJobId

      public Optional<Job> findJobByJobId(String jobId)
      Finds a Job by its job id.
      Parameters:
      jobId - job id
      Returns:
      Optional Job
    • searchJobs

      public org.springframework.data.domain.Page<Job> searchJobs(JobFilter filter, int page, int pageSize, org.springframework.data.domain.Sort sort)
      Returns a paginated Page of Jobs matching the given filter.
      Parameters:
      filter - JobFilter
      page - current page
      pageSize - page size
      sort - Sort
      Returns:
      Page of Job