Make BridgeName strongly typed 04/15804/4
authorEd Warnicke <eaw@cisco.com>
Thu, 26 Feb 2015 22:41:30 +0000 (15:41 -0700)
committerEd Warnicke <eaw@cisco.com>
Tue, 3 Mar 2015 14:47:58 +0000 (06:47 -0800)
Change-Id: I77142202ac42ae1b5cf55cc50e071c14b97db9e4
Signed-off-by: Ed Warnicke <eaw@cisco.com>
southbound/southbound-api/src/main/yang/ovsdb.yang
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeUpdateCommand.java

index aea4501bc7d9689b69812f0184469552167e355f..f610e2dfc5425ed2fdd9860312e8ee27ac99d31a 100644 (file)
@@ -12,17 +12,21 @@ module ovsdb {
     revision "2015-01-05" {
         description "Initial revision of southbound model";
     }
-    
+
     typedef ovsdb-bridge-ref {
         description "A reference to an ovsdb bridge";
         type instance-identifier;
     }
-    
+
     typedef ovsdb-node-ref {
         description "A reference to an ovsdb node";
         type instance-identifier;
     }
-    
+
+    typedef ovsdb-bridge-name {
+        type string;
+    }
+
     grouping ovsdb-bridge-attributes {
         leaf bridge-uuid {
             description "The unique identifier of the bridge";
@@ -31,7 +35,7 @@ module ovsdb {
 
         leaf bridge-name {
             description "The name of the bridge";
-            type string;
+            type ovsdb-bridge-name;
         }
 
         leaf managed-by {
index 5edfe072262355f8885e42212efecd8177225fa0..59beb5f1c775d361286ec7133d492169eafa9c40 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
 import org.opendaylight.ovsdb.southbound.OvsdbClientKey;
 import org.opendaylight.ovsdb.southbound.SouthboundMapper;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbManagedNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbManagedNodeAugmentationBuilder;
@@ -57,7 +58,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
                 managedNodeBuilder.setNodeId(manageNodeId);
 
                 OvsdbManagedNodeAugmentationBuilder ovsdbManagedNodeBuilder = new OvsdbManagedNodeAugmentationBuilder();
-                ovsdbManagedNodeBuilder.setBridgeName(bridge.getName());
+                ovsdbManagedNodeBuilder.setBridgeName(new OvsdbBridgeName(bridge.getName()));
                 ovsdbManagedNodeBuilder.setBridgeUuid(new Uuid(bridge.getUuid().toString()));
                 ovsdbManagedNodeBuilder.setManagedBy(new OvsdbNodeRef(nodePath));
                 managedNodeBuilder.addAugmentation(OvsdbManagedNodeAugmentation.class, ovsdbManagedNodeBuilder.build());