/** * <p>getName</p> * * @return a {@link java.lang.String} object. */ @Override public String getName() { return m_group.getName(); }
public AttributeGroupWrapper(AttributeGroup wrapped) { super(wrapped.getResource(), wrapped.getGroupType()); m_wrapped = wrapped; }
/** {@inheritDoc} */ @Override public Collection<CollectionAttribute> getAttributes() { return m_wrapped.getAttributes(); }
/** {@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); } }
@Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { setBuilder(createBuilder(group.getResource(), group.getName(), group.getGroupType().getAttributeTypes())); } }
/** {@inheritDoc} */ @Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { // Set the builder before any calls to persistNumericAttribute are made CollectionResource resource = group.getResource(); m_builder = new NewtsPersistOperationBuilder(m_newtsWriter, m_context, m_repository, resource, group.getName()); if (resource.getTimeKeeper() != null) { m_builder.setTimeKeeper(resource.getTimeKeeper()); } setBuilder(m_builder); } }
@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 addAttribute(CollectionAttribute attr) { m_wrapped.addAttribute(attr); }
/** {@inheritDoc} */ @Override public void visit(CollectionSetVisitor visitor) { m_wrapped.visit(visitor); }
/** {@inheritDoc} */ @Override public CollectionResource getResource() { return m_wrapped.getResource(); }
/** * <p>Constructor for AliasedGroup.</p> * * @param resource a {@link org.opennms.netmgt.collection.api.CollectionResource} object. * @param group a {@link org.opennms.netmgt.collection.api.AttributeGroup} object. */ public AliasedGroup(SnmpCollectionResource resource, AttributeGroup group) { super(resource, group.getGroupType()); m_group = group; }
/** * Finds, or creates, and returns the AttributeGroup for the given group Type * * @param groupType a {@link org.opennms.netmgt.collection.api.AttributeGroupType} object. * @return a {@link org.opennms.netmgt.collection.api.AttributeGroup} object. */ public final AttributeGroup getGroup(AttributeGroupType groupType) { AttributeGroup group = m_attributeGroups.get(groupType); if (group == null) { group = new AttributeGroup(this, groupType); m_attributeGroups.put(groupType, group); } return group; }
/** {@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()) { // Set the builder before any calls to persistNumericAttribute are made CollectionResource resource = group.getResource(); m_builder = new NewtsPersistOperationBuilder(m_newtsWriter, m_context, m_repository, resource, group.getName()); if (resource.getTimeKeeper() != null) { m_builder.setTimeKeeper(resource.getTimeKeeper()); } setBuilder(m_builder); } }
/** * <p>addAttribute</p> * * @param attr a {@link org.opennms.netmgt.collectd.SnmpAttribute} object. */ public void addAttribute(SnmpAttribute attr) { m_group.addAttribute(attr); }
/** {@inheritDoc} */ @Override public void visit(CollectionSetVisitor visitor) { visitor.visitResource(this); for (AttributeGroup group: m_attributeGroups.values()) { group.visit(visitor); } visitor.completeResource(this); }
/** * <p>getGroupType</p> * * @return a {@link org.opennms.netmgt.collection.api.AttributeGroupType} object. */ @Override public AttributeGroupType getGroupType() { return m_group.getGroupType(); }
/** * Finds, or creates, and returns the AttributeGroup for the given group Type * * @param groupType a {@link org.opennms.netmgt.collection.api.AttributeGroupType} object. * @return a {@link org.opennms.netmgt.collection.api.AttributeGroup} object. */ public final AttributeGroup getGroup(AttributeGroupType groupType) { AttributeGroup group = m_attributeGroups.get(groupType); if (group == null) { group = new AttributeGroup(this, groupType); m_attributeGroups.put(groupType, group); } return group; }
/** {@inheritDoc} */ @Override public String getName() { return m_wrapped.getName(); }