Package io.quarkus.scheduler
Interface Trigger
public interface Trigger
Trigger is bound to a scheduled job.
It represents the logic that is used to test if a scheduled job should be executed at a specific time, i.e. the trigger is "fired".
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetId()default StringIf the trigger represents a cron-based job with a timezone, then the returnedInstanttakes the timezone into account.If the trigger represents a cron-based job with a timezone, then the returnedInstanttakes the timezone into account.booleanThe grace period is configurable withScheduled.overdueGracePeriod().
-
Method Details
-
getId
String getId()- Returns:
- the identifier of the job
- See Also:
-
getNextFireTime
Instant getNextFireTime()If the trigger represents a cron-based job with a timezone, then the returnedInstanttakes the timezone into account.For example, if there is a job with cron expression
0 30 20 ? * * *with timezoneEurope/Berlin, then the return value looks like2024-07-08T18:30:00Z. AndInstant.atZone(java.time.ZoneId)forEurope/Berlinwould yield2024-07-08T20:30+02:00[Europe/Berlin].- Returns:
- the next time at which the trigger is scheduled to fire, or
nullif it will not fire again
-
getPreviousFireTime
Instant getPreviousFireTime()If the trigger represents a cron-based job with a timezone, then the returnedInstanttakes the timezone into account.For example, if there is a job with cron expression
0 30 20 ? * * *with timezoneEurope/Berlin, then the return value looks like2024-07-08T18:30:00Z. AndInstant.atZone(java.time.ZoneId)forEurope/Berlinwould yield2024-07-08T20:30+02:00[Europe/Berlin].- Returns:
- the previous time at which the trigger fired, or
nullif it has not fired yet
-
isOverdue
boolean isOverdue()The grace period is configurable withScheduled.overdueGracePeriod().Skipped executions are not considered as overdue.
- Returns:
falseif the last execution took place between the expected execution time and the end of the grace period,trueotherwise- See Also:
-
getMethodDescription
- Returns:
- the method description or
nullfor a trigger of a programmatically added job
-