use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.
the class DistributedLatencyCollectionResource method addAttribute.
/**
* Adds the given attribute into the collection for this resource
*
* @param attr The Attribute to add
*/
public void addAttribute(CollectionAttribute attr) {
AttributeGroup group = getGroup(attr.getAttributeType().getGroupType());
group.addAttribute(attr);
}
use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.
the class AliasedResource method visit.
/**
* {@inheritDoc}
*/
@Override
public void visit(CollectionSetVisitor visitor) {
visitor.visitResource(this);
for (Iterator<AttributeGroup> it = getGroups().iterator(); it.hasNext(); ) {
AttributeGroup aliased = new AliasedGroup(this, it.next());
aliased.visit(visitor);
}
visitor.completeResource(this);
}
use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.
the class LatencyCollectionResource method addAttribute.
/**
* Adds the given attribute into the collection for this resource
*
* @param attr The Attribute to add
*/
public void addAttribute(CollectionAttribute attr) {
AttributeGroup group = getGroup(attr.getAttributeType().getGroupType());
group.addAttribute(attr);
}
use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.
the class SnmpCollectionResource method visit.
/**
* {@inheritDoc}
*/
@Override
public void visit(final CollectionSetVisitor visitor) {
visitor.visitResource(this);
for (AttributeGroup group : getGroups()) {
group.visit(visitor);
}
visitor.completeResource(this);
}
use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.
the class CollectionSetUtils method getAttributesByNameByGroup.
public static Map<String, Map<String, CollectionAttribute>> getAttributesByNameByGroup(CollectionSet collectionSet) {
final Map<String, Map<String, CollectionAttribute>> attributesByNameByGroup = Maps.newHashMap();
collectionSet.visit(new AbstractCollectionSetVisitor() {
private String groupName = null;
private Map<String, CollectionAttribute> attributesByName = Maps.newHashMap();
@Override
public void visitGroup(AttributeGroup group) {
groupName = group.getName();
}
@Override
public void visitAttribute(CollectionAttribute attribute) {
attributesByName.put(attribute.getName(), attribute);
}
@Override
public void completeGroup(AttributeGroup group) {
attributesByNameByGroup.put(groupName, attributesByName);
attributesByName = Maps.newHashMap();
}
});
return attributesByNameByGroup;
}
Aggregations