Search in sources :

Example 1 with BaseEvent

use of com.evolveum.midpoint.notifications.api.events.BaseEvent in project midpoint by Evolveum.

the class NotificationManagerImpl method processEvent.

public void processEvent(@Nullable Event event, Task task, OperationResult result) {
    if (event == null) {
        return;
    }
    if (event instanceof BaseEvent) {
        ((BaseEvent) event).setNotificationFunctions(notificationFunctions);
    }
    LOGGER.trace("NotificationManager processing event {}", event);
    if (event.getAdHocHandler() != null) {
        processEvent(event, event.getAdHocHandler(), task, result);
    }
    SystemConfigurationType systemConfigurationType = NotificationFunctionsImpl.getSystemConfiguration(cacheRepositoryService, result);
    if (systemConfigurationType == null) {
        // something really wrong happened (or we are doing initial import of objects)
        return;
    }
    if (systemConfigurationType.getNotificationConfiguration() == null) {
        LOGGER.trace("No notification configuration in repository, finished event processing.");
        return;
    }
    NotificationConfigurationType notificationConfigurationType = systemConfigurationType.getNotificationConfiguration();
    processNotifications(notificationConfigurationType, event, task, result);
    LOGGER.trace("NotificationManager successfully processed event {} ({} top level handler(s))", event, notificationConfigurationType.getHandler().size());
}
Also used : NotificationConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationConfigurationType) BaseEvent(com.evolveum.midpoint.notifications.api.events.BaseEvent) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)

Aggregations

BaseEvent (com.evolveum.midpoint.notifications.api.events.BaseEvent)1 NotificationConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationConfigurationType)1 SystemConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)1