Updated review comments.Bulk transaction support added trasaction attribute with... 52/4152/4
authorPrasanna Huddar <prasanna.huddar@ericsson.com>
Sun, 12 Jan 2014 16:01:23 +0000 (21:31 +0530)
committerPrasanna Huddar <prasanna.huddar@ericsson.com>
Mon, 13 Jan 2014 09:56:36 +0000 (09:56 +0000)
Signed-off-by: Prasanna Huddar <prasanna.huddar@ericsson.com>
Change-Id: Ia7fe0d53730fd5c2e0eb92abb622c8711bf393d1

opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/flow/FlowTransaction.xtend
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/group/GroupTransaction.xtend
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/meter/MeterTransaction.xtend

index 6fcadea..dc2a7ee 100644 (file)
@@ -16,14 +16,16 @@ import org.opendaylight.yangtools.yang.binding.DataObject
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri
 
 class FlowTransaction extends AbstractTransaction {
     
     @Property
 
 class FlowTransaction extends AbstractTransaction {
     
     @Property
-    val SalFlowService salFlowService;
+    val SalFlowService salFlowService;   
+    
     
     new(DataModification<InstanceIdentifier<? extends DataObject>, DataObject> modification,SalFlowService salFlowService) {
     
     new(DataModification<InstanceIdentifier<? extends DataObject>, DataObject> modification,SalFlowService salFlowService) {
-        super(modification)
+        super(modification)        
         _salFlowService = salFlowService;
     }
     
         _salFlowService = salFlowService;
     }
     
@@ -33,9 +35,10 @@ class FlowTransaction extends AbstractTransaction {
             val tableInstanceId = instanceId.firstIdentifierOf(Table);
             val nodeInstanceId = instanceId.firstIdentifierOf(Node);
             val builder = new RemoveFlowInputBuilder(flow);
             val tableInstanceId = instanceId.firstIdentifierOf(Table);
             val nodeInstanceId = instanceId.firstIdentifierOf(Node);
             val builder = new RemoveFlowInputBuilder(flow);
-            builder.setFlowRef(new FlowRef(instanceId));
+            builder.setFlowRef(new FlowRef(instanceId));            
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setFlowTable(new FlowTableRef(tableInstanceId));
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setFlowTable(new FlowTableRef(tableInstanceId));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             _salFlowService.removeFlow(builder.build());            
         }
     }
             _salFlowService.removeFlow(builder.build());            
         }
     }
@@ -50,6 +53,7 @@ class FlowTransaction extends AbstractTransaction {
             builder.setFlowRef(new FlowRef(instanceId));
             val ufb = new UpdatedFlowBuilder(updatedFlow);
             builder.setUpdatedFlow((ufb.build()));
             builder.setFlowRef(new FlowRef(instanceId));
             val ufb = new UpdatedFlowBuilder(updatedFlow);
             builder.setUpdatedFlow((ufb.build()));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             val ofb = new OriginalFlowBuilder(originalFlow);
             builder.setOriginalFlow(ofb.build());      
             _salFlowService.updateFlow(builder.build());
             val ofb = new OriginalFlowBuilder(originalFlow);
             builder.setOriginalFlow(ofb.build());      
             _salFlowService.updateFlow(builder.build());
@@ -64,6 +68,7 @@ class FlowTransaction extends AbstractTransaction {
             val nodeInstanceId = instanceId.firstIdentifierOf(Node);
             val builder = new AddFlowInputBuilder(flow);
             builder.setNode(new NodeRef(nodeInstanceId));
             val nodeInstanceId = instanceId.firstIdentifierOf(Node);
             val builder = new AddFlowInputBuilder(flow);
             builder.setNode(new NodeRef(nodeInstanceId));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             builder.setFlowRef(new FlowRef(instanceId));
             builder.setFlowTable(new FlowTableRef(tableInstanceId));
             _salFlowService.addFlow(builder.build());            
             builder.setFlowRef(new FlowRef(instanceId));
             builder.setFlowTable(new FlowTableRef(tableInstanceId));
             _salFlowService.addFlow(builder.build());            
index d68ffa0..f79c9b6 100644 (file)
@@ -14,14 +14,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
 import org.opendaylight.yangtools.yang.binding.DataObject
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
 import org.opendaylight.yangtools.yang.binding.DataObject
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri
 
 class GroupTransaction extends AbstractTransaction {
     
     @Property
     val SalGroupService groupService;
 
 class GroupTransaction extends AbstractTransaction {
     
     @Property
     val SalGroupService groupService;
-    
+        
     new(DataModification<InstanceIdentifier<? extends DataObject>, DataObject> modification,SalGroupService groupService) {
     new(DataModification<InstanceIdentifier<? extends DataObject>, DataObject> modification,SalGroupService groupService) {
-        super(modification)
+        super(modification)        
         _groupService = groupService;
     }
     
         _groupService = groupService;
     }
     
@@ -31,6 +32,7 @@ class GroupTransaction extends AbstractTransaction {
             val nodeInstanceId = instanceId.firstIdentifierOf(Node);
             val builder = new RemoveGroupInputBuilder(group);
             builder.setNode(new NodeRef(nodeInstanceId));
             val nodeInstanceId = instanceId.firstIdentifierOf(Node);
             val builder = new RemoveGroupInputBuilder(group);
             builder.setNode(new NodeRef(nodeInstanceId));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             builder.setGroupRef(new GroupRef(instanceId));
             _groupService.removeGroup(builder.build());            
         }
             builder.setGroupRef(new GroupRef(instanceId));
             _groupService.removeGroup(builder.build());            
         }
@@ -46,6 +48,7 @@ class GroupTransaction extends AbstractTransaction {
             builder.setGroupRef(new GroupRef(instanceId));
             val ufb = new UpdatedGroupBuilder(updatedGroup);
             builder.setUpdatedGroup((ufb.build()));
             builder.setGroupRef(new GroupRef(instanceId));
             val ufb = new UpdatedGroupBuilder(updatedGroup);
             builder.setUpdatedGroup((ufb.build()));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             val ofb = new OriginalGroupBuilder(originalGroup);
             builder.setOriginalGroup(ofb.build());      
             _groupService.updateGroup(builder.build());
             val ofb = new OriginalGroupBuilder(originalGroup);
             builder.setOriginalGroup(ofb.build());      
             _groupService.updateGroup(builder.build());
@@ -60,6 +63,7 @@ class GroupTransaction extends AbstractTransaction {
             val builder = new AddGroupInputBuilder(group);
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setGroupRef(new GroupRef(instanceId));
             val builder = new AddGroupInputBuilder(group);
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setGroupRef(new GroupRef(instanceId));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             _groupService.addGroup(builder.build());            
         }
     }
             _groupService.addGroup(builder.build());            
         }
     }
index d64f251..594a16c 100644 (file)
@@ -14,14 +14,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter
 import org.opendaylight.yangtools.yang.binding.DataObject
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef
 import org.opendaylight.yangtools.yang.binding.DataObject
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri
 
 class MeterTransaction extends AbstractTransaction {
     
     @Property
     val SalMeterService salMeterService;
 
 class MeterTransaction extends AbstractTransaction {
     
     @Property
     val SalMeterService salMeterService;
-    
+        
     new(DataModification<InstanceIdentifier<? extends DataObject>, DataObject> modification,SalMeterService salMeterService) {
     new(DataModification<InstanceIdentifier<? extends DataObject>, DataObject> modification,SalMeterService salMeterService) {
-        super(modification)
+        super(modification)    
         _salMeterService = salMeterService;
     }
     
         _salMeterService = salMeterService;
     }
     
@@ -32,6 +33,7 @@ class MeterTransaction extends AbstractTransaction {
             val builder = new RemoveMeterInputBuilder(meter);
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setMeterRef(new MeterRef(instanceId));
             val builder = new RemoveMeterInputBuilder(meter);
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setMeterRef(new MeterRef(instanceId));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             _salMeterService.removeMeter(builder.build());            
         }
     }
             _salMeterService.removeMeter(builder.build());            
         }
     }
@@ -46,6 +48,7 @@ class MeterTransaction extends AbstractTransaction {
             builder.setMeterRef(new MeterRef(instanceId));
             val ufb = new UpdatedMeterBuilder(updatedMeter);
             builder.setUpdatedMeter((ufb.build()));
             builder.setMeterRef(new MeterRef(instanceId));
             val ufb = new UpdatedMeterBuilder(updatedMeter);
             builder.setUpdatedMeter((ufb.build()));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             val ofb = new OriginalMeterBuilder(originalMeter);
             builder.setOriginalMeter(ofb.build());      
             _salMeterService.updateMeter(builder.build());
             val ofb = new OriginalMeterBuilder(originalMeter);
             builder.setOriginalMeter(ofb.build());      
             _salMeterService.updateMeter(builder.build());
@@ -60,6 +63,7 @@ class MeterTransaction extends AbstractTransaction {
             val builder = new AddMeterInputBuilder(meter);
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setMeterRef(new MeterRef(instanceId));
             val builder = new AddMeterInputBuilder(meter);
             builder.setNode(new NodeRef(nodeInstanceId));
             builder.setMeterRef(new MeterRef(instanceId));
+            builder.setTransactionUri(new Uri(modification.getIdentifier() as String));
             _salMeterService.addMeter(builder.build());            
         }
     }
             _salMeterService.addMeter(builder.build());            
         }
     }