Search in sources :

Example 11 with TimerEvent

use of org.xdi.service.timer.event.TimerEvent in project oxTrust by GluuFederation.

the class CacheRefreshTimer method initTimer.

public void initTimer() {
    log.info("Initializing Cache Refresh Timer");
    this.isActive = new AtomicBoolean(false);
    // Clean up previous Inum cache
    CacheRefreshConfiguration cacheRefreshConfiguration = configurationFactory.getCacheRefreshConfiguration();
    if (cacheRefreshConfiguration != null) {
        String snapshotFolder = cacheRefreshConfiguration.getSnapshotFolder();
        if (StringHelper.isNotEmpty(snapshotFolder)) {
            String inumCachePath = getInumCachePath(cacheRefreshConfiguration);
            objectSerializationService.cleanup(inumCachePath);
        }
    }
    // Schedule to start cache refresh every 1 minute
    final int delay = 1 * 60;
    final int interval = DEFAULT_INTERVAL;
    timerEvent.fire(new TimerEvent(new TimerSchedule(delay, DEFAULT_INTERVAL), new CacheRefreshEvent(), Scheduled.Literal.INSTANCE));
    this.lastFinishedTime = System.currentTimeMillis();
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) CacheRefreshConfiguration(org.xdi.config.oxtrust.CacheRefreshConfiguration) TimerEvent(org.xdi.service.timer.event.TimerEvent) CacheRefreshEvent(org.gluu.oxtrust.service.cdi.event.CacheRefreshEvent)

Example 12 with TimerEvent

use of org.xdi.service.timer.event.TimerEvent in project oxAuth 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));
}
Also used : ConfigurationEvent(org.xdi.service.cdi.event.ConfigurationEvent) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) TimerEvent(org.xdi.service.timer.event.TimerEvent)

Example 13 with TimerEvent

use of org.xdi.service.timer.event.TimerEvent 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));
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) LogFileSizeChekerEvent(org.gluu.oxtrust.service.cdi.event.LogFileSizeChekerEvent) TimerEvent(org.xdi.service.timer.event.TimerEvent)

Example 14 with TimerEvent

use of org.xdi.service.timer.event.TimerEvent 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));
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) StatusCheckerDailyEvent(org.gluu.oxtrust.service.cdi.event.StatusCheckerDailyEvent) TimerEvent(org.xdi.service.timer.event.TimerEvent)

Example 15 with TimerEvent

use of org.xdi.service.timer.event.TimerEvent in project oxTrust by GluuFederation.

the class StatusCheckerTimer 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 StatusCheckerTimerEvent(), Scheduled.Literal.INSTANCE));
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) StatusCheckerTimerEvent(org.gluu.oxtrust.service.cdi.event.StatusCheckerTimerEvent) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) TimerEvent(org.xdi.service.timer.event.TimerEvent) StatusCheckerTimerEvent(org.gluu.oxtrust.service.cdi.event.StatusCheckerTimerEvent)

Aggregations

TimerEvent (org.xdi.service.timer.event.TimerEvent)16 TimerSchedule (org.xdi.service.timer.schedule.TimerSchedule)15 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)11 ConfigurationEvent (org.xdi.service.cdi.event.ConfigurationEvent)2 LdapStatusEvent (org.xdi.service.cdi.event.LdapStatusEvent)2 CacheRefreshEvent (org.gluu.oxtrust.service.cdi.event.CacheRefreshEvent)1 EntityIdMonitoringEvent (org.gluu.oxtrust.service.cdi.event.EntityIdMonitoringEvent)1 LogFileSizeChekerEvent (org.gluu.oxtrust.service.cdi.event.LogFileSizeChekerEvent)1 MetadataValidationEvent (org.gluu.oxtrust.service.cdi.event.MetadataValidationEvent)1 StatusCheckerDailyEvent (org.gluu.oxtrust.service.cdi.event.StatusCheckerDailyEvent)1 StatusCheckerTimerEvent (org.gluu.oxtrust.service.cdi.event.StatusCheckerTimerEvent)1 SvnSyncEvent (org.gluu.oxtrust.service.cdi.event.SvnSyncEvent)1 JobExecutionException (org.quartz.JobExecutionException)1 CacheRefreshConfiguration (org.xdi.config.oxtrust.CacheRefreshConfiguration)1 CleanerEvent (org.xdi.oxauth.service.cdi.event.CleanerEvent)1 KeyGenerationEvent (org.xdi.oxauth.service.cdi.event.KeyGenerationEvent)1 Asynchronous (org.xdi.service.cdi.async.Asynchronous)1 UpdateScriptEvent (org.xdi.service.cdi.event.UpdateScriptEvent)1