Bump upstreams
[lispflowmapping.git] / mappingservice / implementation / src / main / java / org / opendaylight / lispflowmapping / implementation / mdsal / AuthenticationKeyDataListener.java
index 2c09cbd71ab1353b67def6deca7dcb75fea1eb96..941d001d8a03f5f07fda3d7799e354a3c74925c9 100644 (file)
@@ -7,13 +7,13 @@
  */
 package org.opendaylight.lispflowmapping.implementation.mdsal;
 
-import java.util.Collection;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
+import java.util.List;
 import org.opendaylight.lispflowmapping.interfaces.mapcache.IMappingSystem;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataObjectModification;
+import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
+import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
@@ -22,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev15090
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType;
 
 /**
  * DataListener for all AuthenticationKey modification events.
@@ -44,38 +43,38 @@ public class AuthenticationKeyDataListener extends AbstractDataListener<Authenti
     }
 
     @Override
-    public void onDataTreeChanged(Collection<DataTreeModification<AuthenticationKey>> changes) {
+    public void onDataTreeChanged(List<DataTreeModification<AuthenticationKey>> changes) {
         for (DataTreeModification<AuthenticationKey> change : changes) {
             final DataObjectModification<AuthenticationKey> mod = change.getRootNode();
 
-            if (ModificationType.DELETE == mod.getModificationType()) {
-                final AuthenticationKey authKey = mod.getDataBefore();
+            if (ModificationType.DELETE == mod.modificationType()) {
+                final AuthenticationKey authKey = mod.dataBefore();
 
                 LOG.trace("Received deleted data");
-                LOG.trace("Key: {}", change.getRootPath().getRootIdentifier());
+                LOG.trace("Key: {}", change.getRootPath().path());
                 LOG.trace("Value: {}", authKey);
 
                 final AuthenticationKey convertedAuthKey = convertToBinaryIfNecessary(authKey);
 
                 mapSystem.removeAuthenticationKey(convertedAuthKey.getEid());
-            } else if (ModificationType.WRITE == mod.getModificationType() || ModificationType.SUBTREE_MODIFIED == mod
-                    .getModificationType()) {
-                if (ModificationType.WRITE == mod.getModificationType()) {
+            } else if (ModificationType.WRITE == mod.modificationType()
+                    || ModificationType.SUBTREE_MODIFIED == mod.modificationType()) {
+                if (ModificationType.WRITE == mod.modificationType()) {
                     LOG.trace("Received created data");
                 } else {
                     LOG.trace("Received updated data");
                 }
                 // Process newly created or updated authentication keys
-                final AuthenticationKey authKey = mod.getDataAfter();
+                final AuthenticationKey authKey = mod.dataAfter();
 
-                LOG.trace("Key: {}", change.getRootPath().getRootIdentifier());
+                LOG.trace("Key: {}", change.getRootPath().path());
                 LOG.trace("Value: {}", authKey);
 
                 final AuthenticationKey convertedAuthKey = convertToBinaryIfNecessary(authKey);
 
                 mapSystem.addAuthenticationKey(convertedAuthKey.getEid(), convertedAuthKey.getMappingAuthkey());
             } else {
-                LOG.warn("Ignoring unhandled modification type {}", mod.getModificationType());
+                LOG.warn("Ignoring unhandled modification type {}", mod.modificationType());
             }
         }
     }
@@ -91,6 +90,6 @@ public class AuthenticationKeyDataListener extends AbstractDataListener<Authenti
     }
 
     void setMappingSystem(IMappingSystem msmr) {
-        this.mapSystem = msmr;
+        mapSystem = msmr;
     }
 }