Bump upstreams
[lispflowmapping.git] / mappingservice / implementation / src / main / java / org / opendaylight / lispflowmapping / implementation / mdsal / AbstractDataListener.java
index 40ba2704f074dcc2cc77ddd6b09af7d65fc996a2..88ef3aeeade570df5b358387d7fe2af558979b09 100644 (file)
@@ -7,11 +7,11 @@
  */
 package org.opendaylight.lispflowmapping.implementation.mdsal;
 
-import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
@@ -19,20 +19,17 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  * The superclass for the different MD-SAL data change event listeners.
  *
  */
-public abstract class AbstractDataListener<T extends DataObject> implements ClusteredDataTreeChangeListener<T> {
+public abstract class AbstractDataListener<T extends DataObject> implements DataTreeChangeListener<T> {
     private DataBroker broker;
     private InstanceIdentifier<T> path;
-    private ListenerRegistration<ClusteredDataTreeChangeListener<T>> configRegistration;
-    private ListenerRegistration<ClusteredDataTreeChangeListener<T>> operRegistration;
+    private Registration configRegistration;
+    private Registration operRegistration;
 
     void registerDataChangeListener() {
-        final DataTreeIdentifier<T> configDataTreeIdentifier = DataTreeIdentifier.create(
-                LogicalDatastoreType.CONFIGURATION, path);
-        final DataTreeIdentifier<T> operDataTreeIdentifier = DataTreeIdentifier.create(
-                LogicalDatastoreType.OPERATIONAL, path);
-
-        configRegistration = broker.registerDataTreeChangeListener(configDataTreeIdentifier, this);
-        operRegistration = broker.registerDataTreeChangeListener(operDataTreeIdentifier, this);
+        configRegistration = broker.registerTreeChangeListener(
+            DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, path), this);
+        operRegistration = broker.registerTreeChangeListener(
+            DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, path), this);
     }
 
     public void closeDataChangeListener() {
@@ -47,5 +44,4 @@ public abstract class AbstractDataListener<T extends DataObject> implements Clus
     void setPath(InstanceIdentifier<T> path) {
         this.path = path;
     }
-
 }