@Override public boolean notificationsAvailable( final AuditElements.EventCategoryType type, final String category, final String subcategory, final String event) { final String successEvent = AuditLoggerName.buildEvent(type, category, subcategory, event, Result.SUCCESS); final String failureEvent = AuditLoggerName.buildEvent(type, category, subcategory, event, Result.FAILURE); return notificationDAO.findAll().stream(). anyMatch(notification -> notification.isActive() && (notification.getEvents().contains(successEvent) || notification.getEvents().contains(failureEvent))); }
if (!notification.getEvents().contains(currentEvent)) { LOG.debug("No events found about {}", any); } else if (anyType == null || any == null
jexlVars.put("events", notification.getEvents());
@Override public NotificationTO getNotificationTO(final Notification notification) { NotificationTO notificationTO = new NotificationTO(); notificationTO.setKey(notification.getKey()); notificationTO.setTemplate(notification.getTemplate().getKey()); notificationTO.getEvents().addAll(notification.getEvents()); notificationTO.setRecipientsFIQL(notification.getRecipientsFIQL()); notificationTO.getStaticRecipients().addAll(notification.getStaticRecipients()); notificationTO.setRecipientAttrName(notification.getRecipientAttrName()); notificationTO.setSelfAsRecipient(notification.isSelfAsRecipient()); notificationTO.setSender(notification.getSender()); notificationTO.setSubject(notification.getSubject()); notificationTO.setTraceLevel(notification.getTraceLevel()); notificationTO.setActive(notification.isActive()); notification.getAbouts().forEach(about -> { notificationTO.getAbouts().put(about.getAnyType().getKey(), about.get()); }); if (notification.getRecipientsProvider() != null) { notificationTO.setRecipientsProvider(notification.getRecipientsProvider().getKey()); } return notificationTO; }