Fixing sfc-scf-openflow naming/class convention 87/28787/2
authorReinaldo Penno <[email protected]>
Mon, 26 Oct 2015 04:43:16 +0000 (21:43 -0700)
committerReinaldo Penno <[email protected]>
Mon, 26 Oct 2015 05:24:07 +0000 (22:24 -0700)
- Module, namespace and file name need to be consistent in
  sfc-scf-openflow-provider-impl.yang

- Fixes on .yang required corresponding changes in package
  name, class name, etc

- Fixed all possible Yang issues in sfc-provider-impl.yang.
  I do not think this is the cause of any issues but fixed
  everything according to pyang

- Fixed initial config files

Change-Id: I14f1d7f90d0c1c76f454535bd45fb362b08e2f1c
Signed-off-by: Reinaldo Penno <[email protected]>
sfc-model/src/main/yang/sfc-common.yang
sfc-provider/src/main/yang/sfc-provider-impl.yang
sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_ofrenderer/impl/SfcScfOfRendererModule.java [deleted file]
sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_openflow_provider/impl/SfcScfOfRendererModule.java [new file with mode: 0644]
sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_openflow_provider/impl/SfcScfOfRendererModuleFactory.java [moved from sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_ofrenderer/impl/SfcScfOfRendererModuleFactory.java with 51% similarity]
sfc-scf-openflow/src/main/resources/configuration/initial/sfc-scf-openflow-initial.xml
sfc-scf-openflow/src/main/yang/sfc-scf-openflow-provider-impl.yang

index d65a7eee2ee2d78103922f91c1672be18ec3f99b..8e9d7800b9ff154d8f3541e45f271d4db929cc03 100644 (file)
@@ -4,12 +4,16 @@ module sfc-common {
 
   prefix sfc-common;
 
+  organization "Cisco Systems, Inc.";
+  contact "Keith Burns <[email protected]>";
+
   description
     "Common typedefs and leafrefs for project";
 
   revision 2015-10-17 {
     description
       "Initial revision";
+    reference "https://tools.ietf.org/html/draft-penno-sfc-yang";
   }
 
   // typedef for Service Node
@@ -21,6 +25,7 @@ module sfc-common {
   // typedefs for Service Function Chain
   typedef sfc-name {
       type string;
+      description "Service Function Chain Name";
   }
 
   // typedefs for Service Function
@@ -32,14 +37,14 @@ module sfc-common {
   typedef sf-data-plane-locator-name {
       type string;
       description
-                "A unique name for SF data-plane-locator";
+        "A unique name for SF data-plane-locator";
   }
 
   // typedefs for Rendererd Service Paths
   typedef rsp-name {
       type string;
       description
-          "Rendererd Service Path Name Type";
+        "Rendererd Service Path Name Type";
   }
 
   // typedefs for Service Function Path
@@ -52,7 +57,7 @@ module sfc-common {
   typedef sff-data-plane-locator-name {
       type string;
       description
-                "Service Function Forwarder data-plane-locator name type";
+        "Service Function Forwarder data-plane-locator name type";
   }
 
   typedef sff-name {
index 7a47d2531f7bab8b1890e01d9814a0ebc2991198..e11c5b4a60dc199f8960332cb60b179edb4dd62c 100644 (file)
@@ -7,51 +7,67 @@ module sfc-provider-impl {
 
   import config { prefix config; revision-date 2013-04-05; }
   import rpc-context { prefix rpcx; revision-date 2013-06-17; }
-  import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
+  import opendaylight-md-sal-binding {
+    prefix mdsal;
+    revision-date 2013-10-28;
+  }
+
+  organization "Cisco Systems, Inc.";
+  contact "Reinaldo Penno <[email protected]>";
 
   description
-      "This module contains the base YANG definitions for
-      sfc-provider impl implementation.";
+    "This module contains the base YANG definitions for
+     sfc-provider impl implementation.";
 
   revision "2014-06-30" {
-      description
-          "Initial revision.";
+    description "Initial revision.";
+    reference "https://tools.ietf.org/html/draft-penno-sfc-yang";
   }
 
-  // This is the definition of the service implementation as a module identity
   identity sfc-provider-impl {
-      base config:module-type;
+    base config:module-type;
+    description
+      "This is the definition of the service implementation" +
+      "as a module identity";
 
       // Specifies the prefix for generated java classes.
       config:java-name-prefix SfcProvider;
   }
 
-
-  // Augments the 'configuration' choice node under modules/module.
   augment "/config:modules/config:module/config:configuration" {
+    description
+      "Augments the 'configuration' choice node under
+       modules/module.";
     case sfc-provider-impl {
-      when "/config:modules/config:module/config:type = 'sfc-provider-impl'";
+      when "/config:modules/config:module/config:type =
+        'sfc-provider-impl'";
 
-      //wires in the data-broker service
       container data-broker {
+        description
+          "wires in the data broker registry service";
         uses config:service-ref {
           refine type {
-              mandatory false;
-              config:required-identity mdsal:binding-async-data-broker;
+            mandatory false;
+            config:required-identity mdsal:binding-async-data-broker;
           }
         }
       }
 
       container binding-registry {
-          uses config:service-ref {
-              refine type {
-                  mandatory true;
-                  config:required-identity mdsal:binding-broker-osgi-registry;
-              }
+        description
+          "wires in the binding broker osgi service";
+        uses config:service-ref {
+          refine type {
+            mandatory true;
+            config:required-identity
+              mdsal:binding-broker-osgi-registry;
           }
+        }
       }
 
       container rpc-registry {
+        description
+          "wires in the RPC registry service";
         uses config:service-ref {
           refine type {
              mandatory true;
diff --git a/sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_ofrenderer/impl/SfcScfOfRendererModule.java b/sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_ofrenderer/impl/SfcScfOfRendererModule.java
deleted file mode 100644 (file)
index 7336a90..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright (c) 2015 Intel Ltd. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- */
-package org.opendaylight.controller.config.yang.config.sfc_scf_ofrenderer.impl;
-
-import org.opendaylight.sfc.scfofrenderer.SfcScfOfRenderer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SfcScfOfRendererModule extends org.opendaylight.controller.config.yang.config.sfc_scf_ofrenderer.impl.AbstractSfcScfOfRendererModule {
-
-    private static final Logger LOG = LoggerFactory.getLogger(SfcScfOfRendererModule.class);
-
-    public SfcScfOfRendererModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
-                                 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public SfcScfOfRendererModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
-                                 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
-                                 org.opendaylight.controller.config.yang.config.sfc_scf_ofrenderer.impl.SfcScfOfRendererModule oldModule,
-                                 java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        LOG.info("SFC SCF OF Renderer initializing");
-
-        final SfcScfOfRenderer openflowSfcRenderer = new SfcScfOfRenderer(getDataBrokerDependency(), getNotificationServiceDependency());
-
-        java.lang.AutoCloseable ret = new java.lang.AutoCloseable() {
-            @Override
-            public void close() throws Exception {
-                openflowSfcRenderer.close();
-            }
-        };
-
-        LOG.info("SFC SCF OF Renderer initialized: (instance {})", ret);
-
-        return ret;
-    }
-}
diff --git a/sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_openflow_provider/impl/SfcScfOfRendererModule.java b/sfc-scf-openflow/src/main/java/org/opendaylight/controller/config/yang/config/sfc_scf_openflow_provider/impl/SfcScfOfRendererModule.java
new file mode 100644 (file)
index 0000000..aa6d8c6
--- /dev/null
@@ -0,0 +1,40 @@
+package org.opendaylight.controller.config.yang.config.sfc_scf_openflow_provider.impl;
+
+import org.opendaylight.sfc.scfofrenderer.SfcScfOfRenderer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SfcScfOfRendererModule extends org.opendaylight.controller.config.yang.config.sfc_scf_openflow_provider.impl.AbstractSfcScfOfRendererModule {
+
+    private static final Logger LOG = LoggerFactory.getLogger(SfcScfOfRendererModule.class);
+
+    public SfcScfOfRendererModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public SfcScfOfRendererModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.sfc_scf_openflow_provider.impl.SfcScfOfRendererModule oldModule, java.lang.AutoCloseable oldInstance) {
+        super(identifier, dependencyResolver, oldModule, oldInstance);
+    }
+
+    @Override
+    public void customValidation() {
+        // add custom validation form module attributes here.
+    }
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+        final SfcScfOfRenderer sfcScfOfRenderer = new SfcScfOfRenderer(getDataBrokerDependency(), getNotificationServiceDependency());
+
+        java.lang.AutoCloseable ret = new java.lang.AutoCloseable() {
+            @Override
+            public void close() throws Exception {
+                sfcScfOfRenderer.close();
+            }
+        };
+
+        LOG.info("SFC SCF openflow initialized: (instance {})", ret);
+
+        return ret;
+    }
+
+}
@@ -1,13 +1,13 @@
 /*
 * Generated file
 *
-* Generated from: yang module name: sfc-scf-ofrenderer-impl yang module local name: sfc-scf-ofrenderer-impl
+* Generated from: yang module name: sfc-scf-openflow-provider-impl yang module local name: sfc-scf-openflow-provider-impl
 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Fri Sep 18 02:39:37 UTC 2015
+* Generated at: Sun Oct 25 21:22:23 PDT 2015
 *
 * Do not modify this file unless it is present under src/main directory
 */
-package org.opendaylight.controller.config.yang.config.sfc_scf_ofrenderer.impl;
-public class SfcScfOfRendererModuleFactory extends org.opendaylight.controller.config.yang.config.sfc_scf_ofrenderer.impl.AbstractSfcScfOfRendererModuleFactory {
+package org.opendaylight.controller.config.yang.config.sfc_scf_openflow_provider.impl;
+public class SfcScfOfRendererModuleFactory extends org.opendaylight.controller.config.yang.config.sfc_scf_openflow_provider.impl.AbstractSfcScfOfRendererModuleFactory {
 
 }
index df7911522ebdb0ea5e8f10f49381d5175312fe64..6aa131821b2b88cad9e3052e4d95094d79763fa9 100644 (file)
@@ -4,10 +4,10 @@
         <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
             <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
                 <module>
-                    <type xmlns:sfc="urn:opendaylight:params:xml:ns:yang:controller:config:sfc-scf-ofrenderer:impl">
-                        sfc:sfc-scf-ofrenderer-impl
+                    <type xmlns:sfc="urn:opendaylight:params:xml:ns:yang:controller:config:sfc-scf-openflow-provider:impl">
+                        sfc:sfc-scf-openflow-provider-impl
                     </type>
-                    <name>sfc-scf-ofrenderer-impl</name>
+                    <name>sfc-scf-openflow-provider-impl</name>
 
                     <rpc-registry>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
@@ -34,7 +34,7 @@
     <required-capabilities>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:config:sfc-provider:impl?module=sfc-provider-impl&amp;revision=2014-06-30</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:sfc-scf-ofrenderer:impl?module=sfc-scf-ofrenderer-impl&amp;revision=2014-09-01</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:sfc-scf-openflow-provider:impl?module=sfc-scf-openflow-provider-impl&amp;revision=2014-09-01</capability>
     </required-capabilities>
 
 </snapshot>
index ecd8ba8459ab0b9d64e01a1b37d406c5b243ed4a..31311184d06aef2be9bbe41cdebebcdeaa44a7fb 100644 (file)
@@ -1,9 +1,9 @@
 // vi: set smarttab et sw=4 tabstop=4:
-module sfc-scf-ofrenderer-impl {
+module sfc-scf-openflow-provider-impl {
 
   yang-version 1;
-  namespace "urn:opendaylight:params:xml:ns:yang:controller:config:sfc-scf-ofrenderer:impl";
-  prefix "sfc-scf-ofrenderer-impl";
+  namespace "urn:opendaylight:params:xml:ns:yang:controller:config:sfc-scf-openflow-provider:impl";
+  prefix "sfc-scf-openflow-provider-impl";
 
   import config { prefix config; revision-date 2013-04-05; }
   import rpc-context { prefix rpcx; revision-date 2013-06-17; }
@@ -20,7 +20,7 @@ module sfc-scf-ofrenderer-impl {
   }
 
   // This is the definition of the service implementation as a module identity
-  identity sfc-scf-ofrenderer-impl {
+  identity sfc-scf-openflow-provider-impl {
       base config:module-type;
 
       // Specifies the prefix for generated java classes.
@@ -30,8 +30,8 @@ module sfc-scf-ofrenderer-impl {
 
   // Augments the 'configuration' choice node under modules/module.
   augment "/config:modules/config:module/config:configuration" {
-    case sfc-scf-ofrenderer-impl {
-      when "/config:modules/config:module/config:type = 'sfc-scf-ofrenderer-impl'";
+    case sfc-scf-openflow-provider-impl {
+      when "/config:modules/config:module/config:type = 'sfc-scf-openflow-provider-impl'";
 
       //wires in the data-broker service
       container data-broker {