use of org.xdi.service.timer.schedule.TimerSchedule in project oxTrust by GluuFederation.
the class ConfigurationFactory method initTimer.
public void initTimer() {
log.debug("Initializing Configuration Timer");
final int delay = 30;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new ConfigurationEvent(), Scheduled.Literal.INSTANCE));
}
use of org.xdi.service.timer.schedule.TimerSchedule in project oxTrust by GluuFederation.
the class LdapStatusTimer method initTimer.
public void initTimer() {
log.info("Initializing Ldap Status Timer");
this.isActive = new AtomicBoolean(false);
timerEvent.fire(new TimerEvent(new TimerSchedule(DEFAULT_INTERVAL, DEFAULT_INTERVAL), new LdapStatusEvent(), Scheduled.Literal.INSTANCE));
}
use of org.xdi.service.timer.schedule.TimerSchedule in project oxCore by GluuFederation.
the class QuartzSchedulerManager method schedule.
public void schedule(@Observes TimerEvent timerEvent) {
checkInitialized();
JobDataMap dataMap = new JobDataMap();
dataMap.put(TimerJob.KEY_TIMER_EVENT, timerEvent);
String uuid = UUID.randomUUID().toString();
JobDetail timerJob = JobBuilder.newJob(TimerJob.class).withIdentity(TimerJob.class.getSimpleName() + "_" + uuid, TimerJob.TIMER_JOB_GROUP).usingJobData(dataMap).build();
TimerSchedule timerSchedule = timerEvent.getSchedule();
Date triggerStartTime = new Date(System.currentTimeMillis() + timerSchedule.getDelay() * 1000L);
Trigger timerTrigger = TriggerBuilder.newTrigger().withIdentity(uuid, TimerJob.TIMER_JOB_GROUP).startAt(triggerStartTime).withSchedule(SimpleScheduleBuilder.repeatSecondlyForever(timerSchedule.getInterval())).build();
try {
scheduler.scheduleJob(timerJob, timerTrigger);
} catch (SchedulerException ex) {
throw new IllegalStateException("Failed to schedule Timer Event", ex);
}
}
use of org.xdi.service.timer.schedule.TimerSchedule in project oxTrust by GluuFederation.
the class LogDir method initTimer.
public void initTimer() {
log.info("Initializing Log File Size Checker Timer");
this.isActive = new AtomicBoolean(false);
final int delay = 2 * 60;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new LogFileSizeChekerEvent(), Scheduled.Literal.INSTANCE));
}
use of org.xdi.service.timer.schedule.TimerSchedule in project oxTrust by GluuFederation.
the class StatusCheckerDaily method initTimer.
public void initTimer() {
log.info("Initializing Daily Status Cheker Timer");
this.isActive = new AtomicBoolean(false);
final int delay = 1 * 60;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new StatusCheckerDailyEvent(), Scheduled.Literal.INSTANCE));
}
Aggregations