/** * 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 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(); }
public void removeCategory(final String label) { m_categories.removeIf(cat -> { return cat.getLabel().equals(label); }); }
/** * Create a new instance to wrapper information from the categories.xml file * (that defines a category) and information from the RTC (that gives * current service level availability). * * @param categoryDef a {@link org.opennms.netmgt.config.categories.Category} object. * @param rtcCategory a {@link org.opennms.netmgt.xml.rtc.Category} object. * @param lastUpdated a {@link java.util.Date} object. */ protected Category(final org.opennms.netmgt.config.categories.Category categoryDef, final org.opennms.netmgt.xml.rtc.Category rtcCategory, final Date lastUpdated) { if (categoryDef == null || rtcCategory == null || lastUpdated == null) { throw new IllegalArgumentException("Cannot take null parameters."); } if (categoryDef.getLabel() == null || !categoryDef.getLabel().equals(rtcCategory.getCatlabel())) { throw new IllegalArgumentException("Cannot take category " + "definition and rtc category " + "value whose names do not " + "match."); } m_categoryDef = categoryDef; m_rtcCategory = rtcCategory; m_lastUpdated = lastUpdated; m_serviceCount = null; m_serviceDownCount = null; m_servicePercentage = null; }
/** * Create a new instance to wrapper information from the categories.xml file * (that defines a category) and information from the RTC (that gives * current service level availability). * * @param categoryDef a {@link org.opennms.netmgt.config.categories.Category} object. * @param rtcCategory a {@link org.opennms.netmgt.xml.rtc.Category} object. * @param lastUpdated a {@link java.util.Date} object. */ protected Category(final org.opennms.netmgt.config.categories.Category categoryDef, final org.opennms.netmgt.xml.rtc.Category rtcCategory, final Date lastUpdated) { if (categoryDef == null || rtcCategory == null || lastUpdated == null) { throw new IllegalArgumentException("Cannot take null parameters."); } if (categoryDef.getLabel() == null || !categoryDef.getLabel().equals(rtcCategory.getCatlabel())) { throw new IllegalArgumentException("Cannot take category " + "definition and rtc category " + "value whose names do not " + "match."); } m_categoryDef = categoryDef; m_rtcCategory = rtcCategory; m_lastUpdated = lastUpdated; m_serviceCount = null; m_serviceDownCount = null; m_servicePercentage = null; }
/** * <p>getCategoriesList</p> * * @return a {@link java.util.List} object. */ @Override public List<String> getCategoriesList() { List<String> categories = new ArrayList<>(); Collection<Category> catCollection = m_categoryConfigDao.findAll();; Iterator<Category> i = catCollection.iterator(); while (i.hasNext()) { categories.add(i.next().getLabel()); } return categories; }
/** * <p>getCategoriesList</p> * * @return a {@link java.util.List} object. */ @Override public List<String> getCategoriesList() { List<String> categories = new ArrayList<>(); Collection<Category> catCollection = m_categoryConfigDao.findAll();; Iterator<Category> i = catCollection.iterator(); while (i.hasNext()) { categories.add(i.next().getLabel()); } return categories; }
@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; }
/** * {@inheritDoc} * * Return the category specified by name. */ @Override public Category getCategory(final String name) { try { getReadLock().lock(); for (final CategoryGroup cg: m_config.getCategoryGroups()) { for (final Category cat : cg.getCategories()) { if (cat.getLabel().equals(name)) { return cat; } } } } finally { getReadLock().unlock(); } return null; }
@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; }
LOG.debug("CATEGORY {}", cat.getLabel()); catCount++; populateDataStructures(cat, report, format, monthFormat, catCount); } else { org.opennms.netmgt.config.categories.Category cat = (org.opennms.netmgt.config.categories.Category) m_catFactory.getCategory(categoryName); LOG.debug("CATEGORY - now populating data structures {}", cat.getLabel()); populateDataStructures(cat, report, format, monthFormat, 1);
LOG.debug("CATEGORY {}", cat.getLabel()); catCount++; populateDataStructures(cat, report, format, monthFormat, catCount); } else { org.opennms.netmgt.config.categories.Category cat = (org.opennms.netmgt.config.categories.Category) m_catFactory.getCategory(categoryName); LOG.debug("CATEGORY - now populating data structures {}", cat.getLabel()); populateDataStructures(cat, report, format, monthFormat, 1);
/** * {@inheritDoc} * * Return the effective rule for the specified category. The category rule * ANDed with the rule of the category group that the category belongs to. */ @Override public String getEffectiveRule(final String catlabel) { try { getReadLock().lock(); for (final CategoryGroup cg : m_config.getCategoryGroups()) { for (final Category cat : cg.getCategories()) { if (cat.getLabel().equals(catlabel)) { return "(" + cg.getCommon().getRule() + ") & (" + cat.getRule() + ")"; } } } } finally { getReadLock().unlock(); } return null; }
PreparedStatement outagesGetStmt = null; String categoryName = category.getLabel(); try { CategoryFactory.init();
PreparedStatement outagesGetStmt = null; String categoryName = category.getLabel(); try { CategoryFactory.init();
cat.getNormalThreshold(), cat.getComment().orElse(null), cat.getLabel(), format, monthFormat, org.opennms.reporting.availability.Category category = new org.opennms.reporting.availability.Category(); category.setCatComments(cat.getComment().orElse(null)); category.setCatName(cat.getLabel()); category.setCatIndex(catIndex); category.setNodeCount(0);
cat.getNormalThreshold(), cat.getComment().orElse(null), cat.getLabel(), format, monthFormat, org.opennms.reporting.availability.Category category = new org.opennms.reporting.availability.Category(); category.setCatComments(cat.getComment().orElse(null)); category.setCatName(cat.getLabel()); category.setCatIndex(catIndex); category.setNodeCount(0);
/** * 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() + ")"; }