getJobNames() in quartz scheduler 2.2.1

java, quartz-scheduler

Solution

In quartz 2.0.x a `GroupMatcher` class was introduced. So, to get job keys you should write something like this:

scheduler.getJobKeys(GroupMatcher.jobGroupEquals(Scheduler.DEFAULT_GROUP))

Have a look at GroupMatcher javadoc: http://quartz-scheduler.org/api/2.2.0/org/quartz/impl/matchers/GroupMatcher.html

By the way, there is a comprehensive migration guide from 1.8.x to 2.x on Quartz-Scheduler site: http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/migration-guide.html

Problem

We are upgrading from quartz scheduler release `1.8.6` to `2.2.1`. In `1.8.6` we did this: ``` String[] jobs = sched.getJobNames(Scheduler.DEFAULT_GROUP); ``` How do I achieve this in `quartz scheduler 2.2.1`? I have tried the `GroupMatcher` thing, with a `TriggerKey` match and the `sched.getTriggerKeys`, but I cannot get it to work.

Original source