Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining Paused State of Quartz Trigger?

Is there a way to determine if a specific Trigger in Quartz is in paused state?

I know of the getPausedTriggerGroups() method on Scheduler, but there doesn't seem to be a way to figure out the paused state of a particular Trigger for a particular JobDetail.

Any friendly suggestions?

like image 436
hooknc Avatar asked Sep 01 '10 16:09

hooknc


2 Answers

According to the API docs, Scheduler.getTriggerState(String triggerName, String triggerGroup) can tell you the state of a particular trigger, returning one of these constants: Trigger.STATE_NORMAL, Trigger.STATE_PAUSED, Trigger.STATE_COMPLETE, Trigger.STATE_ERROR, Trigger.STATE_BLOCKED, Trigger.STATE_NONE

But, yeah, that's not entirely intuitive. :)

like image 83
Jake Avatar answered Nov 12 '22 22:11

Jake


Beyond Quartz 1.8.1 this is an enumeration. See import org.quartz.Trigger.TriggerState;

like image 6
Robert Christian Avatar answered Nov 12 '22 23:11

Robert Christian