/** * Return the services list for the specified category. * * @param catlabel * the label for the category whose services list is needed * @return the services list for the specified category, null if category is * not found */ public String[] getServices(final String catlabel) { final Category cat = getCategory(catlabel); return (cat == null? null : cat.getServices().toArray(new String[0])); }
LOG.debug("Number of IPs satisfying rule: {}", nodeIPs.size()); final List<String> monitoredServices = new ArrayList<String>(category.getServices()); LOG.debug("categories in monitoredServices = {}", monitoredServices);
LOG.debug("Number of IPs satisfying rule: {}", nodeIPs.size()); final List<String> monitoredServices = new ArrayList<String>(category.getServices()); LOG.debug("categories in monitoredServices = {}", monitoredServices);
try { List<String> monitoredServices = new ArrayList<String>(cat.getServices());
try { List<String> monitoredServices = new ArrayList<String>(cat.getServices());
public void testGetCategory() { Category category = m_catFactory.getCategory(CATLABEL); assertEquals(99,category.getNormalThreshold(),0); assertEquals(97,category.getWarningThreshold(),0); assertTrue(category.getComment().isPresent()); assertEquals(CATCOMMENT,category.getComment().get()); assertEquals(CATRULE,category.getRule()); assertEquals("ICMP",category.getServices().get(0)); assertEquals("SNMP",category.getServices().get(1)); }
/** * The default constructor - initializes the values * * @param cat a {@link org.opennms.netmgt.config.categories.Category} object. * @param commonRule a {@link java.lang.String} object. */ public RTCCategory(Category cat, String commonRule) { setLabel(cat.getLabel()); setComment(cat.getComment().orElse(null)); setRule(cat.getRule()); setNormalThreshold(cat.getNormalThreshold()); setWarningThreshold(cat.getWarningThreshold()); setServices(cat.getServices()); m_effectiveRule = "(" + commonRule + ") & (" + cat.getRule() + ")"; }