modified meter and group enum from leaf to typedef. 64/3264/2
authorPrasanna Huddar <prasanna.huddar@ericsson.com>
Sat, 30 Nov 2013 14:35:55 +0000 (20:05 +0530)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 30 Nov 2013 15:59:51 +0000 (15:59 +0000)
Signed-off-by: Prasanna Huddar <prasanna.huddar@ericsson.com>
Change-Id: I5cb3d27519818979d9c5559bd834480b831d8049

opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/consumer/impl/FlowConsumerImpl.java
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/consumer/impl/GroupConsumerImpl.java
opendaylight/md-sal/model/model-flow-base/src/main/yang/group-types.yang
opendaylight/md-sal/model/model-flow-base/src/main/yang/meter-types.yang

index 9d2a6a0..6aa0d5f 100644 (file)
@@ -185,6 +185,7 @@ public class FlowConsumerImpl implements IForwardingRulesManager {
     private void addFlow(InstanceIdentifier<?> path, Flow dataObject) {
 
         AddFlowInputBuilder input = new AddFlowInputBuilder();
+        
         List<Instruction> inst = (dataObject).getInstructions().getInstruction();
         input.setNode((dataObject).getNode());
         input.setPriority((dataObject).getPriority());
index b8dac19..381faa4 100644 (file)
@@ -35,15 +35,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.Gro
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupRemoved;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupUpdated;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupTypes.GroupType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupTypes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.config.rev131024.meters.Meter;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -239,8 +237,8 @@ public class GroupConsumerImpl implements IForwardingRulesManager {
                 return new Status(StatusCode.BADREQUEST, "Group record does not exist");
             }*/
 
-            if (!(group.getGroupType().getIntValue() >= GroupType.GroupAll.getIntValue() && group.getGroupType()
-                    .getIntValue() <= GroupType.GroupFf.getIntValue())) {
+            if (!(group.getGroupType().getIntValue() >= GroupTypes.GroupAll.getIntValue() && group.getGroupType()
+                    .getIntValue() <= GroupTypes.GroupFf.getIntValue())) {
                 logger.error("Invalid Group type %d" + group.getGroupType().getIntValue());
                 return new Status(StatusCode.BADREQUEST, "Invalid Group type");
             }
index 25e8e7a..244fedb 100644 (file)
@@ -14,30 +14,30 @@ module opendaylight-group-types {
         type uint32;
     }
     
-    grouping group-types {
-        leaf group-type {
-            type enumeration {
-                enum group-all;
-                enum group-select;
-                enum group-indirect;
-                enum group-ff;
-            }
-        }
+    typedef group-types {        
+        type enumeration {
+            enum group-all;
+            enum group-select;
+            enum group-indirect;
+            enum group-ff;
+        }        
     }
     
     typedef group-capabilities { 
-               type enumeration {
-                enum select-weight;
-                enum select-liveness;
-                enum chaining;
-                enum chaining-checks;
-            }   
-        }
+        type enumeration {
+            enum select-weight;
+            enum select-liveness;
+            enum chaining;
+            enum chaining-checks;
+        }   
+    }
     
     
     grouping group {
         
-        uses group-types;
+        leaf group-type {
+            type group-types;
+        }
         
         leaf group-id {
             type group-id;
index d26ca66..fc9be63 100644 (file)
@@ -14,24 +14,25 @@ module opendaylight-meter-types {
             type uint32;
     }
     
-    grouping meter-flags {
-        leaf flags {
-            type bits {
-                bit meter-kbps;
-                bit meter-pktps;
-                bit meter-burst;
-                bit meter-stats;
-            }
-        }
+    // field types
+    identity meter-flags {
+        description "Base identity for match Fields";
     }
     
-    grouping meter-band-type {
-        leaf flags {
-            type bits {
-                bit ofpmbt-drop;
-                bit ofpmbt-dscp-remark;
-                bit ofpmbt-experimenter;               
-            }
+    typedef meter-flags {        
+        type bits {
+            bit meter-kbps;
+            bit meter-pktps;
+            bit meter-burst;
+            bit meter-stats;
+        }        
+    }
+    
+    typedef meter-band-type {
+        type bits {
+            bit ofpmbt-drop;
+            bit ofpmbt-dscp-remark;
+            bit ofpmbt-experimenter;               
         }
     }
     
@@ -79,7 +80,9 @@ module opendaylight-meter-types {
     
     grouping meter {
         
-        uses meter-flags;        
+        leaf flags {
+           type meter-flags;        
+        }
         
         leaf meter-id {
             type meter-id;
@@ -104,7 +107,9 @@ module opendaylight-meter-types {
                 }
                 
                 container meter-band-types {
-                    uses meter-band-type;
+                    leaf flags {
+                        type meter-band-type;
+                    }
                 }
             
                 leaf rate {