Search in sources :

Example 1 with NotificationItemProcessor

use of com.blackducksoftware.integration.hub.alert.processor.NotificationItemProcessor in project hub-alert by blackducksoftware.

the class AccumulatorProcessor method process.

@Override
public DBStoreEvent process(final NotificationResults notificationData) throws Exception {
    if (notificationData != null) {
        try {
            final HubServicesFactory hubServicesFactory = globalProperties.createHubServicesFactoryAndLogErrors(logger);
            if (hubServicesFactory != null) {
                logger.info("Processing accumulated notifications");
                final NotificationItemProcessor notificationItemProcessor = new NotificationItemProcessor(globalProperties, hubServicesFactory.getRestConnection().logger);
                final DBStoreEvent storeEvent = notificationItemProcessor.process(notificationData.getNotificationContentItems());
                return storeEvent;
            }
        } catch (final Exception ex) {
            logger.error("Error occurred durring processing of accumulated notifications", ex);
        }
    } else {
        logger.info("No notifications to process");
    }
    return null;
}
Also used : HubServicesFactory(com.blackducksoftware.integration.hub.service.HubServicesFactory) NotificationItemProcessor(com.blackducksoftware.integration.hub.alert.processor.NotificationItemProcessor) DBStoreEvent(com.blackducksoftware.integration.hub.alert.event.DBStoreEvent)

Aggregations

DBStoreEvent (com.blackducksoftware.integration.hub.alert.event.DBStoreEvent)1 NotificationItemProcessor (com.blackducksoftware.integration.hub.alert.processor.NotificationItemProcessor)1 HubServicesFactory (com.blackducksoftware.integration.hub.service.HubServicesFactory)1