Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
JobManager has the following API to search for jobs of jcr:primaryType as "slingevent:Job":
Job getJob(String topic, Map<String, Object> template);
Collection<Job> findJobs(QueryType type, String topic, long limit, Map<String, Object>... templates);
However, I am unable to find an API that will help me search through the scheduled jobs that are of jcr:primaryType as "slingevent:TimedEvent" and are scheduled to become slingevent:Job at a specific time in future.
Issue:
Since the above mentioned APIs do not return the scheduled jobs, we are left with the option of retrieving ALL the scheduled jobs using
jobManager.getScheduledJobs();
and then iterating through each of these jobs to find a particular desired job.
Requirement:
An API providing search on scheduled jobs based on the event topic and properties would be good. This is required to check if a replication job already exists for a asset and if it does, it needs to be rescheduled.
Workaround:
Collection<ScheduledJobInfo> scheduledJobs = jobManager.getScheduledJobs();
for (ScheduledJobInfo eachJob : scheduledJobs)
}