Remove unneeded use of CheckedFuture 48/73748/4
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Jul 2018 14:32:34 +0000 (16:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Jul 2018 15:37:33 +0000 (17:37 +0200)
These callsites can live with ListenableFuture, so use that to
reduce clutter.

Change-Id: I4bea70e8f62b06cfdc1d7a3dfa5d7552178fa4c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java

index e8415f62fed3be1de4991583c6bba77c1c1a7e6d..f81c7541f179f53a310daa9666b4af0691c520d5 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.topology.singleton.impl.actors;
 
 import akka.actor.ActorRef;
@@ -15,7 +14,6 @@ import akka.actor.Status.Success;
 import akka.pattern.AskTimeoutException;
 import akka.util.Timeout;
 import com.google.common.base.Throwables;
-import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -35,7 +33,6 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
@@ -239,7 +236,7 @@ public class NetconfNodeActor extends AbstractUntypedActor {
         LOG.debug("{}: invokeSlaveRpc for {}, input: {} on rpc service {}", id, schemaPath, normalizedNodeMessage,
                 deviceRpc);
 
-        final CheckedFuture<DOMRpcResult, DOMRpcException> rpcResult = deviceRpc.invokeRpc(schemaPath,
+        final ListenableFuture<DOMRpcResult> rpcResult = deviceRpc.invokeRpc(schemaPath,
                 normalizedNodeMessage != null ? normalizedNodeMessage.getNode() : null);
 
         Futures.addCallback(rpcResult, new FutureCallback<DOMRpcResult>() {
index e3fb37f2198f6118065ed94b7fa6486e786b604c..22e60a3cb1607972c70c0d4474f9d230cd2d7847 100644 (file)
@@ -5,19 +5,16 @@
  * 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.topology.singleton.impl.actors;
 
 import akka.actor.ActorRef;
 import akka.actor.Status.Failure;
 import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
 import javax.annotation.Nonnull;
 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.netconf.topology.singleton.messages.NormalizedNodeMessage;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.EmptyReadResponse;
@@ -53,8 +50,7 @@ class ReadAdapter {
 
     private void read(final YangInstanceIdentifier path, final LogicalDatastoreType store, final ActorRef sender,
                       final ActorRef self) {
-        final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read = tx.read(store, path);
-        Futures.addCallback(read, new FutureCallback<Optional<NormalizedNode<?, ?>>>() {
+        Futures.addCallback(tx.read(store, path), new FutureCallback<Optional<NormalizedNode<?, ?>>>() {
 
             @Override
             public void onSuccess(@Nonnull final Optional<NormalizedNode<?, ?>> result) {
@@ -74,8 +70,7 @@ class ReadAdapter {
 
     private void exists(final YangInstanceIdentifier path, final LogicalDatastoreType store, final ActorRef sender,
                         final ActorRef self) {
-        final CheckedFuture<Boolean, ReadFailedException> readFuture = tx.exists(store, path);
-        Futures.addCallback(readFuture, new FutureCallback<Boolean>() {
+        Futures.addCallback(tx.exists(store, path), new FutureCallback<Boolean>() {
             @Override
             public void onSuccess(final Boolean result) {
                 if (result == null) {