Fix warnings in topology-lldp-discovery 72/110472/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Mar 2024 16:06:27 +0000 (17:06 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Mar 2024 16:06:27 +0000 (17:06 +0100)
We have a few warnings, fix them up.

Change-Id: I6bc16edfc7873350a2186f6bf8bfa982717eef70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
applications/topology-lldp-discovery/pom.xml
applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAger.java

index a8989e9c57343d65d7ea6b061ac4ceebd9afe330..7b219285fbca88ab11d6e833247f423a98e5055d 100644 (file)
@@ -9,7 +9,6 @@
   </parent>
   <groupId>org.opendaylight.openflowplugin.applications</groupId>
   <artifactId>topology-lldp-discovery</artifactId>
-  <version>0.18.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencies>
index c4a67e02927abeb18dff06c634791762cad2497c..c4404d9d97c654259edc226ec67328a8e783b377 100644 (file)
@@ -19,9 +19,9 @@ import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
@@ -47,7 +47,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
-public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataTreeChangeListener<Link>, AutoCloseable {
+public final class LLDPLinkAger implements ConfigurationListener, DataTreeChangeListener<Link>, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(LLDPLinkAger.class);
     static final String TOPOLOGY_ID = "flow:1";
     static final InstanceIdentifier<Link> II_TO_LINK = InstanceIdentifier.create(NetworkTopology.class)
@@ -79,7 +79,7 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
         final DataTreeIdentifier<Link> dtiToNodeConnector = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
                 II_TO_LINK);
         try {
-            listenerRegistration = dataBroker.registerDataTreeChangeListener(dtiToNodeConnector, LLDPLinkAger.this);
+            listenerRegistration = dataBroker.registerTreeChangeListener(dtiToNodeConnector, this);
         } catch (Exception e) {
             LOG.error("DataTreeChangeListeners registration failed:", e);
             throw new IllegalStateException("LLDPLinkAger startup failed!", e);
@@ -152,7 +152,7 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
     }
 
     private void processLinkDeleted(final DataObjectModification<Link> rootNode) {
-        Link link = rootNode.getDataBefore();
+        Link link = rootNode.dataBefore();
         LOG.trace("Removing link {} from linkToDate cache", link);
         LinkDiscovered linkDiscovered = LLDPDiscoveryUtils.toLLDPLinkDiscovered(link);
         linkToDate.remove(linkDiscovered);