Interface RuleScheduleStore
- All Known Implementing Classes:
JiraRuleScheduleStore
public interface RuleScheduleStore
CRUD operations around schedules for rules.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearErrorCount(TenantContext context, long scheduleId) Retrieves all rule schedules where their next execution time is before the passed in 'now' date.booleanrecordErrorOrRemove(TenantContext context, long scheduleId) increases error count for a rule schedule.voidremoveSchedule(TenantContext context, RuleSchedule schedule) voidsetSchedule(TenantContext context, RuleSchedule newSchedule)
-
Method Details
-
getScheduledRulesAndAdvanceSchedule
Retrieves all rule schedules where their next execution time is before the passed in 'now' date. Basically this returns all overdue schedules that need to run.Implementations should retrieve all overdue scheduled rules and update their schedules to the next scheduled date as an atomic store operation. This is to ensure a scheduled rule will only be executed once at it's scheduled time.
- Parameters:
env- The environmentnow- Current time- Returns:
- List of rules to execute. May be empty
-
setSchedule
-
removeSchedule
-
recordErrorOrRemove
increases error count for a rule schedule. If we exceed 3 errors, the schedule is removed and this method returns true- Returns:
- true if the rule schedule was removed
-
clearErrorCount
-