Convert users from submit() to commit()
[netconf.git] / netconf / netconf-topology-singleton / src / main / java / org / opendaylight / netconf / topology / singleton / impl / actors / WriteAdapter.java
index 250b893099cde703440be130d0058c16b969a658..c798673eefcd310e86d4cd971d60a71056a164ad 100644 (file)
@@ -5,20 +5,18 @@
  * 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.ActorContext;
 import akka.actor.ActorRef;
 import akka.actor.Status.Failure;
 import akka.actor.Status.Success;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
 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.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.CancelRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.DeleteRequest;
@@ -45,11 +43,11 @@ class WriteAdapter {
     }
 
     private void submit(final ActorRef requester, final ActorRef self, final ActorContext context) {
-        final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = tx.submit();
+        final FluentFuture<? extends CommitInfo> submitFuture = tx.commit();
         context.stop(self);
-        Futures.addCallback(submitFuture, new FutureCallback<Void>() {
+        submitFuture.addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(final Void result) {
+            public void onSuccess(final CommitInfo result) {
                 requester.tell(new Success(null), self);
             }