Search in sources :

Example 1 with UserNotification

use of de.metas.notification.UserNotification in project metasfresh-webui-api by metasfresh.

the class UserNotificationsService method forwardEventToNotificationsQueues.

private void forwardEventToNotificationsQueues(final IEventBus eventBus, final Event event) {
    logger.trace("Got event from {}: {}", eventBus, event);
    final UserNotification notification = UserNotificationUtils.toUserNotification(event);
    final UserId recipientUserId = UserId.ofRepoId(notification.getRecipientUserId());
    final UserNotificationsQueue notificationsQueue = getNotificationsQueueOrNull(recipientUserId);
    if (notificationsQueue == null) {
        logger.trace("No notification queue was found for recipientUserId={}", recipientUserId);
        return;
    }
    notificationsQueue.addNotification(notification);
}
Also used : UserId(de.metas.user.UserId) UserNotification(de.metas.notification.UserNotification)

Aggregations

UserNotification (de.metas.notification.UserNotification)1 UserId (de.metas.user.UserId)1