Search in sources :

Example 1 with TimerEvent

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

the class CleanerTimer method initTimer.

public void initTimer() {
    log.debug("Initializing Cleaner Timer");
    this.isActive = new AtomicBoolean(false);
    int interval = appConfiguration.getCleanServiceInterval();
    if (interval <= 0) {
        interval = DEFAULT_INTERVAL;
    }
    cleanerEvent.fire(new TimerEvent(new TimerSchedule(30, 30), new CleanerEvent(), Scheduled.Literal.INSTANCE));
}
Also used : CleanerEvent(org.xdi.oxauth.service.cdi.event.CleanerEvent) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) TimerEvent(org.xdi.service.timer.event.TimerEvent)

Example 2 with TimerEvent

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

the class AppInitializer method initTimer.

public void initTimer() {
    this.isActive = new AtomicBoolean(false);
    this.lastFinishedTime = System.currentTimeMillis();
    timerEvent.fire(new TimerEvent(new TimerSchedule(1 * 60, DEFAULT_INTERVAL), new AuthConfigurationEvent(), Scheduled.Literal.INSTANCE));
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) TimerEvent(org.xdi.service.timer.event.TimerEvent)

Example 3 with TimerEvent

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

the class CustomScriptManager method initTimer.

public void initTimer(List<CustomScriptType> supportedCustomScriptTypes) {
    this.supportedCustomScriptTypes = supportedCustomScriptTypes;
    this.isActive = new AtomicBoolean(false);
    this.lastFinishedTime = System.currentTimeMillis();
    final int delay = 30;
    final int interval = DEFAULT_INTERVAL;
    reload();
    timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new UpdateScriptEvent(), Scheduled.Literal.INSTANCE));
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) TimerEvent(org.xdi.service.timer.event.TimerEvent) UpdateScriptEvent(org.xdi.service.cdi.event.UpdateScriptEvent)

Example 4 with TimerEvent

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

the class TimerJob method execute.

@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
    try {
        TimerEvent timerEvent = (TimerEvent) context.getJobDetail().getJobDataMap().get(KEY_TIMER_EVENT);
        if (timerEvent == null) {
            return;
        }
        log.debug("Fire timer event [{}] with qualifiers {}", timerEvent.getTargetEvent().getClass().getName(), timerEvent.getQualifiers());
        beanManager.fireEvent(timerEvent.getTargetEvent(), timerEvent.getQualifiers());
    } catch (Exception ex) {
        throw new JobExecutionException(ex);
    }
}
Also used : JobExecutionException(org.quartz.JobExecutionException) TimerEvent(org.xdi.service.timer.event.TimerEvent) JobExecutionException(org.quartz.JobExecutionException)

Example 5 with TimerEvent

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

the class MetadataValidationTimer method initTimer.

public void initTimer() {
    log.debug("Initializing Metadata Validation Timer");
    final int delay = 30;
    final int interval = DEFAULT_INTERVAL;
    timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new MetadataValidationEvent(), Scheduled.Literal.INSTANCE));
}
Also used : TimerSchedule(org.xdi.service.timer.schedule.TimerSchedule) TimerEvent(org.xdi.service.timer.event.TimerEvent) MetadataValidationEvent(org.gluu.oxtrust.service.cdi.event.MetadataValidationEvent)

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 UpdateScriptEvent (org.xdi.service.cdi.event.UpdateScriptEvent)1