Example #1
0
 public void removeAllJobs() throws SchedulerException {
   for (String groupName : quartzScheduler.getJobGroupNames()) {
     for (JobKey jobKey : quartzScheduler.getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
       quartzScheduler.deleteJob(jobKey);
     }
   }
 }
Example #2
0
 public List<RunTimeJobDetail> listAllJobs() throws SchedulerException {
   List<RunTimeJobDetail> jobs = new ArrayList<RunTimeJobDetail>();
   for (String groupName : quartzScheduler.getJobGroupNames()) {
     for (JobKey jobKey : quartzScheduler.getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
       jobs.add(getJobDetails(groupName, jobKey.getName()));
     }
   }
   return jobs;
 }
Example #3
0
  public List<RunTimeJobDetail> searchJobs(String groupExp, String nameExp)
      throws SchedulerException {
    Pattern groupPattern = Pattern.compile(groupExp);
    Pattern namePattern = Pattern.compile(nameExp);

    List<RunTimeJobDetail> jobs = new ArrayList<RunTimeJobDetail>();
    for (String groupName : quartzScheduler.getJobGroupNames()) {
      if (groupPattern.matcher(groupName).matches()) {
        for (JobKey jobKey : quartzScheduler.getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
          if (namePattern.matcher(jobKey.getName()).matches()) {
            jobs.add(getJobDetails(groupName, jobKey.getName()));
          }
        }
      }
    }
    return jobs;
  }