BUG-432 Registration change
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / OpenflowPluginBulkTransactionProvider.java
index 824a9ba3ac333b3e8f00f9b09f518d138d6ebda7..e6f417410df5bffda1207580cd9a695aaa662a01 100644 (file)
@@ -65,6 +65,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.ta
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
@@ -101,6 +102,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -120,8 +122,9 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
     private ProviderContext pc;
     private FlowBuilder testFlow;
     private final String originalFlowName = "Foo";
-    private final SalFlowListener flowEventListener = new FlowEventListenerLoggingImpl();
-    private Registration<org.opendaylight.yangtools.yang.binding.NotificationListener> listener1Reg;
+    private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl();
+    private Registration listener1Reg;
+    private Registration listener2Reg;
     private Node testNode12;
     private final String originalGroupName = "Foo";
     private static NotificationService notificationService;
@@ -133,7 +136,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
     public void onSessionInitiated(ProviderContext session) {
         pc = session;
         notificationService = session.getSALService(NotificationService.class);
-        listener1Reg = notificationService.registerNotificationListener(flowEventListener);
+        listener2Reg = notificationService.registerNotificationListener(nodeErrorListener);
         dataBrokerService = session.getSALService(DataBrokerService.class);
         ctx.registerService(CommandProvider.class.getName(), this, null);
         createTestFlow(createTestNode(null), null, null);
@@ -153,7 +156,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static NodeRef createNodeRef(String string) {
         NodeKey key = new NodeKey(new NodeId(string));
-        InstanceIdentifier<Node> path = InstanceIdentifier.builder().node(Nodes.class).node(Node.class, key)
+        InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class).child(Node.class, key)
                 .toInstance();
 
         return new NodeRef(path);
@@ -412,8 +415,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         // flow.setBufferId(new Long(12));
         BigInteger value = new BigInteger("10", 10);
         BigInteger outputPort = new BigInteger("4294967295", 10);
-        flow.setCookie(value);
-        flow.setCookieMask(value);
+        flow.setCookie(new FlowCookie(value));
+        flow.setCookieMask(new FlowCookie(value));
         flow.setHardTimeout(0);
         flow.setIdleTimeout(0);
         flow.setInstallHw(false);