Get rid of string payload RestconfService#invokeRpc
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / restconf / impl / BatchedExistenceCheck.java
index f36caa0d2dc46a965b1644b16f0359dc3f40627f..d8c15248e86ef673d6cba00cae476c242774ab3a 100644 (file)
@@ -8,18 +8,17 @@
 package org.opendaylight.netconf.sal.restconf.impl;
 
 import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.AbstractMap.SimpleImmutableEntry;
 import java.util.Collection;
 import java.util.Map.Entry;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -36,20 +35,20 @@ final class BatchedExistenceCheck {
         this.outstanding = total;
     }
 
-    static BatchedExistenceCheck start(final DOMDataReadTransaction readTx,
+    static BatchedExistenceCheck start(final DOMDataTreeReadTransaction readTx,
             final LogicalDatastoreType datastore, final YangInstanceIdentifier parentPath,
             final Collection<? extends NormalizedNode<?, ?>> children) {
         final BatchedExistenceCheck ret = new BatchedExistenceCheck(children.size());
         for (NormalizedNode<?, ?> child : children) {
             final YangInstanceIdentifier path = parentPath.node(child.getIdentifier());
-            final ListenableFuture<Boolean> f = readTx.exists(datastore, path);
-            Futures.addCallback(f, new FutureCallback<Boolean>() {
+            readTx.exists(datastore, path).addCallback(new FutureCallback<Boolean>() {
                 @Override
                 public void onSuccess(final Boolean result) {
-                    ret.complete(path, result.booleanValue());
+                    ret.complete(path, result);
                 }
 
                 @Override
+                @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
                 public void onFailure(final Throwable throwable) {
                     final Exception e;
                     if (throwable instanceof Exception) {