/** {@inheritDoc} */ @Override public Collection<CollectionAttribute> getAttributes() { return m_wrapped.getAttributes(); }
/** * <p>getAttributes</p> * * @return a {@link java.util.Collection} object. */ @Override public Collection<CollectionAttribute> getAttributes() { return m_group.getAttributes(); }
public List<CollectionAttribute> getStringAttributes() { return m_groups.values().stream() .flatMap(g -> g.getAttributes().stream()) .filter(a -> a.getAttributeType() instanceof NumericCollectionAttributeType == false || AttributeType.STRING.equals(a.getAttributeType().getType())) .collect(Collectors.toList()); }
/** * <p>visit</p> * * @param visitor a {@link org.opennms.netmgt.collection.api.CollectionSetVisitor} object. */ @Override public void visit(CollectionSetVisitor visitor) { LOG.debug("Visiting Group {}", this); visitor.visitGroup(this); for(CollectionAttribute attr : getAttributes()) { attr.visit(visitor); } visitor.completeGroup(this); }
@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()); } }
private void addGroupToBuilder(CollectionSetBuilder builder, Resource resource, AttributeGroup group) { for (CollectionAttribute attribute : group.getAttributes()) { String value; if(!attribute.shouldPersist(params)){ continue; } else if (attribute.getAttributeType() instanceof HexStringAttributeType) { value = ((SnmpAttribute) attribute).getValue().toHexString(); } else { value = attribute.getStringValue(); } builder.withAttribute(resource, group.getName(), attribute.getName(), value, attribute.getType()); } } }
/** {@inheritDoc} */ @Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { Map<String, String> dsNamesToRrdNames = new LinkedHashMap<String , String>(); for (CollectionAttribute a : group.getAttributes()) { if (a.getType().isNumeric()) { dsNamesToRrdNames.put(a.getName(), group.getName()); } } setBuilder(createBuilder(group.getResource(), group.getName(), group.getGroupType().getAttributeTypes())); ResourcePath path = ResourceTypeUtils.getResourcePathWithRepository(getRepository(), group.getResource().getPath()); m_resourceStorageDao.updateMetricToResourceMappings(path, dsNamesToRrdNames); } }
/** {@inheritDoc} */ @Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { Map<String, String> dsNamesToRrdNames = new LinkedHashMap<String , String>(); for (CollectionAttribute a : group.getAttributes()) { if (a.getType().isNumeric()) { dsNamesToRrdNames.put(a.getName(), group.getName()); } } setBuilder(createBuilder(group.getResource(), group.getName(), group.getGroupType().getAttributeTypes())); ResourcePath path = ResourceTypeUtils.getResourcePathWithRepository(getRepository(), group.getResource().getPath()); m_resourceStorageDao.updateMetricToResourceMappings(path, dsNamesToRrdNames); } }