summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-06-04 15:57:23 +0200
committerMichal Cmarada <mcmarada@cisco.com>2019-06-04 15:57:23 +0200
commit2d56b072d51790be31b86ba5995f1d191748c505 (patch)
treef4848ca1dd011b7eb8b05201af9f6ea1c3a631a9
parenta776d7ff3e6f155a37b182dabaa0429fb2c04c3c (diff)
fix sonar issues
Change-Id: I9c121df82f392f71a21b9ac25c15e7e77071aa25 Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java4
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java9
2 files changed, 8 insertions, 5 deletions
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
index 7acfae6c8..0578a349d 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
@@ -39,6 +39,8 @@ public final class HoneycombNotificationManagerProvider extends ProviderTrait<No
@Inject
private BindingToNormalizedNodeCodec codec;
+ private NotificationProducerTracker notificationProducerTracker;
+
@Override
protected HoneycombNotificationCollector create() {
// Create the registry to keep track of what'OPERATIONAL registered
@@ -55,7 +57,7 @@ public final class HoneycombNotificationManagerProvider extends ProviderTrait<No
notificationProducerRegistry);
// Create tracker, responsible for starting and stopping registered notification producers whenever necessary
- NotificationProducerTracker notificationProducerTracker =
+ notificationProducerTracker =
new NotificationProducerTracker(notificationProducerRegistry, honeycombNotificationCollector,
notificationRouter);
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
index 9289936ac..15af3b451 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
@@ -57,6 +57,8 @@ public class NetconfNotificationMapperProvider extends ProviderTrait<NetconfOper
@Inject
private ShutdownHandler shutdownHandler;
+ private CapabilityChangeNotificationProducer capabilityChangeNotificationProducer;
+
@Override
protected NetconfNotificationOperationServiceFactory create() {
LOG.trace("Initializing NotificationToMdsalWriter");
@@ -64,16 +66,15 @@ public class NetconfNotificationMapperProvider extends ProviderTrait<NetconfOper
writer.start();
LOG.trace("Initializing CapabilityChangeNotificationProducer");
- final CapabilityChangeNotificationProducer capabilityChangeNotificationProducer =
- new CapabilityChangeNotificationProducer(notificationCollector, dataBroker);
+ capabilityChangeNotificationProducer =
+ new CapabilityChangeNotificationProducer(notificationCollector, dataBroker);
LOG.trace("Providing NetconfNotificationOperationServiceFactory");
final NetconfNotificationOperationServiceFactory netconfNotificationOperationServiceFactory =
new NetconfNotificationOperationServiceFactory(notificationRegistry, aggregator);
shutdownHandler.register("netconf-notification-service-factory", netconfNotificationOperationServiceFactory);
- shutdownHandler.register("capability-change-notification-producer",
- capabilityChangeNotificationProducer::close);
+ shutdownHandler.register("capability-change-notification-producer", capabilityChangeNotificationProducer);
shutdownHandler.register("notification-to-mdsal-writer", writer);
return netconfNotificationOperationServiceFactory;
}