Search in sources :

Example 21 with CollectionSetBuilder

use of org.opennms.netmgt.collection.support.builder.CollectionSetBuilder in project opennms by OpenNMS.

the class JMXCollector method collect.

@Override
public CollectionSet collect(CollectionAgent agent, Map<String, Object> map) {
    final Map<String, String> stringMap = JmxUtils.convertToUnmodifiableStringMap(map);
    final InetAddress ipaddr = agent.getAddress();
    final JmxCollection jmxCollection = (JmxCollection) map.get(JMX_COLLECTION_KEY);
    final MBeanServer mBeanServer = (MBeanServer) map.get(JMX_MBEAN_SERVER_KEY);
    final String collectionName = ParameterMap.getKeyedString(map, ParameterName.COLLECTION.toString(), serviceName);
    final String port = ParameterMap.getKeyedString(map, ParameterName.PORT.toString(), null);
    final String friendlyName = ParameterMap.getKeyedString(map, ParameterName.FRIENDLY_NAME.toString(), port);
    final String collDir = JmxUtils.getCollectionDirectory(stringMap, friendlyName, serviceName);
    final int retries = ParameterMap.getKeyedInteger(map, ParameterName.RETRY.toString(), 3);
    InetAddress ipAddr = agent.getAddress();
    int nodeID = agent.getNodeId();
    // Retrieve the name of the JMX data collector
    final String hostAddress = InetAddressUtils.str(ipAddr);
    LOG.debug("initialize: InetAddress={}, collectionName={}", hostAddress, collectionName);
    JMXNodeInfo nodeInfo = new JMXNodeInfo(nodeID);
    LOG.debug("nodeInfo: {} {} {}", hostAddress, nodeID, agent);
    /*
         * Retrieve list of MBean objects to be collected from the
         * remote agent which are to be stored in the node-level RRD file.
         * These objects pertain to the node itself not any individual
         * interfaces.
         */
    Map<String, List<Attrib>> attrMap = JMXDataCollectionConfigDao.getAttributeMap(jmxCollection, serviceName(), hostAddress);
    nodeInfo.setAttributeMap(attrMap);
    Map<String, JMXDataSource> dsList = buildDataSourceList(collectionName, attrMap);
    nodeInfo.setDsMap(dsList);
    nodeInfo.setMBeans(JMXDataCollectionConfigDao.getMBeanInfo(jmxCollection));
    // Metrics collected from JMX are currently modeled as node level resources,
    // but live in a sub-directory set to the service name
    final NodeLevelResource nodeResource = new NodeLevelResource(agent.getNodeId(), collDir);
    // This parent resource used for generic resource
    final NodeLevelResource parentResource = new NodeLevelResource(agent.getNodeId());
    // Used to gather the results
    final CollectionSetBuilder collectionSetBuilder = new CollectionSetBuilder(agent);
    LOG.debug("connecting to {} on node ID {}", InetAddressUtils.str(ipaddr), nodeInfo.getNodeId());
    try {
        // create config for JmxCollector
        final JmxCollectorConfig config = new JmxCollectorConfig();
        config.setAgentAddress(InetAddressUtils.str(ipaddr));
        config.setConnectionName(getConnectionName());
        config.setRetries(retries);
        config.setServiceProperties(stringMap);
        config.setJmxCollection(jmxCollection);
        final DefaultJmxCollector jmxCollector = new DefaultJmxCollector();
        jmxCollector.collect(config, mBeanServer, new JmxSampleProcessor() {

            @Override
            public void process(JmxAttributeSample attributeSample, ObjectName objectName) {
                final String mbeanObjectName = attributeSample.getMbean().getObjectname();
                final String attributeName = attributeSample.getCollectedAttribute().getName();
                final String dsKey = mbeanObjectName + "|" + attributeName;
                final JMXDataSource ds = nodeInfo.getDsMap().get(dsKey);
                if (ds == null) {
                    LOG.info("Could not find datasource for {}. Skipping.", dsKey);
                    return;
                }
                String resourceType = attributeSample.getMbean().getResourceType();
                if (resourceType != null) {
                    final String parsedObjectName = fixGroupName(objectName.getCanonicalName());
                    final Resource resource = new DeferredGenericTypeResource(parentResource, resourceType, parsedObjectName);
                    addNumericAttributeToCollectionSet(ds, attributeSample, resource);
                    addStringAttributesToCollectionSet(ds, attributeSample, resource, objectName);
                } else {
                    addNumericAttributeToCollectionSet(ds, attributeSample, nodeResource);
                }
            }

            @Override
            public void process(JmxCompositeSample compositeSample, ObjectName objectName) {
                final String mbeanObjectName = compositeSample.getMbean().getObjectname();
                final String attributeName = compositeSample.getCollectedAttribute().getName();
                final String dsKey = mbeanObjectName + "|" + attributeName + "|" + compositeSample.getCompositeKey();
                final JMXDataSource ds = nodeInfo.getDsMap().get(dsKey);
                if (ds == null) {
                    LOG.info("Could not find datasource for {}. Skipping.", dsKey);
                    return;
                }
                String resourceType = compositeSample.getMbean().getResourceType();
                if (resourceType != null) {
                    final String parsedObjectName = fixGroupName(objectName.getCanonicalName());
                    final Resource resource = new DeferredGenericTypeResource(parentResource, resourceType, parsedObjectName);
                    addNumericAttributeToCollectionSet(ds, compositeSample, resource);
                    addStringAttributesToCollectionSet(ds, compositeSample, resource, objectName);
                } else {
                    addNumericAttributeToCollectionSet(ds, compositeSample, nodeResource);
                }
            }

            private void addStringAttributesToCollectionSet(JMXDataSource ds, AbstractJmxSample sample, Resource resource, ObjectName objectName) {
                final String groupName = fixGroupName(JmxUtils.getGroupName(stringMap, sample.getMbean()));
                final String domain = objectName.getDomain();
                final Hashtable<String, String> properties = objectName.getKeyPropertyList();
                properties.forEach((key, value) -> collectionSetBuilder.withStringAttribute(resource, groupName, key, value));
                if (domain != null) {
                    collectionSetBuilder.withStringAttribute(resource, groupName, "domain", objectName.getDomain());
                }
            }

            private void addNumericAttributeToCollectionSet(JMXDataSource ds, AbstractJmxSample sample, Resource resource) {
                final String groupName = fixGroupName(JmxUtils.getGroupName(stringMap, sample.getMbean()));
                // Only numeric data comes back from JMX in data collection
                final String valueAsString = sample.getCollectedValueAsString();
                final Double value = NumericAttributeUtils.parseNumericValue(valueAsString);
                // Construct the metric identifier (used by NRTG)
                String metricId = groupName;
                metricId = metricId.replace("_type_", ":type=");
                metricId = metricId.replace("_", ".");
                metricId = metricId.concat(".");
                metricId = metricId.concat(ds.getName());
                metricId = "JMX_".concat(metricId);
                collectionSetBuilder.withIdentifiedNumericAttribute(resource, groupName, ds.getName(), value, ds.getType(), metricId);
            }
        });
    } catch (final Exception e) {
        LOG.debug("{} Collector.collect: IOException while collecting address: {}", serviceName, agent.getAddress(), e);
    }
    return collectionSetBuilder.build();
}
Also used : CollectionAgent(org.opennms.netmgt.collection.api.CollectionAgent) AlphaNumeric(org.opennms.core.utils.AlphaNumeric) JmxCollection(org.opennms.netmgt.config.collectd.jmx.JmxCollection) AbstractJmxSample(org.opennms.netmgt.jmx.samples.AbstractJmxSample) LoggerFactory(org.slf4j.LoggerFactory) HashMap(java.util.HashMap) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) DeferredGenericTypeResource(org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource) NumericAttributeUtils(org.opennms.netmgt.collection.support.NumericAttributeUtils) InetAddress(java.net.InetAddress) DefaultJmxCollector(org.opennms.netmgt.jmx.impl.DefaultJmxCollector) MBeanServer(org.opennms.netmgt.config.jmx.MBeanServer) Map(java.util.Map) JmxUtils(org.opennms.netmgt.jmx.JmxUtils) JMXDataCollectionConfigDao(org.opennms.netmgt.config.JMXDataCollectionConfigDao) SimpleEntry(java.util.AbstractMap.SimpleEntry) Hashtable(java.util.Hashtable) ParameterMap(org.opennms.core.utils.ParameterMap) JmxCollectorConfig(org.opennms.netmgt.jmx.JmxCollectorConfig) JmxCompositeSample(org.opennms.netmgt.jmx.samples.JmxCompositeSample) Resource(org.opennms.netmgt.collection.support.builder.Resource) JmxAttributeSample(org.opennms.netmgt.jmx.samples.JmxAttributeSample) Logger(org.slf4j.Logger) InetAddressUtils(org.opennms.core.utils.InetAddressUtils) AbstractRemoteServiceCollector(org.opennms.netmgt.collection.api.AbstractRemoteServiceCollector) ObjectName(javax.management.ObjectName) JmxConfigDao(org.opennms.netmgt.dao.jmx.JmxConfigDao) Collectors(java.util.stream.Collectors) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource) BeanUtils(org.opennms.core.spring.BeanUtils) Objects(java.util.Objects) List(java.util.List) JmxSampleProcessor(org.opennms.netmgt.jmx.JmxSampleProcessor) Stream(java.util.stream.Stream) ParameterName(org.opennms.netmgt.collection.api.ServiceParameters.ParameterName) Attrib(org.opennms.netmgt.config.collectd.jmx.Attrib) CollectionSet(org.opennms.netmgt.collection.api.CollectionSet) JmxConnectors(org.opennms.netmgt.jmx.connection.JmxConnectors) Collections(java.util.Collections) RrdRepository(org.opennms.netmgt.rrd.RrdRepository) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource) JmxCollection(org.opennms.netmgt.config.collectd.jmx.JmxCollection) AbstractJmxSample(org.opennms.netmgt.jmx.samples.AbstractJmxSample) List(java.util.List) MBeanServer(org.opennms.netmgt.config.jmx.MBeanServer) DefaultJmxCollector(org.opennms.netmgt.jmx.impl.DefaultJmxCollector) JmxCollectorConfig(org.opennms.netmgt.jmx.JmxCollectorConfig) Hashtable(java.util.Hashtable) JmxSampleProcessor(org.opennms.netmgt.jmx.JmxSampleProcessor) JmxCompositeSample(org.opennms.netmgt.jmx.samples.JmxCompositeSample) DeferredGenericTypeResource(org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource) Resource(org.opennms.netmgt.collection.support.builder.Resource) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource) ObjectName(javax.management.ObjectName) DeferredGenericTypeResource(org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource) JmxAttributeSample(org.opennms.netmgt.jmx.samples.JmxAttributeSample) InetAddress(java.net.InetAddress)

Example 22 with CollectionSetBuilder

use of org.opennms.netmgt.collection.support.builder.CollectionSetBuilder in project opennms by OpenNMS.

the class TcaCollectionHandler method collect.

/**
 * Collect.
 *
 * @throws CollectionException the collection exception
 */
protected CollectionSet collect() throws CollectionException {
    try {
        CollectionSetBuilder builder = new CollectionSetBuilder(m_agent);
        TcaData tracker = new TcaData(m_agent.getAddress());
        CompletableFuture<TcaData> future = m_locationAwareSnmpClient.walk(m_agent.getAgentConfig(), tracker).withDescription("TcaCollector for " + m_agent.getHostAddress()).withLocation(m_agent.getLocationName()).execute();
        LOG.debug("collect: successfully instantiated TCA Collector for {}", m_agent.getHostAddress());
        future.get();
        LOG.info("collect: node TCA query for address {} complete.", m_agent.getHostAddress());
        process(tracker, builder);
        return builder.build();
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new CollectionUnknown("Collection of node TCA data for interface " + m_agent.getHostAddress() + " interrupted: " + e, e);
    } catch (ExecutionException e) {
        final Throwable cause = e.getCause();
        if (cause != null && cause instanceof RequestTimedOutException) {
            throw new CollectionUnknown(String.format("No response received when remotely collecting TCA data" + " for interface %s at location %s interrupted.", m_agent.getHostAddress(), m_agent.getLocationName()), e);
        } else if (cause != null && cause instanceof RequestRejectedException) {
            throw new CollectionUnknown(String.format("The request to remotely collect TCA data" + " for interface %s at location %s was rejected.", m_agent.getHostAddress(), m_agent.getLocationName()), e);
        }
        throw new CollectionException(String.format("Unexpected exception when collecting TCA data for interface %s at location %s.", m_agent.getHostAddress(), m_agent.getLocationName()), e);
    }
}
Also used : RequestTimedOutException(org.opennms.core.rpc.api.RequestTimedOutException) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) RequestRejectedException(org.opennms.core.rpc.api.RequestRejectedException) CollectionException(org.opennms.netmgt.collection.api.CollectionException) CollectionUnknown(org.opennms.netmgt.collection.api.CollectionUnknown) ExecutionException(java.util.concurrent.ExecutionException)

Example 23 with CollectionSetBuilder

use of org.opennms.netmgt.collection.support.builder.CollectionSetBuilder in project opennms by OpenNMS.

the class WsManCollector method collect.

@Override
public CollectionSet collect(CollectionAgent agent, Map<String, Object> parameters) throws CollectionException {
    LOG.debug("collect({}, {}, {})", agent, parameters);
    final WsmanAgentConfig config = (WsmanAgentConfig) parameters.get(WSMAN_AGENT_CONFIG_KEY);
    final Groups groups = (Groups) parameters.get(WSMAN_GROUPS_KEY);
    final WSManEndpoint endpoint = WSManConfigDao.getEndpoint(config, agent.getAddress());
    final WSManClient client = m_factory.getClient(endpoint);
    final CollectionSetBuilder collectionSetBuilder = new CollectionSetBuilder(agent);
    if (LOG.isDebugEnabled()) {
        String groupNames = groups.getGroups().stream().map(Group::getName).collect(Collectors.joining(", "));
        LOG.debug("Collecting attributes on {} from groups: {}", agent, groupNames);
    }
    for (Group group : groups.getGroups()) {
        try {
            collectGroupUsing(group, agent, client, config.getRetry() != null ? config.getRetry() : 0, collectionSetBuilder);
        } catch (InvalidResourceURI e) {
            LOG.info("Resource URI {} in group named {} is not available on {}.", group.getResourceUri(), group.getName(), agent);
        } catch (WSManException e) {
            // failed, and abort trying to collect any other groups
            throw new CollectionException(String.format("Collecting group '%s' on %s failed with '%s'. See logs for details.", group.getName(), agent, e.getMessage()), e);
        }
    }
    return collectionSetBuilder.build();
}
Also used : WSManException(org.opennms.core.wsman.exceptions.WSManException) Group(org.opennms.netmgt.config.wsman.Group) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) WSManEndpoint(org.opennms.core.wsman.WSManEndpoint) Groups(org.opennms.netmgt.config.wsman.Groups) CollectionException(org.opennms.netmgt.collection.api.CollectionException) WsmanAgentConfig(org.opennms.netmgt.config.wsman.WsmanAgentConfig) WSManClient(org.opennms.core.wsman.WSManClient) InvalidResourceURI(org.opennms.core.wsman.exceptions.InvalidResourceURI)

Example 24 with CollectionSetBuilder

use of org.opennms.netmgt.collection.support.builder.CollectionSetBuilder in project opennms by OpenNMS.

the class WSManCollectorTest method canCollectFromMultipleRecordsUsingFilter.

@Test
public void canCollectFromMultipleRecordsUsingFilter() {
    Group group = new Group();
    group.setName("DCIM_NumericSensor");
    Attrib attr = new Attrib();
    attr.setName("CurrentReading");
    attr.setAlias("sysBoardInletTemp");
    attr.setFilter("#ElementName == 'System Board Inlet Temp'");
    attr.setType(AttributeType.GAUGE);
    group.addAttrib(attr);
    attr = new Attrib();
    attr.setName("CurrentReading");
    attr.setAlias("sysBoardExhaustTemp");
    attr.setFilter("#ElementName == 'System Board Exhaust Temp'");
    attr.setType(AttributeType.GAUGE);
    group.addAttrib(attr);
    CollectionAgent agent = mock(CollectionAgent.class);
    when(agent.getStorageResourcePath()).thenReturn(ResourcePath.get());
    CollectionSetBuilder builder = new CollectionSetBuilder(agent);
    Supplier<Resource> resourceSupplier = () -> mock(NodeLevelResource.class);
    XMLTag xmlTag = XMLDoc.newDocument(true).addRoot("body").addTag("DCIM_NumericSensor").addTag("CurrentReading").setText("260").addTag("ElementName").setText("System Board Inlet Temp").gotoRoot().addTag("DCIM_NumericSensor").addTag("CurrentReading").setText("370").addTag("ElementName").setText("System Board Exhaust Temp");
    List<Node> nodes = xmlTag.gotoRoot().getChildElement().stream().map(el -> (Node) el).collect(Collectors.toList());
    WsManCollector.processEnumerationResults(group, builder, resourceSupplier, nodes);
    // Verify
    Map<String, CollectionAttribute> attributesByName = CollectionSetUtils.getAttributesByName(builder.build());
    assertEquals(Double.valueOf(260), attributesByName.get("sysBoardInletTemp").getNumericValue());
    assertEquals(Double.valueOf(370), attributesByName.get("sysBoardExhaustTemp").getNumericValue());
}
Also used : StorageStrategy(org.opennms.netmgt.config.datacollection.StorageStrategy) CollectionAgent(org.opennms.netmgt.collection.api.CollectionAgent) WSManDataCollectionConfigDao(org.opennms.netmgt.dao.WSManDataCollectionConfigDao) Arrays(java.util.Arrays) CollectionStatus(org.opennms.netmgt.collection.api.CollectionStatus) ResourceType(org.opennms.netmgt.config.datacollection.ResourceType) WSManConfigDao(org.opennms.netmgt.dao.WSManConfigDao) Supplier(java.util.function.Supplier) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) XMLDoc(com.mycila.xmltool.XMLDoc) SiblingColumnStorageStrategy(org.opennms.netmgt.dao.support.SiblingColumnStorageStrategy) CollectionException(org.opennms.netmgt.collection.api.CollectionException) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Node(org.w3c.dom.Node) AttributeType(org.opennms.netmgt.collection.api.AttributeType) GenericTypeResource(org.opennms.netmgt.collection.support.builder.GenericTypeResource) Collection(org.opennms.netmgt.config.wsman.Collection) Attrib(org.opennms.netmgt.config.wsman.Attrib) OnmsNode(org.opennms.netmgt.model.OnmsNode) Resource(org.opennms.netmgt.collection.support.builder.Resource) NodeDao(org.opennms.netmgt.dao.api.NodeDao) InetAddressUtils(org.opennms.core.utils.InetAddressUtils) CollectionAttribute(org.opennms.netmgt.collection.api.CollectionAttribute) WSManClientFactory(org.opennms.core.wsman.WSManClientFactory) XMLTag(com.mycila.xmltool.XMLTag) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Group(org.opennms.netmgt.config.wsman.Group) Collectors(java.util.stream.Collectors) Maps(com.google.common.collect.Maps) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource) Sets(com.google.common.collect.Sets) Definition(org.opennms.netmgt.config.wsman.Definition) Matchers.any(org.mockito.Matchers.any) PersistenceSelectorStrategy(org.opennms.netmgt.config.datacollection.PersistenceSelectorStrategy) CollectionInitializationException(org.opennms.netmgt.collection.api.CollectionInitializationException) List(java.util.List) PersistAllSelectorStrategy(org.opennms.netmgt.collection.support.PersistAllSelectorStrategy) Assert.assertFalse(org.junit.Assert.assertFalse) CollectionSetUtils(org.opennms.core.collection.test.CollectionSetUtils) ResourcePath(org.opennms.netmgt.model.ResourcePath) CollectionSet(org.opennms.netmgt.collection.api.CollectionSet) Parameter(org.opennms.netmgt.config.datacollection.Parameter) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Group(org.opennms.netmgt.config.wsman.Group) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) Node(org.w3c.dom.Node) OnmsNode(org.opennms.netmgt.model.OnmsNode) GenericTypeResource(org.opennms.netmgt.collection.support.builder.GenericTypeResource) Resource(org.opennms.netmgt.collection.support.builder.Resource) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource) XMLTag(com.mycila.xmltool.XMLTag) Attrib(org.opennms.netmgt.config.wsman.Attrib) CollectionAttribute(org.opennms.netmgt.collection.api.CollectionAttribute) CollectionAgent(org.opennms.netmgt.collection.api.CollectionAgent) Test(org.junit.Test)

Example 25 with CollectionSetBuilder

use of org.opennms.netmgt.collection.support.builder.CollectionSetBuilder in project opennms by OpenNMS.

the class WSManCollectorTest method canProcessEnumerationResults.

@Test
public void canProcessEnumerationResults() {
    Group group = new Group();
    group.setName("ComputerSystem");
    addAttribute(group, "PrimaryStatus", "GaugeWithValue", AttributeType.GAUGE);
    addAttribute(group, "!PrimaryStatus!", "GaugeWithoutValue", AttributeType.GAUGE);
    addAttribute(group, "ElementName", "StringWithValue", AttributeType.STRING);
    addAttribute(group, "!ElementName!", "StringWithoutValue", AttributeType.STRING);
    CollectionAgent agent = mock(CollectionAgent.class);
    when(agent.getStorageResourcePath()).thenReturn(ResourcePath.get());
    CollectionSetBuilder builder = new CollectionSetBuilder(agent);
    Supplier<Resource> resourceSupplier = () -> mock(NodeLevelResource.class);
    XMLTag xmlTag = XMLDoc.newDocument(true).addRoot("body").addTag("DCIM_ComputerSystem").addTag("ElementName").setText("Computer System").addTag("PrimaryStatus").setText("42.1").addTag("OtherIdentifyingInfo").setText("ANONYMIZED01").addTag("OtherIdentifyingInfo").setText("mainsystemchassis").addTag("OtherIdentifyingInfo").setText("ANONYMIZED02");
    List<Node> nodes = xmlTag.gotoRoot().getChildElement().stream().map(el -> (Node) el).collect(Collectors.toList());
    WsManCollector.processEnumerationResults(group, builder, resourceSupplier, nodes);
    // Verify
    Map<String, CollectionAttribute> attributesByName = CollectionSetUtils.getAttributesByName(builder.build());
    assertFalse("The CollectionSet should not contain attributes for missing values.", attributesByName.containsKey("GaugeWithoutValue"));
    assertFalse("The CollectionSet should not contain attributes for missing values.", attributesByName.containsKey("StringWithoutValue"));
    assertEquals(42.1, attributesByName.get("GaugeWithValue").getNumericValue().doubleValue(), 2);
    assertEquals("Computer System", attributesByName.get("StringWithValue").getStringValue());
}
Also used : StorageStrategy(org.opennms.netmgt.config.datacollection.StorageStrategy) CollectionAgent(org.opennms.netmgt.collection.api.CollectionAgent) WSManDataCollectionConfigDao(org.opennms.netmgt.dao.WSManDataCollectionConfigDao) Arrays(java.util.Arrays) CollectionStatus(org.opennms.netmgt.collection.api.CollectionStatus) ResourceType(org.opennms.netmgt.config.datacollection.ResourceType) WSManConfigDao(org.opennms.netmgt.dao.WSManConfigDao) Supplier(java.util.function.Supplier) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) XMLDoc(com.mycila.xmltool.XMLDoc) SiblingColumnStorageStrategy(org.opennms.netmgt.dao.support.SiblingColumnStorageStrategy) CollectionException(org.opennms.netmgt.collection.api.CollectionException) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Node(org.w3c.dom.Node) AttributeType(org.opennms.netmgt.collection.api.AttributeType) GenericTypeResource(org.opennms.netmgt.collection.support.builder.GenericTypeResource) Collection(org.opennms.netmgt.config.wsman.Collection) Attrib(org.opennms.netmgt.config.wsman.Attrib) OnmsNode(org.opennms.netmgt.model.OnmsNode) Resource(org.opennms.netmgt.collection.support.builder.Resource) NodeDao(org.opennms.netmgt.dao.api.NodeDao) InetAddressUtils(org.opennms.core.utils.InetAddressUtils) CollectionAttribute(org.opennms.netmgt.collection.api.CollectionAttribute) WSManClientFactory(org.opennms.core.wsman.WSManClientFactory) XMLTag(com.mycila.xmltool.XMLTag) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Group(org.opennms.netmgt.config.wsman.Group) Collectors(java.util.stream.Collectors) Maps(com.google.common.collect.Maps) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource) Sets(com.google.common.collect.Sets) Definition(org.opennms.netmgt.config.wsman.Definition) Matchers.any(org.mockito.Matchers.any) PersistenceSelectorStrategy(org.opennms.netmgt.config.datacollection.PersistenceSelectorStrategy) CollectionInitializationException(org.opennms.netmgt.collection.api.CollectionInitializationException) List(java.util.List) PersistAllSelectorStrategy(org.opennms.netmgt.collection.support.PersistAllSelectorStrategy) Assert.assertFalse(org.junit.Assert.assertFalse) CollectionSetUtils(org.opennms.core.collection.test.CollectionSetUtils) ResourcePath(org.opennms.netmgt.model.ResourcePath) CollectionSet(org.opennms.netmgt.collection.api.CollectionSet) Parameter(org.opennms.netmgt.config.datacollection.Parameter) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Group(org.opennms.netmgt.config.wsman.Group) CollectionAttribute(org.opennms.netmgt.collection.api.CollectionAttribute) CollectionSetBuilder(org.opennms.netmgt.collection.support.builder.CollectionSetBuilder) Node(org.w3c.dom.Node) OnmsNode(org.opennms.netmgt.model.OnmsNode) GenericTypeResource(org.opennms.netmgt.collection.support.builder.GenericTypeResource) Resource(org.opennms.netmgt.collection.support.builder.Resource) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource) XMLTag(com.mycila.xmltool.XMLTag) CollectionAgent(org.opennms.netmgt.collection.api.CollectionAgent) Test(org.junit.Test)

Aggregations

CollectionSetBuilder (org.opennms.netmgt.collection.support.builder.CollectionSetBuilder)31 NodeLevelResource (org.opennms.netmgt.collection.support.builder.NodeLevelResource)21 CollectionSet (org.opennms.netmgt.collection.api.CollectionSet)13 Test (org.junit.Test)10 CollectionAgent (org.opennms.netmgt.collection.api.CollectionAgent)10 CollectionException (org.opennms.netmgt.collection.api.CollectionException)10 GenericTypeResource (org.opennms.netmgt.collection.support.builder.GenericTypeResource)9 Resource (org.opennms.netmgt.collection.support.builder.Resource)9 ResourcePath (org.opennms.netmgt.model.ResourcePath)9 AttributeType (org.opennms.netmgt.collection.api.AttributeType)8 List (java.util.List)6 Date (java.util.Date)5 Map (java.util.Map)5 Collectors (java.util.stream.Collectors)5 InetAddressUtils (org.opennms.core.utils.InetAddressUtils)5 DeferredGenericTypeResource (org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource)5 Group (org.opennms.netmgt.config.wsman.Group)5 Maps (com.google.common.collect.Maps)4 Sets (com.google.common.collect.Sets)4 XMLDoc (com.mycila.xmltool.XMLDoc)4