/** * <p>getGroupName</p> * * @return a {@link java.lang.String} object. */ public String getGroupName() { return m_thresholdGroup.getName(); }
/** {@inheritDoc} */ @Override public ThresholdGroup merge(ThresholdGroup group) { return get(group.getName(), group); }
private static Map<String, Set<ThresholdEntity>> getEntityMap(ThresholdGroup thresholdGroup, String resourceType) { LOG.trace("getEntityMap: checking if the resourceType '{}' exists on threshold group {}", resourceType, thresholdGroup); Map<String, Set<ThresholdEntity>> entityMap = null; if (CollectionResource.RESOURCE_TYPE_NODE.equals(resourceType)) { entityMap = thresholdGroup.getNodeResourceType().getThresholdMap(); } else if (CollectionResource.RESOURCE_TYPE_IF.equals(resourceType)) { entityMap = thresholdGroup.getIfResourceType().getThresholdMap(); } else { Map<String, ThresholdResourceType> typeMap = thresholdGroup.getGenericResourceTypeMap(); if (typeMap == null) { LOG.error("getEntityMap: Generic Resource Type map was null (this shouldn't happen) for threshold group {}", thresholdGroup.getName()); return null; } ThresholdResourceType thisResourceType = typeMap.get(resourceType); if (thisResourceType == null) { LOG.debug("getEntityMap: No thresholds configured for resource type '{}' in threshold group {}. Skipping this group.", resourceType, thresholdGroup.getName()); return null; } entityMap = thisResourceType.getThresholdMap(); } return Collections.unmodifiableMap(entityMap); }
for (final Iterator<ThresholdGroup> i = m_thresholdGroups.iterator(); i.hasNext();) { final ThresholdGroup group = i.next(); if (!newGroupNameList.contains(group.getName())) { LOG.info("{}: deleting group {}", logHeader, group); group.delete(); for (final String groupName : newGroupNameList) { final Optional<ThresholdGroup> foundGroup = m_thresholdGroups.stream().filter(tg -> groupName.equals(tg.getName())).findFirst(); try { if (!foundGroup.isPresent()) {
/** * <p>toString</p> * * @return a {@link java.lang.String} object. */ @Override public String toString() { final StringBuilder buf = new StringBuilder(); buf.append(getName() + "={node:{"); if (getNodeResourceType() != null) { buf.append(getNodeResourceType().getThresholdMap().values()); } buf.append("}; iface:{"); if (getIfResourceType() != null) { buf.append(getIfResourceType().getThresholdMap().values()); } if (getGenericResourceTypeMap() != null) { for (final Entry<String, ThresholdResourceType> entry : getGenericResourceTypeMap().entrySet()) { final String rType = entry.getKey(); buf.append("}; " + rType + ":{"); final ThresholdResourceType value = entry.getValue(); buf.append(value.getThresholdMap().values()); buf.append("}"); } } buf.append("}"); return buf.toString(); }
assertEquals(1, visitors.get(i).getThresholdGroups().size()); if (i == 5) { assertEquals("web-services", visitors.get(i).getThresholdGroups().get(0).getName());