Search in sources :

Example 6 with AttributeGroup

use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.

the class DistributedLatencyCollectionResource method getGroup.

/**
 * 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;
}
Also used : AttributeGroup(org.opennms.netmgt.collection.api.AttributeGroup)

Example 7 with AttributeGroup

use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.

the class LatencyCollectionResource method visit.

/**
 * {@inheritDoc}
 */
@Override
public void visit(CollectionSetVisitor visitor) {
    visitor.visitResource(this);
    for (AttributeGroup group : m_attributeGroups.values()) {
        group.visit(visitor);
    }
    visitor.completeResource(this);
}
Also used : AttributeGroup(org.opennms.netmgt.collection.api.AttributeGroup)

Example 8 with AttributeGroup

use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.

the class LatencyCollectionResource method getGroup.

/**
 * 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;
}
Also used : AttributeGroup(org.opennms.netmgt.collection.api.AttributeGroup)

Example 9 with AttributeGroup

use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.

the class AbstractCollectionResource method getGroup.

/**
 * 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;
}
Also used : AttributeGroup(org.opennms.netmgt.collection.api.AttributeGroup)

Example 10 with AttributeGroup

use of org.opennms.netmgt.collection.api.AttributeGroup in project opennms by OpenNMS.

the class CollectCommand method printCollectionSet.

private static void printCollectionSet(CollectionSet collectionSet) {
    AtomicBoolean didPrintAttribute = new AtomicBoolean(false);
    collectionSet.visit(new AbstractCollectionSetVisitor() {

        @Override
        public void visitResource(CollectionResource resource) {
            System.out.printf("%s\n", resource);
        }

        @Override
        public void visitGroup(AttributeGroup group) {
            System.out.printf("\tGroup: %s\n", group.getName());
        }

        @Override
        public void visitAttribute(CollectionAttribute attribute) {
            System.out.printf("\t\t%s\n", attribute);
            didPrintAttribute.set(true);
        }
    });
    if (!didPrintAttribute.get()) {
        System.out.println("(Empty collection set)");
    }
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CollectionAttribute(org.opennms.netmgt.collection.api.CollectionAttribute) CollectionResource(org.opennms.netmgt.collection.api.CollectionResource) AttributeGroup(org.opennms.netmgt.collection.api.AttributeGroup) AbstractCollectionSetVisitor(org.opennms.netmgt.collection.support.AbstractCollectionSetVisitor)

Aggregations

AttributeGroup (org.opennms.netmgt.collection.api.AttributeGroup)17 CollectionAttribute (org.opennms.netmgt.collection.api.CollectionAttribute)4 CollectionResource (org.opennms.netmgt.collection.api.CollectionResource)3 AbstractCollectionSetVisitor (org.opennms.netmgt.collection.support.AbstractCollectionSetVisitor)3 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 CollectionSetVisitor (org.opennms.netmgt.collection.api.CollectionSetVisitor)1 TimeKeeper (org.opennms.netmgt.collection.api.TimeKeeper)1 AttributeGroupWrapper (org.opennms.netmgt.collection.support.AttributeGroupWrapper)1 CollectionAttributeWrapper (org.opennms.netmgt.collection.support.CollectionAttributeWrapper)1 CollectionResourceWrapper (org.opennms.netmgt.collection.support.CollectionResourceWrapper)1 CollectionSetVisitorWrapper (org.opennms.netmgt.collection.support.CollectionSetVisitorWrapper)1 ConstantTimeKeeper (org.opennms.netmgt.collection.support.ConstantTimeKeeper)1