From 15df160ecdc5d4f3647cbbb636f4290f7bee3d3b Mon Sep 17 00:00:00 2001 From: Christian Pape Date: Thu, 29 Aug 2024 13:16:37 +0200 Subject: [PATCH] NMS-16486: Renamed NodeMetadataCache to NodeInfoCache --- .../flows/elastic/AggregatedFlowQueryIT.java | 14 +++++------ .../netmgt/flows/elastic/FlowQueryIT.java | 14 +++++------ .../flows/elastic/NodeIdentificationIT.java | 14 +++++------ .../processing/impl/DocumentEnricherImpl.java | 14 +++++------ .../OSGI-INF/blueprint/blueprint.xml | 4 ++-- .../MockDocumentEnricherFactory.java | 14 +++++------ ...eMetadataCache.java => NodeInfoCache.java} | 2 +- ...aCacheImpl.java => NodeInfoCacheImpl.java} | 16 +++++++++---- .../OSGI-INF/blueprint/blueprint.xml | 23 ++++--------------- .../common/NetflowTelemetryAdapter.java | 10 ++++---- .../adapter/ipfix/IpfixTelemetryAdapter.java | 4 ++-- .../ipfix/IpfixTelemetryAdapterFactory.java | 10 ++++---- .../netflow5/Netflow5TelemetryAdapter.java | 4 ++-- .../Netflow5TelemetryAdapterFactory.java | 10 ++++---- .../netflow9/Netflow9TelemetryAdapter.java | 4 ++-- .../Netflow9TelemetryAdapterFactory.java | 10 ++++---- .../OSGI-INF/blueprint/blueprint.xml | 8 +++---- 17 files changed, 81 insertions(+), 94 deletions(-) rename features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/{NodeMetadataCache.java => NodeInfoCache.java} (97%) rename features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/{NodeMetadataCacheImpl.java => NodeInfoCacheImpl.java} (90%) diff --git a/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/AggregatedFlowQueryIT.java b/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/AggregatedFlowQueryIT.java index 9a8d08be2545..9bf904bf27b0 100644 --- a/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/AggregatedFlowQueryIT.java +++ b/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/AggregatedFlowQueryIT.java @@ -100,7 +100,8 @@ import org.opennms.netmgt.flows.persistence.FlowDocumentBuilder; import org.opennms.netmgt.flows.processing.FlowBuilder; import org.opennms.netmgt.flows.processing.impl.DocumentMangler; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCacheImpl; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCacheImpl; import com.codahale.metrics.MetricRegistry; import com.google.common.collect.ImmutableSet; @@ -169,17 +170,14 @@ public void setUp() throws MalformedURLException, ExecutionException, Interrupte new RuleBuilder().withName("https").withSrcPort("443").withProtocol("tcp,udp").build()), FilterService.NOOP); - final NodeMetadataCacheImpl nodeMetadataCache = new NodeMetadataCacheImpl( + final NodeInfoCache nodeInfoCache = new NodeInfoCacheImpl( new CacheConfigBuilder() .withName("nodeInfoCache") .withMaximumSize(1000) .withExpireAfterWrite(300) + .withExpireAfterRead(300) .build(), - new CacheConfigBuilder() - .withName("nodeMetadataCache") - .withMaximumSize(1000) - .withExpireAfterWrite(300) - .build(), + true, new MetricRegistry(), new MockNodeDao(), new MockIpInterfaceDao(), @@ -189,7 +187,7 @@ public void setUp() throws MalformedURLException, ExecutionException, Interrupte classificationEngine, 0, new DocumentMangler(new ScriptEngineManager()), - nodeMetadataCache); + nodeInfoCache); // The repository should be empty assertThat(smartQueryService.getFlowCount(Collections.singletonList(new TimeRangeFilter(0, System.currentTimeMillis()))).get(), equalTo(0L)); diff --git a/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/FlowQueryIT.java b/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/FlowQueryIT.java index c5af389368d0..e71cc237559d 100644 --- a/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/FlowQueryIT.java +++ b/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/FlowQueryIT.java @@ -101,7 +101,8 @@ import org.opennms.netmgt.flows.filter.api.SnmpInterfaceIdFilter; import org.opennms.netmgt.flows.filter.api.TimeRangeFilter; import org.opennms.netmgt.flows.processing.impl.DocumentMangler; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCacheImpl; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCacheImpl; import com.codahale.metrics.MetricRegistry; import com.google.common.collect.ImmutableSet; @@ -144,17 +145,14 @@ public void setUp() throws MalformedURLException, ExecutionException, Interrupte new RuleBuilder().withName("http").withSrcPort("80").withProtocol("tcp,udp").build(), new RuleBuilder().withName("https").withSrcPort("443").withProtocol("tcp,udp").build()), FilterService.NOOP); - final NodeMetadataCacheImpl nodeMetadataCache = new NodeMetadataCacheImpl( + final NodeInfoCache nodeInfoCache = new NodeInfoCacheImpl( new CacheConfigBuilder() .withName("nodeInfoCache") .withMaximumSize(1000) .withExpireAfterWrite(300) + .withExpireAfterRead(300) .build(), - new CacheConfigBuilder() - .withName("nodeMetadataCache") - .withMaximumSize(1000) - .withExpireAfterWrite(300) - .build(), + true, new MetricRegistry(), new MockNodeDao(), new MockIpInterfaceDao(), @@ -165,7 +163,7 @@ public void setUp() throws MalformedURLException, ExecutionException, Interrupte classificationEngine, 0, new DocumentMangler(new ScriptEngineManager()), - nodeMetadataCache); + nodeInfoCache); final RawIndexInitializer initializer = new RawIndexInitializer(client, settings); diff --git a/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/NodeIdentificationIT.java b/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/NodeIdentificationIT.java index 187d5e647e96..87ab55af67c2 100644 --- a/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/NodeIdentificationIT.java +++ b/features/flows/itests/src/test/java/org/opennms/netmgt/flows/elastic/NodeIdentificationIT.java @@ -62,7 +62,8 @@ import org.opennms.netmgt.model.NetworkBuilder; import org.opennms.netmgt.model.OnmsMetaData; import org.opennms.netmgt.model.OnmsNode; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCacheImpl; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCacheImpl; import org.opennms.test.JUnitConfigurationEnvironment; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; @@ -116,17 +117,14 @@ public void before() { @Test public void testSomething() throws InterruptedException { final ClassificationEngine classificationEngine = new DefaultClassificationEngine(() -> Collections.emptyList(), FilterService.NOOP); - final NodeMetadataCacheImpl nodeMetadataCache = new NodeMetadataCacheImpl( + final NodeInfoCache nodeInfoCache = new NodeInfoCacheImpl( new CacheConfigBuilder() .withName("nodeInfoCache") .withMaximumSize(1000) .withExpireAfterWrite(300) + .withExpireAfterRead(300) .build(), - new CacheConfigBuilder() - .withName("nodeMetadataCache") - .withMaximumSize(1000) - .withExpireAfterWrite(300) - .build(), + true, new MetricRegistry(), databasePopulator.getNodeDao(), databasePopulator.getIpInterfaceDao(), @@ -138,7 +136,7 @@ public void testSomething() throws InterruptedException { classificationEngine, 0, new DocumentMangler(new ScriptEngineManager()), - nodeMetadataCache); + nodeInfoCache); final TestFlow testFlow = new TestFlow(); testFlow.setSrcAddr("1.1.1.1"); diff --git a/features/flows/processing/src/main/java/org/opennms/netmgt/flows/processing/impl/DocumentEnricherImpl.java b/features/flows/processing/src/main/java/org/opennms/netmgt/flows/processing/impl/DocumentEnricherImpl.java index 5bf0886a71c8..accc567c73ca 100644 --- a/features/flows/processing/src/main/java/org/opennms/netmgt/flows/processing/impl/DocumentEnricherImpl.java +++ b/features/flows/processing/src/main/java/org/opennms/netmgt/flows/processing/impl/DocumentEnricherImpl.java @@ -45,7 +45,7 @@ import org.opennms.netmgt.flows.classification.ClassificationRequest; import org.opennms.netmgt.flows.classification.persistence.api.Protocols; import org.opennms.netmgt.flows.processing.enrichment.EnrichedFlow; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,7 +56,7 @@ public class DocumentEnricherImpl { private final ClassificationEngine classificationEngine; - private final NodeMetadataCache nodeMetadataCache; + private final NodeInfoCache nodeInfoCache; private final long clockSkewCorrectionThreshold; @@ -66,10 +66,10 @@ public DocumentEnricherImpl(final SessionUtils sessionUtils, final ClassificationEngine classificationEngine, final long clockSkewCorrectionThreshold, final DocumentMangler mangler, - final NodeMetadataCache nodeMetadataCache) { + final NodeInfoCache nodeInfoCache) { this.sessionUtils = Objects.requireNonNull(sessionUtils); this.classificationEngine = Objects.requireNonNull(classificationEngine); - this.nodeMetadataCache = Objects.requireNonNull(nodeMetadataCache); + this.nodeInfoCache = Objects.requireNonNull(nodeInfoCache); this.clockSkewCorrectionThreshold = clockSkewCorrectionThreshold; this.mangler = Objects.requireNonNull(mangler); } @@ -91,12 +91,12 @@ public List enrich(final Collection flows, final FlowSource document.setLocation(source.getLocation()); // Node data - nodeMetadataCache.getNodeInfoFromCache(source.getLocation(), source.getSourceAddress(), source.getContextKey(), flow.getNodeIdentifier()).ifPresent(document::setExporterNodeInfo); + nodeInfoCache.getNodeInfoFromCache(source.getLocation(), source.getSourceAddress(), source.getContextKey(), flow.getNodeIdentifier()).ifPresent(document::setExporterNodeInfo); if (flow.getDstAddr() != null) { - nodeMetadataCache.getNodeInfoFromCache(source.getLocation(), flow.getDstAddr(), null, null).ifPresent(document::setSrcNodeInfo); + nodeInfoCache.getNodeInfoFromCache(source.getLocation(), flow.getDstAddr(), null, null).ifPresent(document::setSrcNodeInfo); } if (flow.getSrcAddr() != null) { - nodeMetadataCache.getNodeInfoFromCache(source.getLocation(), flow.getSrcAddr(), null, null).ifPresent(document::setDstNodeInfo); + nodeInfoCache.getNodeInfoFromCache(source.getLocation(), flow.getSrcAddr(), null, null).ifPresent(document::setDstNodeInfo); } // Locality diff --git a/features/flows/processing/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/features/flows/processing/src/main/resources/OSGI-INF/blueprint/blueprint.xml index 25b92935345e..dd6cc7f0412b 100644 --- a/features/flows/processing/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/features/flows/processing/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -57,7 +57,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/features/flows/processing/src/test/java/org/opennms/netmgt/flows/processing/enrichment/MockDocumentEnricherFactory.java b/features/flows/processing/src/test/java/org/opennms/netmgt/flows/processing/enrichment/MockDocumentEnricherFactory.java index e56714eea6b9..904035e4ffd8 100644 --- a/features/flows/processing/src/test/java/org/opennms/netmgt/flows/processing/enrichment/MockDocumentEnricherFactory.java +++ b/features/flows/processing/src/test/java/org/opennms/netmgt/flows/processing/enrichment/MockDocumentEnricherFactory.java @@ -55,7 +55,8 @@ import org.opennms.netmgt.flows.classification.persistence.api.RuleBuilder; import org.opennms.netmgt.flows.processing.impl.DocumentEnricherImpl; import org.opennms.netmgt.flows.processing.impl.DocumentMangler; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCacheImpl; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCacheImpl; import com.codahale.metrics.MetricRegistry; import com.google.common.collect.Lists; @@ -89,17 +90,14 @@ public MockDocumentEnricherFactory(final long clockSkewCorrectionThreshold) thro new RuleBuilder().withName("http").withSrcPort("80").withProtocol("tcp,udp").build(), new RuleBuilder().withName("https").withSrcPort("443").withProtocol("tcp,udp").build() ), FilterService.NOOP); - final NodeMetadataCacheImpl nodeMetadataCache = new NodeMetadataCacheImpl( + final NodeInfoCache nodeInfoCache = new NodeInfoCacheImpl( new CacheConfigBuilder() .withName("nodeInfoCache") .withMaximumSize(1000) .withExpireAfterWrite(300) + .withExpireAfterRead(300) .build(), - new CacheConfigBuilder() - .withName("nodeMetadataCache") - .withMaximumSize(1000) - .withExpireAfterWrite(300) - .build(), + true, new MetricRegistry(), nodeDao, ipInterfaceDao, @@ -108,7 +106,7 @@ public MockDocumentEnricherFactory(final long clockSkewCorrectionThreshold) thro enricher = new DocumentEnricherImpl( new MockSessionUtils(), classificationEngine, clockSkewCorrectionThreshold, - new DocumentMangler(new ScriptEngineManager()), nodeMetadataCache); + new DocumentMangler(new ScriptEngineManager()), nodeInfoCache); // Required for mock node dao addServiceRegistry(nodeDao); diff --git a/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeMetadataCache.java b/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeInfoCache.java similarity index 97% rename from features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeMetadataCache.java rename to features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeInfoCache.java index caf4506b38f7..a47e4bca1a95 100644 --- a/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeMetadataCache.java +++ b/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeInfoCache.java @@ -31,7 +31,7 @@ import org.opennms.core.mate.api.ContextKey; -public interface NodeMetadataCache { +public interface NodeInfoCache { Optional getNodeInfoFromCache(final String location, final String ipAddress, final ContextKey contextKey, final String value); } diff --git a/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeMetadataCacheImpl.java b/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeInfoCacheImpl.java similarity index 90% rename from features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeMetadataCacheImpl.java rename to features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeInfoCacheImpl.java index c5dd76a041e2..a4dc792c6422 100644 --- a/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeMetadataCacheImpl.java +++ b/features/telemetry/protocols/cache/src/main/java/org/opennms/netmgt/telemetry/protocols/cache/NodeInfoCacheImpl.java @@ -36,6 +36,7 @@ import org.opennms.core.cache.Cache; import org.opennms.core.cache.CacheBuilder; import org.opennms.core.cache.CacheConfig; +import org.opennms.core.cache.CacheConfigBuilder; import org.opennms.core.mate.api.ContextKey; import org.opennms.core.utils.InetAddressUtils; import org.opennms.netmgt.dao.api.InterfaceToNodeCache; @@ -52,8 +53,8 @@ import com.google.common.base.Strings; import com.google.common.cache.CacheLoader; -public class NodeMetadataCacheImpl implements NodeMetadataCache { - private static final Logger LOG = LoggerFactory.getLogger(NodeMetadataCacheImpl.class); +public class NodeInfoCacheImpl implements NodeInfoCache { + private static final Logger LOG = LoggerFactory.getLogger(NodeInfoCacheImpl.class); private static class NodeMetadataKey { @@ -87,11 +88,18 @@ public int hashCode() { private final Cache> nodeInfoCache; private final Timer nodeLoadTimer; - public NodeMetadataCacheImpl(final CacheConfig nodeInfoCacheConfig, final CacheConfig nodeMetadataCacheConfig, final MetricRegistry metricRegistry, final NodeDao nodeDao, final IpInterfaceDao ipInterfaceDao, final InterfaceToNodeCache interfaceToNodeCache) { + public NodeInfoCacheImpl(final CacheConfig nodeInfoCacheConfig, final boolean nodeMetadataEnabled, final MetricRegistry metricRegistry, final NodeDao nodeDao, final IpInterfaceDao ipInterfaceDao, final InterfaceToNodeCache interfaceToNodeCache) { this.nodeDao = Objects.requireNonNull(nodeDao); this.ipInterfaceDao = Objects.requireNonNull(ipInterfaceDao); this.interfaceToNodeCache = Objects.requireNonNull(interfaceToNodeCache); + final CacheConfig nodeMetadataCacheConfig = new CacheConfigBuilder() + .withName("nodeMetadataCache") + .withExpireAfterRead(nodeInfoCacheConfig.getExpireAfterRead()) + .withExpireAfterWrite(nodeInfoCacheConfig.getExpireAfterWrite()) + .withMaximumSize(nodeInfoCacheConfig.getMaximumSize()) + .build(); + this.nodeInfoCache = new CacheBuilder() .withConfig(Objects.requireNonNull(nodeInfoCacheConfig)) .withCacheLoader(new CacheLoader>() { @@ -102,7 +110,7 @@ public Optional load(InterfaceToNodeCache.Entry entry) { }).build(); this.nodeMetadataCache = new CacheBuilder() - .withConfig(Objects.requireNonNull(nodeMetadataCacheConfig)) + .withConfig(nodeMetadataCacheConfig) .withCacheLoader(new CacheLoader>() { @Override public Optional load(NodeMetadataKey key) { diff --git a/features/telemetry/protocols/cache/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/features/telemetry/protocols/cache/src/main/resources/OSGI-INF/blueprint/blueprint.xml index b7e55481b8be..c546eb0bf1a5 100644 --- a/features/telemetry/protocols/cache/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/features/telemetry/protocols/cache/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -12,14 +12,10 @@ + - - - - - @@ -33,30 +29,21 @@ - - - - - - - - - - - + + - + - + diff --git a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/common/NetflowTelemetryAdapter.java b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/common/NetflowTelemetryAdapter.java index e819a49b17e7..22ae356a548d 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/common/NetflowTelemetryAdapter.java +++ b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/common/NetflowTelemetryAdapter.java @@ -48,7 +48,7 @@ import org.opennms.netmgt.telemetry.protocols.collection.AbstractScriptedCollectionAdapter; import org.opennms.netmgt.telemetry.protocols.collection.CollectionSetWithAgent; import org.opennms.netmgt.telemetry.protocols.collection.ScriptedCollectionSetBuilder; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.opennms.netmgt.telemetry.protocols.netflow.transport.FlowMessage; import org.opennms.netmgt.telemetry.protocols.netflow.transport.Value; @@ -62,11 +62,11 @@ public class NetflowTelemetryAdapter extends AbstractScriptedCollectionAdapter { private ContextKey contextKey; private String metaDataNodeLookup; - private final NodeMetadataCache nodeMetadataCache; + private final NodeInfoCache nodeInfoCache; - protected NetflowTelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeMetadataCache nodeMetadataCache) { + protected NetflowTelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeInfoCache nodeInfoCache) { super(adapterConfig, metricRegistry); - this.nodeMetadataCache = nodeMetadataCache; + this.nodeInfoCache = nodeInfoCache; } @Override @@ -92,7 +92,7 @@ public Stream handleCollectionMessage(final TelemetryMes return Stream.empty(); } - final Optional nodeInfo = nodeMetadataCache.getNodeInfoFromCache(messageLog.getLocation(), messageLog.getSourceAddress(), contextKey, flowMessage.getNodeIdentifier()); + final Optional nodeInfo = nodeInfoCache.getNodeInfoFromCache(messageLog.getLocation(), messageLog.getSourceAddress(), contextKey, flowMessage.getNodeIdentifier()); final CollectionAgent agent; if (nodeInfo.isPresent()) { diff --git a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapter.java b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapter.java index 470fceecf354..6a992538083e 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapter.java +++ b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapter.java @@ -28,13 +28,13 @@ package org.opennms.netmgt.telemetry.protocols.netflow.adapter.ipfix; import org.opennms.netmgt.telemetry.config.api.AdapterDefinition; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.opennms.netmgt.telemetry.protocols.netflow.adapter.common.NetflowTelemetryAdapter; import com.codahale.metrics.MetricRegistry; public class IpfixTelemetryAdapter extends NetflowTelemetryAdapter { - public IpfixTelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeMetadataCache nodeMetadataCache) { + public IpfixTelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeInfoCache nodeMetadataCache) { super(adapterConfig, metricRegistry, nodeMetadataCache); } } diff --git a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapterFactory.java b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapterFactory.java index 9993b74c6804..89600cf93402 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapterFactory.java +++ b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/ipfix/IpfixTelemetryAdapterFactory.java @@ -30,12 +30,12 @@ import org.opennms.netmgt.telemetry.api.adapter.Adapter; import org.opennms.netmgt.telemetry.config.api.AdapterDefinition; import org.opennms.netmgt.telemetry.protocols.collection.AbstractCollectionAdapterFactory; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.osgi.framework.BundleContext; public class IpfixTelemetryAdapterFactory extends AbstractCollectionAdapterFactory { - private NodeMetadataCache nodeMetadataCache; + private NodeInfoCache nodeInfoCache; public IpfixTelemetryAdapterFactory() { super(null); @@ -52,7 +52,7 @@ public Class getBeanClass() { @Override public Adapter createBean(final AdapterDefinition adapterConfig) { - final IpfixTelemetryAdapter adapter = new IpfixTelemetryAdapter(adapterConfig, getTelemetryRegistry().getMetricRegistry(), nodeMetadataCache); + final IpfixTelemetryAdapter adapter = new IpfixTelemetryAdapter(adapterConfig, getTelemetryRegistry().getMetricRegistry(), nodeInfoCache); adapter.setCollectionAgentFactory(getCollectionAgentFactory()); adapter.setPersisterFactory(getPersisterFactory()); adapter.setFilterDao(getFilterDao()); @@ -65,7 +65,7 @@ public Adapter createBean(final AdapterDefinition adapterConfig) { return adapter; } - public void setNodeMetadataCache(NodeMetadataCache nodeMetadataCache) { - this.nodeMetadataCache = nodeMetadataCache; + public void setNodeInfoCache(NodeInfoCache nodeInfoCache) { + this.nodeInfoCache = nodeInfoCache; } } diff --git a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapter.java b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapter.java index 7a3b9a540e89..28c369be1646 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapter.java +++ b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapter.java @@ -28,13 +28,13 @@ package org.opennms.netmgt.telemetry.protocols.netflow.adapter.netflow5; import org.opennms.netmgt.telemetry.config.api.AdapterDefinition; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.opennms.netmgt.telemetry.protocols.netflow.adapter.common.NetflowTelemetryAdapter; import com.codahale.metrics.MetricRegistry; public class Netflow5TelemetryAdapter extends NetflowTelemetryAdapter { - public Netflow5TelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeMetadataCache nodeMetadataCache) { + public Netflow5TelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeInfoCache nodeMetadataCache) { super(adapterConfig, metricRegistry, nodeMetadataCache); } } \ No newline at end of file diff --git a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapterFactory.java b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapterFactory.java index 61cca695024b..a48454563c60 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapterFactory.java +++ b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow5/Netflow5TelemetryAdapterFactory.java @@ -30,12 +30,12 @@ import org.opennms.netmgt.telemetry.api.adapter.Adapter; import org.opennms.netmgt.telemetry.config.api.AdapterDefinition; import org.opennms.netmgt.telemetry.protocols.collection.AbstractCollectionAdapterFactory; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.osgi.framework.BundleContext; public class Netflow5TelemetryAdapterFactory extends AbstractCollectionAdapterFactory { - private NodeMetadataCache nodeMetadataCache; + private NodeInfoCache nodeInfoCache; public Netflow5TelemetryAdapterFactory() { super(null); @@ -52,7 +52,7 @@ public Class getBeanClass() { @Override public Adapter createBean(final AdapterDefinition adapterConfig) { - final Netflow5TelemetryAdapter adapter = new Netflow5TelemetryAdapter(adapterConfig, getTelemetryRegistry().getMetricRegistry(), nodeMetadataCache); + final Netflow5TelemetryAdapter adapter = new Netflow5TelemetryAdapter(adapterConfig, getTelemetryRegistry().getMetricRegistry(), nodeInfoCache); adapter.setCollectionAgentFactory(getCollectionAgentFactory()); adapter.setPersisterFactory(getPersisterFactory()); adapter.setFilterDao(getFilterDao()); @@ -65,8 +65,8 @@ public Adapter createBean(final AdapterDefinition adapterConfig) { return adapter; } - public void setNodeMetadataCache(NodeMetadataCache nodeMetadataCache) { - this.nodeMetadataCache = nodeMetadataCache; + public void setNodeInfoCache(NodeInfoCache nodeInfoCache) { + this.nodeInfoCache = nodeInfoCache; } } diff --git a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapter.java b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapter.java index 9103e83ab335..2bf85676b904 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapter.java +++ b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapter.java @@ -28,13 +28,13 @@ package org.opennms.netmgt.telemetry.protocols.netflow.adapter.netflow9; import org.opennms.netmgt.telemetry.config.api.AdapterDefinition; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.opennms.netmgt.telemetry.protocols.netflow.adapter.common.NetflowTelemetryAdapter; import com.codahale.metrics.MetricRegistry; public class Netflow9TelemetryAdapter extends NetflowTelemetryAdapter { - public Netflow9TelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeMetadataCache nodeMetadataCache) { + public Netflow9TelemetryAdapter(final AdapterDefinition adapterConfig, final MetricRegistry metricRegistry, final NodeInfoCache nodeMetadataCache) { super(adapterConfig, metricRegistry, nodeMetadataCache); } } \ No newline at end of file diff --git a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapterFactory.java b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapterFactory.java index 39bbb8cc4914..b6ca2794059e 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapterFactory.java +++ b/features/telemetry/protocols/netflow/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/netflow/adapter/netflow9/Netflow9TelemetryAdapterFactory.java @@ -30,12 +30,12 @@ import org.opennms.netmgt.telemetry.api.adapter.Adapter; import org.opennms.netmgt.telemetry.config.api.AdapterDefinition; import org.opennms.netmgt.telemetry.protocols.collection.AbstractCollectionAdapterFactory; -import org.opennms.netmgt.telemetry.protocols.cache.NodeMetadataCache; +import org.opennms.netmgt.telemetry.protocols.cache.NodeInfoCache; import org.osgi.framework.BundleContext; public class Netflow9TelemetryAdapterFactory extends AbstractCollectionAdapterFactory { - private NodeMetadataCache nodeMetadataCache; + private NodeInfoCache nodeInfoCache; public Netflow9TelemetryAdapterFactory() { super(null); @@ -52,7 +52,7 @@ public Class getBeanClass() { @Override public Adapter createBean(final AdapterDefinition adapterConfig) { - final Netflow9TelemetryAdapter adapter = new Netflow9TelemetryAdapter(adapterConfig, getTelemetryRegistry().getMetricRegistry(), nodeMetadataCache); + final Netflow9TelemetryAdapter adapter = new Netflow9TelemetryAdapter(adapterConfig, getTelemetryRegistry().getMetricRegistry(), nodeInfoCache); adapter.setCollectionAgentFactory(getCollectionAgentFactory()); adapter.setPersisterFactory(getPersisterFactory()); adapter.setFilterDao(getFilterDao()); @@ -65,8 +65,8 @@ public Adapter createBean(final AdapterDefinition adapterConfig) { return adapter; } - public void setNodeMetadataCache(NodeMetadataCache nodeMetadataCache) { - this.nodeMetadataCache = nodeMetadataCache; + public void setNodeInfoCache(NodeInfoCache nodeInfoCache) { + this.nodeInfoCache = nodeInfoCache; } } diff --git a/features/telemetry/protocols/netflow/adapter/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/features/telemetry/protocols/netflow/adapter/src/main/resources/OSGI-INF/blueprint/blueprint.xml index 9ad34337151e..71a749136ac1 100644 --- a/features/telemetry/protocols/netflow/adapter/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/features/telemetry/protocols/netflow/adapter/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -18,7 +18,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -102,7 +102,7 @@ - +