Package org.jobrunr.storage.sql.common
Class JobTable
- java.lang.Object
-
- org.jobrunr.storage.sql.common.db.Sql<Job>
-
- org.jobrunr.storage.sql.common.JobTable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
countJobs(StateName state)
int
deleteJobsByStateAndUpdatedBefore(StateName state, java.time.Instant updatedBefore)
int
deletePermanently(java.util.UUID... ids)
boolean
exists(JobDetails jobDetails, StateName... states)
java.util.Set<java.lang.String>
getDistinctJobSignatures(StateName[] states)
boolean
recurringJobExists(java.lang.String recurringJobId, StateName... states)
java.util.List<Job>
save(java.util.List<Job> jobs)
Job
save(Job jobToSave)
java.util.Optional<Job>
selectJobById(java.util.UUID id)
java.util.List<Job>
selectJobsByState(StateName state, java.time.Instant updatedBefore, PageRequest pageRequest)
java.util.List<Job>
selectJobsByState(StateName state, PageRequest pageRequest)
java.util.List<Job>
selectJobsScheduledBefore(java.time.Instant scheduledBefore, PageRequest pageRequest)
JobTable
withId(java.util.UUID id)
JobTable
withOrderLimitAndOffset(java.lang.String order, int limit, long offset)
JobTable
withScheduledAt(java.time.Instant scheduledBefore)
JobTable
withState(StateName state)
JobTable
withUpdatedBefore(java.time.Instant updatedBefore)
-
-
-
Method Detail
-
withId
public JobTable withId(java.util.UUID id)
-
withScheduledAt
public JobTable withScheduledAt(java.time.Instant scheduledBefore)
-
withUpdatedBefore
public JobTable withUpdatedBefore(java.time.Instant updatedBefore)
-
save
public java.util.List<Job> save(java.util.List<Job> jobs) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
selectJobById
public java.util.Optional<Job> selectJobById(java.util.UUID id)
-
countJobs
public long countJobs(StateName state) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
selectJobsByState
public java.util.List<Job> selectJobsByState(StateName state, PageRequest pageRequest)
-
selectJobsByState
public java.util.List<Job> selectJobsByState(StateName state, java.time.Instant updatedBefore, PageRequest pageRequest)
-
selectJobsScheduledBefore
public java.util.List<Job> selectJobsScheduledBefore(java.time.Instant scheduledBefore, PageRequest pageRequest)
-
getDistinctJobSignatures
public java.util.Set<java.lang.String> getDistinctJobSignatures(StateName[] states)
-
exists
public boolean exists(JobDetails jobDetails, StateName... states) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
recurringJobExists
public boolean recurringJobExists(java.lang.String recurringJobId, StateName... states) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
deletePermanently
public int deletePermanently(java.util.UUID... ids) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
deleteJobsByStateAndUpdatedBefore
public int deleteJobsByStateAndUpdatedBefore(StateName state, java.time.Instant updatedBefore) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
withOrderLimitAndOffset
public JobTable withOrderLimitAndOffset(java.lang.String order, int limit, long offset)
- Overrides:
withOrderLimitAndOffset
in classSql<Job>
-
-