@Test @Transactional public void testGetMatchingNotifications() { List<Filter> filterList = new ArrayList<Filter>(); int limit = 10; int multiple = 0; AcknowledgeType ackType = AcknowledgeType.UNACKNOWLEDGED; SortStyle sortStyle = SortStyle.DEFAULT_SORT_STYLE; Filter[] filters = filterList.toArray(new Filter[0]); Notification[] notices = m_daoNotificationRepo.getMatchingNotifications(new NotificationCriteria(filters, sortStyle, ackType, limit, limit * multiple)); assertEquals(1, notices.length); assertEquals("This is a test notification", notices[0].getTextMessage()); }
@Transactional public Notification[] getMatchingNotifications(NotificationCriteria criteria) { List<Notification> notifications = new ArrayList<Notification>(); List<OnmsNotification> onmsNotifs = m_notificationDao.findMatching(getOnmsCriteria(criteria)); for (OnmsNotification notif : onmsNotifs) { notifications.add(mapOnmsNotificationToNotification(notif)); } return notifications.toArray(new Notification[0]); }
DaoWebNotificationRepository implements WebNotificationRepository, InitializingBean { @Transactional public Notification[] getMatchingNotifications(NotificationCriteria criteria) { List<Notification> notifications = new ArrayList<Notification>(); List<OnmsNotification> onmsNotifs = m_notificationDao.findMatching(getOnmsCriteria(criteria)); for (OnmsNotification notif : onmsNotifs) { notifications.add(mapOnmsNotificationToNotification(notif)); } return notifications.toArray(new Notification[0]); } }
DaoWebNotificationRepository implements WebNotificationRepository, InitializingBean { @Transactional public Notification[] getMatchingNotifications(NotificationCriteria criteria) { List<Notification> notifications = new ArrayList<Notification>(); List<OnmsNotification> onmsNotifs = m_notificationDao.findMatching(getOnmsCriteria(criteria)); for (OnmsNotification notif : onmsNotifs) { notifications.add(mapOnmsNotificationToNotification(notif)); } return notifications.toArray(new Notification[0]); }  }
DaoWebNotificationRepository implements WebNotificationRepository, InitializingBean { @Transactional public Notification[] getMatchingNotifications(NotificationCriteria criteria) { List<Notification> notifications = new ArrayList<Notification>(); List<OnmsNotification> onmsNotifs = m_notificationDao.findMatching(getOnmsCriteria(criteria)); for (OnmsNotification notif : onmsNotifs) { notifications.add(mapOnmsNotificationToNotification(notif)); } return notifications.toArray(new Notification[0]); }  @Override void afterPropertiesSet(); @Transactional void acknowledgeMatchingNotification(String user, Date timestamp, NotificationCriteria criteria); @Transactional int countMatchingNotifications(NotificationCriteria criteria); @Transactional Notification[] getMatchingNotifications(NotificationCriteria criteria); @Transactional Notification getNotification(int noticeId); }
DaoWebNotificationRepository implements WebNotificationRepository, InitializingBean { @Transactional public Notification[] getMatchingNotifications(NotificationCriteria criteria) { List<Notification> notifications = new ArrayList<Notification>(); List<OnmsNotification> onmsNotifs = m_notificationDao.findMatching(getOnmsCriteria(criteria)); for (OnmsNotification notif : onmsNotifs) { notifications.add(mapOnmsNotificationToNotification(notif)); } return notifications.toArray(new Notification[0]); }  @Override void afterPropertiesSet(); @Transactional void acknowledgeMatchingNotification(String user, Date timestamp, NotificationCriteria criteria); @Transactional int countMatchingNotifications(NotificationCriteria criteria); @Transactional Notification[] getMatchingNotifications(NotificationCriteria criteria); @Transactional Notification getNotification(int noticeId);  }