private Set<String> findDomainNames() { Set<String> domainNames = Sets.newTreeSet(); // Get all of the non-numeric directory names in the RRD directory; these // are the names of the domains that have performance data for (ResourcePath child : m_resourceStorageDao.children(ResourcePath.get(ResourceTypeUtils.SNMP_DIRECTORY), 2)) { try { // if the directory name is an integer Integer.parseInt(child.getName()); continue; } catch (NumberFormatException e) { domainNames.add(child.getName()); } } return domainNames; }
/** {@inheritDoc} */ @Override public String getResourceNameFromIndex(CollectionResource resource) { StringTokenizer indexes = new StringTokenizer(resource.getInstance(), "."); String ifIndex = indexes.nextToken(); String ifName = getInterfaceName(resource.getParent().getName(), ifIndex); String dlci = indexes.nextToken(); return ifName + "." + dlci; }
return getIfLabel(); } else if ("id".equalsIgnoreCase(ds)) { return m_resource.getPath().getName().toString();
@Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { final String resourceId = getResourceId(group.getResource()); final String groupId = resourceId + '/' + group.getName(); LOG.debug("visitGroup: {} = {}", groupId, group.getAttributes().size()); stats.checkNode(group.getResource().getParent().getName()); stats.checkGroup(groupId); stats.checkResource(resourceId); group.getAttributes().forEach(a -> { final String attribId = resourceId + '/' + a.getName(); if (a.getAttributeType().getType().isNumeric()) { LOG.debug("visitGroup: attribute {}", attribId); stats.checkAttribute(attribId, true); stats.markNumericSamplesMeter(); } else { stats.checkAttribute(attribId, false); } }); setBuilder(new EvaluatorPersistOperationBuilder()); } }
public OnmsResource getResourceByPath(final ResourcePath path, final OnmsResource parent) { final Set<OnmsAttribute> set = new LazySet<OnmsAttribute>(new LazyResourceAttributeLoader(m_resourceStorageDao, path)); final String index = path.getName(); String label; if (m_resourceLabelExpression == null) {
@Override public void visitAttribute(CollectionAttribute attribute) { pushShouldPersist(attribute); if (shouldPersist()) { final String resourceId = getResourceId(attribute.getResource()); final String attribId = resourceId + '/' + attribute.getName(); LOG.debug("visitAttribute: {}", attribId); stats.checkNode(attribute.getResource().getParent().getName()); stats.checkResource(resourceId); if (attribute.getAttributeType().getType().isNumeric()) { stats.checkAttribute(attribId, true); stats.markNumericSamplesMeter(); } else { stats.checkAttribute(attribId, false); } setBuilder(new EvaluatorPersistOperationBuilder()); } }