Added routing context information to models. 62/1862/2
authorTony Tkacik <ttkacik@cisco.com>
Sun, 13 Oct 2013 20:03:57 +0000 (22:03 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Sun, 13 Oct 2013 20:19:15 +0000 (22:19 +0200)
Change-Id: I8ed3497bf6a1905333fd042f732814e2e815a2a2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-service.yang
opendaylight/md-sal/model/model-flow-service/src/main/yang/group-service.yang
opendaylight/md-sal/model/model-flow-service/src/main/yang/meter-service.yang
opendaylight/md-sal/sal-compability/src/main/java/org/opendaylight/controller/sal/compability/MDFlowMapping.xtend

index 113cb1287db71bf7d361e92f1b362de6e85540f3..147b64689e8d879cf2f998c6be0ba1ee62ce28a6 100644 (file)
@@ -19,6 +19,7 @@ module sal-flow {
     
     grouping node-flow {
         leaf node {
+            ext:context-reference "inv:node-context";
             type inv:node-ref;
         }
         leaf flow-table {
@@ -51,7 +52,11 @@ module sal-flow {
 
     rpc update-flow {
         input {
-            uses node-flow;
+            leaf node {
+                ext:context-reference "inv:node-context";
+                type inv:node-ref;
+            }
+            uses flow-update;
         }
     }
 
index 866b359c29959ec63c1a6915d51b85dbc23c7407..3c6287f879506959dc9141bc6f7542dc1ca2916a 100644 (file)
@@ -13,9 +13,9 @@ module sal-group {
     
     grouping node-group {
         leaf node {
+            ext:context-reference "inv:node-context";
             type inv:node-ref;
         }
-        
         uses group-type:group;
     }
 
@@ -37,13 +37,17 @@ module sal-group {
 
     rpc remove-group {
         input {
-            uses node-group;
+            leaf node {
+                ext:context-reference "inv:node-context";
+                type inv:node-ref;
+            }
+            uses group-update;
         }
     }
 
     rpc update-group {
         input {
-            uses node-group;
+            uses group-update;
         }
     }     
 }
\ No newline at end of file
index efc25822ed505de959d0af8317282f9f34209ceb..52b5b282e0adae739de995af257fc6105ca2b9fb 100644 (file)
@@ -13,6 +13,7 @@ module sal-meter {
     
     grouping node-meter {
         leaf node {
+            ext:context-reference "inv:node-context";
             type inv:node-ref;
         }
         
@@ -43,7 +44,11 @@ module sal-meter {
 
     rpc update-meter {
         input {
-            uses node-meter;
+            leaf node {
+                ext:context-reference "inv:node-context";
+                type inv:node-ref;
+            }
+            uses meter-update;
         }
     }     
 }
\ No newline at end of file
index 8490ad950148899b9e1f3076fd878070a2a27bb7..ac4d99f10fcd9f3d34e4a1caabdcfca202b0c5ef 100644 (file)
@@ -75,6 +75,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp
 
 import static extension org.opendaylight.controller.sal.compability.FromSalConversionsUtils.*
 import static extension org.opendaylight.controller.sal.compability.NodeMapping.*
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.OriginalFlowBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.UpdatedFlowBuilder
 
 public class MDFlowMapping {
 
@@ -106,8 +108,6 @@ public class MDFlowMapping {
     public static def flowStatisticsInput(Node sourceNode, Flow sourceFlow) {
         val it = new GetFlowStatisticsInputBuilder();
         val source = flowAdded(sourceFlow);
-        cookie = (source.getCookie());
-        action = (source.getAction());
         action = (source.getAction());
         cookie = (source.getCookie());
         hardTimeout = (source.getHardTimeout());
@@ -122,8 +122,6 @@ public class MDFlowMapping {
         val source = flowAdded(sourceFlow);
         action = (source.getAction());
         cookie = (source.getCookie());
-        action = (source.getAction());
-        cookie = (source.getCookie());
         hardTimeout = (source.getHardTimeout());
         match = (source.getMatch());
         priority = (source.getPriority());
@@ -136,8 +134,6 @@ public class MDFlowMapping {
         val source = flowAdded(sourceFlow);
         action = (source.getAction());
         cookie = (source.getCookie());
-        action = (source.getAction());
-        cookie = (source.getCookie());
         hardTimeout = (source.getHardTimeout());
         match = (source.getMatch());
         priority = (source.getPriority());
@@ -147,14 +143,28 @@ public class MDFlowMapping {
 
     public static def updateFlowInput(Node sourceNode, Flow oldFlow, Flow newFlow) {
         val it = new UpdateFlowInputBuilder();
-        val source = flowAdded(newFlow);
-        action = (source.getAction());
-        cookie = (source.getCookie());
-        action = (source.getAction());
-        cookie = (source.getCookie());
-        hardTimeout = (source.getHardTimeout());
-        match = (source.getMatch());
-        priority = (source.getPriority());
+
+        val original = new OriginalFlowBuilder();
+
+        val sourceOld = flowAdded(newFlow);
+
+        original.action = (sourceOld.getAction());
+        original.cookie = (sourceOld.getCookie());
+        original.hardTimeout = (sourceOld.getHardTimeout());
+        original.match = (sourceOld.getMatch());
+        original.priority = (sourceOld.getPriority());
+
+        val updated = new UpdatedFlowBuilder();
+        val sourceNew = flowAdded(newFlow);
+
+        updated.action = (sourceNew.getAction());
+        updated.cookie = (sourceNew.getCookie());
+        updated.hardTimeout = (sourceNew.getHardTimeout());
+        updated.match = (sourceNew.getMatch());
+        updated.priority = (sourceNew.getPriority());
+
+        originalFlow = original.build()
+        updatedFlow = updated.build();
         node = sourceNode.toNodeRef()
         return it.build();
     }
@@ -203,8 +213,6 @@ public class MDFlowMapping {
         return actionBuilder.build();
 
     }
-    
-
 
     public static dispatch def toAction(PopVlan sourceAction) {
         val actionBuilder = new ActionBuilder();
@@ -328,13 +336,13 @@ public class MDFlowMapping {
         actionBuilder.action = new SwPathActionBuilder().build();
         return actionBuilder.build();
     }
-    
+
     public static def dispatch Address toInetAddress(Inet4Address address) {
         val it = new Ipv4Builder
         ipv4Address = new Ipv4Prefix(InetAddresses.toAddrString(address))
         return it.build()
     }
-    
+
     public static def dispatch Address toInetAddress(Inet6Address address) {
         val it = new Ipv6Builder
         ipv6Address = new Ipv6Prefix(InetAddresses.toAddrString(address))
@@ -344,7 +352,7 @@ public class MDFlowMapping {
     public static def List<Uri> toUriList(NodeConnector connector) {
         throw new UnsupportedOperationException("TODO: auto-generated method stub")
     }
-    
+
     public static def MacAddress toMacAddress(byte[] bytes) {
         val sb = new StringBuilder(18);
         for (byte b : bytes) {