How can we know if a trigger is scheduled to fire at a specific time? i searched through all the apis but couldnt find. The closest api I found is getNextFireTime() and getFireTimeAfter(Date afterTime). My requirement is to find that if a trigger is scheduled to fire at a specific time.. If not schedule it to fire at that time.
Share
You could use the Quartz TriggerUtils utility methods.
The method
computeFireTimes(org.quartz.spi.OperableTrigger trigg, Calendar cal, int numTimes)returns a list of Dates that are the next fire times of a Trigger.The method
computeFireTimesBetween(org.quartz.spi.OperableTrigger trigg, Calendar cal, java.util.Date from, java.util.Date to)returns a list of Dates that are the next fire times of a Trigger that fall within the given date range.I hope this helps.