/** * <p>getNotification</p> * * @param name a {@link java.lang.String} object. * @return a {@link org.opennms.netmgt.config.notifications.Notification} object. * @throws java.io.IOException if any. */ public Notification getNotification(final String name) throws IOException { update(); return getNotifications().get(name); }
/** * <p>getNotifications</p> * * @return a {@link java.util.Map} object. * @throws java.io.IOException if any. */ public Map<String, Notification> getNotifications() throws IOException { update(); Map<String, Notification> newMap = new HashMap<String, Notification>(); for (final Notification notif : m_notifications.getNotifications()) { newMap.put(notif.getName(), notif); } return Collections.unmodifiableMap(newMap); }
/** * <p>getNotificationNames</p> * * @return a {@link java.util.List} object. * @throws java.io.IOException if any. */ public List<String> getNotificationNames() throws IOException { update(); List<String> notificationNames = new ArrayList<>(); for (Notification curNotif : m_notifications.getNotifications()) { notificationNames.add(curNotif.getName()); } return notificationNames; }
/** * <p>hasUei</p> * * @param uei a {@link java.lang.String} object. * @return a boolean. * @throws java.io.IOException if any. */ public boolean hasUei(final String uei) throws IOException { update(); for (Notification notif : m_notifications.getNotifications()) { if (uei.equals(notif.getUei()) || "MATCH-ANY-UEI".equals(notif.getUei())) { return true; } else if (notif.getUei().charAt(0) == '~') { if (uei.matches(notif.getUei().substring(1))) { return true; } } } return false; }
/** * <p>saveCurrent</p> * * @throws java.io.IOException if any. * @throws java.lang.ClassNotFoundException if any. */ public synchronized void saveCurrent() throws IOException, ClassNotFoundException { m_notifications.setHeader(rebuildHeader()); // Marshal to a string first, then write the string to the file. This // way the original configuration // isn't lost if the XML from the marshal is hosed. final String xmlString = JaxbUtils.marshal(m_notifications); saveXML(xmlString); update(); }
update(); List<Notification> notifList = new ArrayList<>(); boolean matchAll = getConfigManager().getNotificationMatch();
m_userManager.update(); m_groupManager.update(); m_notificationManager.update(); m_destinationPathManager.update(); m_notificationCommandManager.update();