@Override public synchronized String getEffectiveRule(final String catlabel) { for (final CategoryGroup cg : m_config.getCategoryGroups()) { for (final Category cat : cg.getCategories()) { if (cat.getLabel().equals(catlabel)) { return "(" + cg.getCommon().getRule() + ") & (" + cat.getRule() + ")"; } } } return null; }
protected Category() { m_categoryDef = new org.opennms.netmgt.config.categories.Category(); m_rtcCategory = null; m_lastUpdated = null; }
public void setCommon(final Common common) { if (common == null) { m_common = new Common(); } else { m_common = common; } }
@Override public synchronized Category getCategory(final String name) { for (final CategoryGroup cg : m_config.getCategoryGroups()) { for (final Category cat : cg.getCategories()) { if (cat.getLabel().equals(name)) { return cat; } } } return null; }
public void replaceCategoryInGroup(final String groupname, final Category cat) { m_categoryGroups.forEach(cg -> { if (cg.getName().equals(groupname)) { cg.getCategories().replaceAll(c -> { if (c.getLabel().equals(cat.getLabel())) { return cat; } return c; }); } }); }
/** * Create an empty category with nothing other than a name. This represents * a category with no RTC data. * * @param categoryName a {@link java.lang.String} object. */ protected Category(String categoryName) { m_categoryDef = new org.opennms.netmgt.config.categories.Category(); m_categoryDef.setLabel(categoryName); m_categoryDef.setNormalThreshold(0d); m_categoryDef.setWarningThreshold(0d); m_rtcCategory = null; m_lastUpdated = null; }
/** * 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 unique name for this category. * * @return a {@link java.lang.String} object. */ @XmlAttribute(name="name") public String getName() { return m_categoryDef == null? null : m_categoryDef.getLabel(); }
/** * Return the value considered to be the minimum "normal" value. * * @return a double. */ @XmlAttribute(name="normal-threshold") public double getNormalThreshold() { return m_categoryDef == null? null : m_categoryDef.getNormalThreshold(); }
/** * Return the rule for the specified category. * * @param catlabel * the label for the category whose services list is needed * @return the rule for the specified category, null if the category is not * found */ public String getRule(final String catlabel) { final Category cat = getCategory(catlabel); return (cat == null? null : cat.getRule()); }
public Catinfo(final String rev, final String created, final String mstation) { m_header = new Header(rev, created, mstation); }
public CategoryGroup(final String name) { setName(name); }
/** * Create an empty category with nothing other than a name. This represents * a category with no RTC data. * * @param categoryName a {@link java.lang.String} object. */ protected Category(String categoryName) { m_categoryDef = new org.opennms.netmgt.config.categories.Category(); m_categoryDef.setLabel(categoryName); m_categoryDef.setNormalThreshold(0d); m_categoryDef.setWarningThreshold(0d); m_rtcCategory = null; m_lastUpdated = null; }
/** * 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 normal value for the specified category. */ @Override public double getNormal(final String catlabel) { final Category cat = getCategory(catlabel); return (cat == null? -1.0 : cat.getNormalThreshold()); }
function Common() { var _this = this; this.viewModel = null; this.showViewModel = function () { alert(_this.viewModel); }; } var common = null; $().ready(function () { common = new Common(); });
protected Category() { m_categoryDef = new org.opennms.netmgt.config.categories.Category(); m_rtcCategory = null; m_lastUpdated = null; }
/** * {@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()); }
public class MainActivity implements Common.OnSelectedListener { Common common = new Common(); public MainActivity() { } public void startMyCallback() { common.mCallback = this; } @Override public void getFailureDialog() { RecordFailure fd = new RecordFailure(); fd.show(getSupportFragmentManager(), "dialog"); } }