use of org.ovirt.engine.core.common.utils.EngineCronTrigger in project ovirt-engine by oVirt.
the class AuditLogCleanupManager method init.
@PostConstruct
private void init() {
log.info("Start initializing {}", getClass().getSimpleName());
Calendar calendar = new GregorianCalendar();
Date auditLogCleanupTime = Config.<DateTime>getValue(ConfigValues.AuditLogCleanupTime);
calendar.setTimeInMillis(auditLogCleanupTime.getTime());
String cronExpression = String.format("%d %d %d * * ?", calendar.get(Calendar.SECOND), calendar.get(Calendar.MINUTE), calendar.get(Calendar.HOUR_OF_DAY));
log.info("Setting audit cleanup manager to run at '{}'", cronExpression);
executor.schedule(this::cleanup, new EngineCronTrigger(cronExpression));
log.info("Finished initializing {}", getClass().getSimpleName());
}
use of org.ovirt.engine.core.common.utils.EngineCronTrigger in project ovirt-engine by oVirt.
the class AutoRecoveryManager method initialize.
/**
* Should be called by backend, schedules the execution as configured.
*/
@PostConstruct
void initialize() {
log.info("Start initializing {}", getClass().getSimpleName());
executor.schedule(this::recover, new EngineCronTrigger(Config.getValue(ConfigValues.AutoRecoverySchedule)));
log.info("Finished initializing {}", getClass().getSimpleName());
}
use of org.ovirt.engine.core.common.utils.EngineCronTrigger in project ovirt-engine by oVirt.
the class CommandEntityCleanupManager method init.
@PostConstruct
private void init() {
log.info("Start initializing {}", getClass().getSimpleName());
Calendar calendar = new GregorianCalendar();
Date commandEntityCleanupTime = Config.<DateTime>getValue(ConfigValues.CommandEntityCleanupTime);
calendar.setTimeInMillis(commandEntityCleanupTime.getTime());
String cronExpression = String.format("%d %d %d * * ?", calendar.get(Calendar.SECOND), calendar.get(Calendar.MINUTE), calendar.get(Calendar.HOUR_OF_DAY));
log.info("Setting command entity cleanup manager to run at: {}", cronExpression);
executor.schedule(this::cleanup, new EngineCronTrigger(cronExpression));
log.info("Finished initializing {}", getClass().getSimpleName());
}
Aggregations