Switch to MD-SAL APIs
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / OpenflowpluginMeterTestCommandProvider.java
index 2ca6c7a3d8b2ef542917568627dc40fe4d5b2312..98f9aa22c674d240fcbf19172a5274c469e9342a 100644 (file)
@@ -5,21 +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.openflowplugin.test;
 
 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 java.util.ArrayList;
 import java.util.List;
 import org.eclipse.osgi.framework.console.CommandInterpreter;
 import org.eclipse.osgi.framework.console.CommandProvider;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationService;
+import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
@@ -229,10 +226,9 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.key())
                 .augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(testMeter.getMeterId()));
         modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
-        ListenableFuture<Void> commitFuture = modification.submit();
-        Futures.addCallback(commitFuture, new FutureCallback<Void>() {
+        modification.commit().addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(Void notUsed) {
+            public void onSuccess(Object notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -311,10 +307,9 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
                 break;
         }
 
-        ListenableFuture<Void> commitFuture = modification.submit();
-        Futures.addCallback(commitFuture, new FutureCallback<Void>() {
+        modification.commit().addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(Void notUsed) {
+            public void onSuccess(Object notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -384,10 +379,9 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
                 .augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(meter.getMeterId()));
         modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true);
         modification.merge(LogicalDatastoreType.CONFIGURATION, path1, meter, true);
-        ListenableFuture<Void> commitFuture = modification.submit();
-        Futures.addCallback(commitFuture, new FutureCallback<Void>() {
+        modification.commit().addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(Void notUsed) {
+            public void onSuccess(Object notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -409,10 +403,9 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true);
         modification.merge(LogicalDatastoreType.CONFIGURATION, path2, meter1, true);
 
-        ListenableFuture<Void> commitFuture = modification.submit();
-        Futures.addCallback(commitFuture, new FutureCallback<Void>() {
+        modification.commit().addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(Void notUsed) {
+            public void onSuccess(Object notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }