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.Map.Entry;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-import javax.annotation.Nonnull;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadOperations;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
this.outstanding = total;
}
- static BatchedExistenceCheck start(final DOMDataTreeReadTransaction readTx,
+ static BatchedExistenceCheck start(final DOMDataTreeReadOperations 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(@Nonnull final Boolean result) {
+ public void onSuccess(final Boolean result) {
ret.complete(path, result);
}
}
}
+ @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/811")
private void complete(final YangInstanceIdentifier childPath, final boolean present) {
final int count = UPDATER.decrementAndGet(this);
if (present) {
}
}
+ @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/811")
private void complete(final YangInstanceIdentifier childPath, final ReadFailedException cause) {
UPDATER.decrementAndGet(this);
future.set(new SimpleImmutableEntry<>(childPath, cause));