Update MRI projects for Aluminium
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / OpenflowPluginBulkGroupTransactionProvider.java
index 0f45855999447286502a89075c0e77f50aacb149..bfc7e90de17283dc957bfcc8eeb6c8323529911a 100644 (file)
@@ -5,22 +5,19 @@
  * 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.math.BigInteger;
 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.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder;
@@ -708,18 +705,19 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, testNode12.key()).augmentation(FlowCapableNode.class)
                 .child(Group.class, new GroupKey(group.getGroupId()));
-        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode12), testNode12, true);
-        modification.merge(LogicalDatastoreType.CONFIGURATION, path1, group, true);
+        modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode12),
+                testNode12);
+        modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, path1, group);
 
         InstanceIdentifier<Group> path2 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, testNode12.key()).augmentation(FlowCapableNode.class)
                 .child(Group.class, new GroupKey(group1.getGroupId()));
-        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode12), testNode12, true);
-        modification.merge(LogicalDatastoreType.CONFIGURATION, path2, group1, true);
-        ListenableFuture<Void> commitFuture = modification.submit();
-        Futures.addCallback(commitFuture, new FutureCallback<Void>() {
+        modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode12),
+                testNode12);
+        modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, path2, group1);
+        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.");
             }
 
@@ -742,10 +740,9 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
                 .child(Group.class, new GroupKey(group1.getGroupId()));
         modification.delete(LogicalDatastoreType.OPERATIONAL, path2);
         modification.delete(LogicalDatastoreType.CONFIGURATION, path2);
-        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.");
             }