/** * Return the value considered to be the minimum value below the "normal" * value where only a warning is necessary. Below this value the category's * value will be considered unacceptable. * * @return a double. */ @XmlAttribute(name="warning-threshold") public double getWarningThreshold() { return m_categoryDef == null? null : m_categoryDef.getWarningThreshold(); }
/** * Return the value considered to be the minimum value below the "normal" * value where only a warning is necessary. Below this value the category's * value will be considered unacceptable. * * @return a double. */ @XmlAttribute(name="warning-threshold") public double getWarningThreshold() { return m_categoryDef == null? null : m_categoryDef.getWarningThreshold(); }
/** * {@inheritDoc} * * Return the warning value for the specified category. */ @Override public double getWarning(final String catlabel) { final Category cat = getCategory(catlabel); return (cat == null? -1.0 : cat.getWarningThreshold()); }
report, topOffenders, cat.getWarningThreshold(), cat.getNormalThreshold(), cat.getComment().orElse(null),
report, topOffenders, cat.getWarningThreshold(), cat.getNormalThreshold(), cat.getComment().orElse(null),
/** * 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() + ")"; }
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)); }