Fix NetconfKeystoreAdapter onDataTreeChanged method
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / netconf / sal / NetconfKeystoreAdapter.java
index 19577f4f2490565f2849922adebbedf79893837b..b1d707f7081833e16c130052a1b315a7a83e6b9b 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.sal.connect.netconf.sal;
 
 import java.io.ByteArrayInputStream;
@@ -28,12 +27,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
-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.DataTreeIdentifier;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+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.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.DataTreeModification;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.keystore.rev171017.Keystore;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.keystore.rev171017._private.keys.PrivateKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.keystore.rev171017.keystore.entry.KeyCredential;
@@ -57,8 +56,8 @@ public class NetconfKeystoreAdapter implements ClusteredDataTreeChangeListener<K
     public NetconfKeystoreAdapter(final DataBroker dataBroker) {
         this.dataBroker = dataBroker;
 
-        dataBroker.registerDataTreeChangeListener(
-                new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, keystoreIid), this);
+        dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
+            keystoreIid), this);
     }
 
     public Optional<KeyCredential> getKeypairFromId(final String keyId) {
@@ -160,7 +159,6 @@ public class NetconfKeystoreAdapter implements ClusteredDataTreeChangeListener<K
                     if (dataAfter != null) {
                         dataAfter.getKeyCredential().forEach(pair -> pairs.put(pair.key().getKeyId(), pair));
                     }
-                    break;
 
                 } else if (changedChild.getDataType().equals(PrivateKey.class)) {
                     onPrivateKeyChanged((DataObjectModification<PrivateKey>)changedChild);