Class RuleScheduleServiceImpl
java.lang.Object
com.codebarrel.automation.api.service.RuleScheduleServiceImpl
- All Implemented Interfaces:
RuleScheduleService
-
Field Summary
Fields inherited from interface com.codebarrel.automation.api.service.RuleScheduleService
MAX_SCHEDULE_ERRORS -
Constructor Summary
ConstructorsConstructorDescriptionRuleScheduleServiceImpl(RuleScheduleStore store, AutomationConfigService automationConfigService, AutomationLicenseService automationLicenseService, TimezoneProvider timezoneProvider, AuditService auditService, AutomationQueue automationQueue, RuleNextExecutionCalculator ruleNextExecutionCalculator, AuditEventService auditEventService, TenantContextFactory tenantContextFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidFinds and runs all overdue schedules.voidremoveSchedule(TenantContext context, Long ruleId) Disables all schedules for a given rule.voidupdateSchedule(TenantContext context, com.codebarrel.automation.api.config.RuleConfigBean ruleConfig, com.codebarrel.automation.api.config.RuleConfigBean oldRuleConfig) Update the stored rule execution schedule for the provided rule.
-
Constructor Details
-
RuleScheduleServiceImpl
@Inject public RuleScheduleServiceImpl(RuleScheduleStore store, @Lazy AutomationConfigService automationConfigService, AutomationLicenseService automationLicenseService, TimezoneProvider timezoneProvider, AuditService auditService, @Lazy AutomationQueue automationQueue, RuleNextExecutionCalculator ruleNextExecutionCalculator, AuditEventService auditEventService, TenantContextFactory tenantContextFactory)
-
-
Method Details
-
executeAllOverdueSchedules
Description copied from interface:RuleScheduleServiceFinds and runs all overdue schedules. This method should execute fast and simply queue schedules to be executed (and not actually execute them)- Specified by:
executeAllOverdueSchedulesin interfaceRuleScheduleService- Parameters:
env- The environment from which to retrieve schedules
-
updateSchedule
public void updateSchedule(TenantContext context, com.codebarrel.automation.api.config.RuleConfigBean ruleConfig, com.codebarrel.automation.api.config.RuleConfigBean oldRuleConfig) Description copied from interface:RuleScheduleServiceUpdate the stored rule execution schedule for the provided rule. This needs to set or remove the nextExecution time from the underlying store.- Specified by:
updateSchedulein interfaceRuleScheduleService- Parameters:
context- The database tenant contextruleConfig- The updated rule configurationoldRuleConfig- The previous rule configuration before the update
-
removeSchedule
Description copied from interface:RuleScheduleServiceDisables all schedules for a given rule.- Specified by:
removeSchedulein interfaceRuleScheduleService- Parameters:
context- The database tenant contextruleId- the rule to remove schedules for
-