Bug 1264 - Multiple Usability Changes to MD-SAL App Archetype 35/8535/6
authorDevin Avery <devin.avery@brocade.com>
Wed, 2 Jul 2014 10:21:33 +0000 (06:21 -0400)
committerDevin Avery <devin.avery@brocade.com>
Mon, 7 Jul 2014 20:27:38 +0000 (16:27 -0400)
1) The "generate" bundle would lay down files which are actually automatically generated
when you compile the yang file. Since these files would be overwritten when we do a compile
we removed them from our archetype and let standard generation deal with creating them.
These files are auto-generated when you build the yang file and thus not necessary.
2) Split the initial xml into a provider and consumer initial xml files.
Used naming (05 for provider, 06 for consumer) to show priority (consumer requires provider)
3) Modified the generate to place the config subsystem xml files for producer / consumer
under their respective directories. (This way if they want to ship them, but not
auto deploy we have provided a best practice)
4) Added a file named Archetype_Next_Steps.README in the root folder which outlines
some quick next steps that people can follow in place of the wiki (it still references
wiki for more details)
5) Added comments to the .gitignore
6) Added missing provider config file template.

Change-Id: Ica9c1ab9d377ed972a76b0fa081f8f1fa2af1564
Signed-off-by: Devin Avery <devin.avery@brocade.com>
37 files changed:
main/archetypes/archetype-md-sal-app-simple/src/main/resources/META-INF/maven/archetype-metadata.xml
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/.gitignore
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/Archetype_Next_Steps.README [new file with mode: 0644]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/java/generate/CodeGenerator.java
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/java/generate/ConsumerTemplateProcessor.java
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/java/generate/ProviderTemplateProcessor.java
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/consumerModuleFactory.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/initialConfig_consumer.vm [moved from main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/initialConfig.vm with 68% similarity]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/abstractConsumerModule.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/abstractConsumerModuleFactory.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/consumerModuleMXBean.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/consumerServiceInterface.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/abstractConsumerImpl.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/abstractConsumerService.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/consumerImpl.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/consumerImplBuilder.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/rpcRegistry.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/rpcRegistryBuilder.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/yangModelBindingProvider.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/yangModuleInfoImpl.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/initialConfig_provider.vm [new file with mode: 0644]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/provider.vm
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/providerModule.vm
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/providerModuleFactory.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/providerYang.vm
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/abstractProviderModule.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/abstractProviderModuleFactory.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/providerModuleMXBean.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/dataBroker.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/dataBrokerBuilder.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/providerImpl.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/providerImplBuilder.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/rpcRegistry.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/rpcRegistryBuilder.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/providerImpl.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/yangModelBindingProvider.vm [deleted file]
main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/yangModuleInfoImpl.vm [deleted file]

index e3886af49762122642138f57b8ead43272db41ac..f6bdc7fe7eb133c48435fed0f571e19307fe0dc0 100644 (file)
@@ -86,6 +86,7 @@
       <directory></directory>
       <includes>
         <include>.gitignore</include>
+        <include>Archetype_Next_Steps.README</include>
       </includes>
     </fileSet>
     
index 7aaf8c95bc13216b166aa145ed3eb7d1f0060d7f..930c03372df5090be6d49645a62acfbe8a1068d3 100644 (file)
@@ -1,31 +1,40 @@
-
 #####standard .git ignore entries#####
 
+## IDE Specific Files ##
+.classpath
+.project
+.settings
+.idea
+.externalToolBuilders
+maven-eclipse.xml
+workspace
+
+## Compilation Files ##
 *.class
 **/target
-bin/
-dist
-workspace
-*~
 target
 target-ide
-.classpath
-.project
-.settings
 MANIFEST.MF
-opendaylight/northbound/integrationtest/logs/*
+
+## Misc Ignores (OS specific etc) ##
+bin/
+dist
+*~
 *.ipr
 *.iml
 *.iws
-.idea
-yang-gen-config
-yang-gen-sal
 classes
 out/
-.externalToolBuilders
-maven-eclipse.xml
 .DS_STORE
 .metadata
 
-#####Archetype .git ignore entries#######
-generate
\ No newline at end of file
+## Folders which contain auto generated source code ##
+yang-gen-config
+yang-gen-sal
+
+
+
+#####Archetype specific .git ignore entries#######
+generate
+Archetype_Next_Steps.README
+
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/Archetype_Next_Steps.README b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/Archetype_Next_Steps.README
new file mode 100644 (file)
index 0000000..7d22848
--- /dev/null
@@ -0,0 +1,144 @@
+This project was generated using the MD-SAL Maven Archetype.
+
+This ReadMe has the following sections:
+1) Quick Start - Follow Steps Before Editing Anything
+2) Quick Start - Deploying Your New Bundles.
+3) Automatically Deploying your Bundles
+4) Overview of Bundles
+5) Which Bundles do I Need?
+6) More Information
+
+==========================================================
+=== Quick Start - Follow Steps Before Editing Anything ===
+==========================================================
+These quick steps outline the commands you run one immediately following the creation of these projects.
+
+    1) One time only, cd into the 'generate' folder.
+
+    2) Run 'mvn clean install -Dgen' (this generates the remaining initial file content to finalize your
+    project's initial set up.
+
+    3) cd back up one level ( i.e. run 'cd ..' )
+
+    4) Delete the generate directory (it is no longer needed).
+
+    5) Run a maven build (i.e. 'mvn clean install' ).
+
+You are now ready to modify your source code. If you want, you can deploy your MD-SAL application now.
+
+================================================
+=== Quick Start - Deploying Your New Bundles ===
+================================================
+These steps outline how to manually deploy your new bundles. See below for how to set your bundles
+up to be automatically included in your distribution whenever that is built.
+
+    1) Locate your distribution of ODL. The distribution for the core controller is found under the
+    controller git repository (after running a mvn clean install from the controller root). The path is
+    controller/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/.
+
+    2)Copy model/target/<app-name>-model-<version>.jar to the 'plugins' directory in your distribution of the controller.
+
+    3)Copy provider/src/main/resources/configuration/initial/05-provider-<app_name>-sample.xml to the
+    'configuration/initial/' directory in your distribution of the controller.
+
+    4)Copy provider/target/<app-name>-provider-<version>.jar to the 'plugins' directory in your distribution of the controller.
+
+    5)Copy consumer/src/main/resources/configuration/initial/06-consumer-<app_name>-sample.xml to the
+    'configuration/initial/' directory in your distribution of the controller.
+
+    6)Copy consumer/target/<app-name>-consumer-<version>.jar to the 'plugins' directory in your distribution of the controller.
+
+    7)Copy web/target/<app-name>-web-<version>.jar to the 'plugins' directory in your distribution of the controller
+
+    8)Run the controller using the run.sh. You should see messages similar to the following being printed:
+
+//Note: Below our "app-name" is "Task" - you can see that we use that name as the prefix for classes.
+2014-07-02 05:16:08.258 EDT [config-pusher] INFO  o.o.c.c.y.c.t.i.TaskProviderModule - TaskProvider (instance org.opendaylight.controller.config.yang.config.task_provider.impl.TaskProviderModule$1CloseResources@11a15a0) initialized.
+2014-07-02 05:16:08.305 EDT [config-pusher] INFO  o.o.c.c.y.c.t.i.TaskConsumerModule - TaskConsumerService (instance org.opendaylight.controller.config.yang.config.task_consumer.impl.TaskConsumerModule$1AutoCloseableService@56e83e5e) initialized.
+
+If you see these info messages printed, then you have successfully deployed your bundles!
+
+============================================
+=== Automatically Deploying your Bundles ===
+============================================
+
+To have your bundles and configuration files deployed automatically when the distribution is built follow these steps:
+
+    1) Modify the 'controller/opendaylight/distribution/opendaylight/pom.xml" adding the bundles you want to deploy as dependencies.
+    (now when the distribution project is built, your artifacts will be automatically copied into the distribution).
+
+    2) *Move* provider/src/main/resources/configuration/initial/05-provider-<app_name>-sample.xml to the
+    'controller/opendaylight/distribution/opendaylight/src/main/resources/configuration/initial/' directory
+
+    3) *Move* consumer/src/main/resources/configuration/initial/06-consumer-<app_name>-sample.xml to the
+    'controller/opendaylight/distribution/opendaylight/src/main/resources/configuration/initial/' directory.
+    (when the distribution project is built these configuration files are copied to the configuration/initial directory in the distribution).
+
+===========================
+=== Overview of Bundles ===
+===========================
+
+Once the archetype creation completes, you will have 5 sub folders created.
+
+1) generate
+    - This is a helper folder which is used immediately after generating these files. It allows for
+    us to more intelligently configure your MD-SAL project beyond what a basic maven archetype can
+    do. Follow the steps in the 'Quick Start - Follow Steps Before Editing Anything' section above
+    to finish the archetype creation.
+
+2) model
+    - This folder contains the sample yang file which defines your "model". The generated file
+    contains sample contents of a yang file. *Generally* speaking, you will not need to add any
+    java code here (it is auto-generated from the yang file). There are a few exceptions when writing
+    complex yang files. For now, assume you do not have any need to make modifications there.
+
+3) provider
+    - The provider bundle sets you up with a service that implements any RPC (remote procedure calls)
+    that were defined in the model's yang files. Additionally, it automatically sets your application
+    up with access to the follow MD-SAL services:
+
+        a) DataBroker for reading, writing and listening to changes on models in the store
+        b) RpcRegistryService for registering your RPC implementation, or, invoking other RpcImplementations defined else where.
+        c) NotificationProviderService - for sending any Notifications defined in your yang file.
+
+4) consumer
+    - The consumer bundle illustrates how you could write an application which consumes the RPC services
+    that you provide with your provider bundle. In the consumer we only set up initial access to the
+    RpcRegistryService, however with a few modifications you can gain access to the DataBroker and
+    NotificationProviderService as well.
+
+5) web
+    - The web bundle provides an application that allows you to define customer REST APIs. Remember,
+    you get access to RESTConf web services for your model automatically just for deploying your
+    model.
+
+In addition to above folders/bundles we also generate:
+     i) a root parent pom.xml file which enables quick building of your projects bundles
+    ii) a .gitignore file, which is set up to automatically ignore a default set of files (target
+        directories, eclipse project files etc). Therefore running a 'git add .' command from the
+        root project should add only the files you want checked into source!
+   iii) This read me.
+
+================================
+=== Which Bundles do I Need? ===
+================================
+
+The bundles you need depend on your application. Refer to the above descriptions for details on
+what each bundle provides for you. Most MD-SAL applications can probably make due with just the following
+bundles to start:
+
+    model
+    provider
+
+If you don't want to use the other bundles for now, simply modify the root pom.xml and comment out
+the remaining bundles from the "modules" section at the end of the pom.xml file.
+
+Note: The consumer and provider bundles depend on the model bundle. So if you are using either of
+those bundles you must also use the model bundle.
+
+========================
+=== More Information ===
+========================
+For more information, view the Archetype wiki page on wiki.opendaylight.org.
+
+https://wiki.opendaylight.org/view/OpenDaylight_Toolkit:MD-SAL-Simple_Archetype
\ No newline at end of file
index 2dbe47abffe877eea31fc96c77770838338ccbd4..b52acb4d53ffa082dbb3d9a52e8e496fb8585b0b 100644 (file)
@@ -28,13 +28,13 @@ import org.json.simple.parser.JSONParser;
 public class CodeGenerator {
 
   private static String basePackage = "${package}";
-  /** 
+  /**
    * This variable holds the relative path from the working directory to the root folder where
    * we want to generate the specified files. Since the CodeGenerator is expected to be invoked from
-   * the child "generate" folder, we will set the path to root to be its parent.  
+   * the child "generate" folder, we will set the path to root to be its parent.
    */
   public static final String PATH_TO_ROOT_DIR = "../";
-  
+
   /**
    * This method expects two arguments application name and fields for application,
    * which it will receive from command line, while generating the project.
@@ -59,7 +59,6 @@ public class CodeGenerator {
     ProviderTemplateProcessor.processProviderTemplates(args[0], fieldKeys, ve);
     ConsumerTemplateProcessor.processConsumerTemplates(args[0], fieldKeys, ve);
     processWebViewTemplate(args[0], fieldKeys, ve);
-    processInitialConfig(args[0], ve);
   }
 
 
@@ -81,14 +80,21 @@ public class CodeGenerator {
     CodeGeneratorUtil.writeFile(PATH_TO_ROOT_DIR, path, context, template);
   }
 
-  private static void processInitialConfig(String appName, VelocityEngine ve) throws Exception{
+  /** 
+   * Generated the "initial" xml for the config subsystem. Need the name of the file now,
+   * since the consumer and provider are named differently.
+   */
+  private static void processInitialConfig(String templateName,
+                                           String outputName,
+                                           String appName,
+                                           VelocityEngine ve) throws Exception{
     /*  next, get the Template  */
-    Template template = ve.getTemplate( "initialConfig.vm" );
+    Template template = ve.getTemplate( templateName );
     /*  create a context and add data */
     VelocityContext context = new VelocityContext();
     context.put("app", appName);
     /* now render the template into a File */
-    String path = "configuration/initial/05-"+appName + "-sample.xml";
+    String path = "configuration/initial/" + outputName;
     CodeGeneratorUtil.writeFile(PATH_TO_ROOT_DIR, path, context, template);
   }
 
index e6fd46aae8c2146e0a6548c17bedec991173a8f1..3bb79a1f61393cbb5903b316038dd2a945bb0ea9 100644 (file)
@@ -13,20 +13,19 @@ public class ConsumerTemplateProcessor {
     processConsumerImpl(appName, ve);
     processConsumerService(appName, ve);
     processConsumerModule(appName, ve);
-    processConsumerModuleFactory(appName, ve);
-    processAbstractConsumerModule(appName, ve);
-    processAbstractConsumerModuleFactory(appName, ve);
-    processConsumerModuleMXBean(appName, ve);
-    processConsumerServiceInterface(appName, ve);
-    processAbstractConsumerService(appName, ve);
-    processAbstractConsumerImpl(appName, ve);
-    processYangModelBindingProvider(appName, ve);
-    processYangModuleInfoImpl(appName, ve);
-    processConsumerImplInterface(appName, ve);
-    processConsumerImplBuilder(appName, ve);
-    processRpcRegistry(appName, ve);
-    processRpcRegistryBuilder(appName, ve);
     processConsumerYang(appName, ve);
+    processInitialConfig( appName, ve );
+  }
+
+  private static void processInitialConfig( String appName, VelocityEngine ve) throws Exception{
+    /*  next, get the Template  */
+    Template template = ve.getTemplate( "consumer/initialConfig_consumer.vm" );
+    /*  create a context and add data */
+    VelocityContext context = new VelocityContext();
+    context.put("app", appName);
+    /* now render the template into a File */
+    String path = "consumer/src/main/resources/configuration/initial/06-consumer-" + appName + "-sample.xml";
+    CodeGeneratorUtil.writeFile(CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
   }
 
   private static void processConsumerImpl(String appName, VelocityEngine ve)  throws Exception{
@@ -62,17 +61,6 @@ public class ConsumerTemplateProcessor {
     CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
   }
 
-  private static void processConsumerModuleFactory(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/consumerModuleFactory.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    context.put("package", basePackage);
-    String path = "consumer/src/main/java/org/opendaylight/controller/config/yang/config/"+
-        appName +"_consumer/impl/" + CodeGeneratorUtil.capitalizeFirstLetter(appName)+"ConsumerModuleFactory.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
   private static void processConsumerYang(String appName, VelocityEngine ve)  throws Exception{
     /*  next, get the Template  */
     Template template = ve.getTemplate( "consumer/consumerYang.vm" );
@@ -83,145 +71,4 @@ public class ConsumerTemplateProcessor {
     CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
   }
 
-  private static void processConsumerServiceInterface(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-config/consumerServiceInterface.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    context.put("package", basePackage);
-    String path = "consumer/src/main/yang-gen-config/org/opendaylight/controller/config/yang/config/"
-    + appName+"_consumer/impl/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) + "ConsumerServiceServiceInterface.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processAbstractConsumerModule(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-config/abstractConsumerModule.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String path = "consumer/src/main/yang-gen-config/org/opendaylight/controller/config/yang/config/"
-        + appName+"_consumer/impl/Abstract"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) + "ConsumerModule.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processAbstractConsumerModuleFactory(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-config/abstractConsumerModuleFactory.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String path = "consumer/src/main/yang-gen-config/org/opendaylight/controller/config/yang/config/"
-        + appName+"_consumer/impl/Abstract"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) + "ConsumerModuleFactory.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processConsumerModuleMXBean(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-config/consumerModuleMXBean.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String path = "consumer/src/main/yang-gen-config/org/opendaylight/controller/config/yang/config/"
-        + appName+"_consumer/impl/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) + "ConsumerModuleMXBean.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processAbstractConsumerService(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/abstractConsumerService.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) + "ConsumerService.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processAbstractConsumerImpl(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/abstractConsumerImpl.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) + "ConsumerImpl.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processYangModelBindingProvider(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/yangModelBindingProvider.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/$YangModelBindingProvider.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processYangModuleInfoImpl(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/yangModuleInfoImpl.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/$YangModuleInfoImpl.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processConsumerImplInterface(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/config/consumerImpl.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/modules/module/configuration/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +
-        "ConsumerImpl.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processConsumerImplBuilder(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/config/consumerImplBuilder.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/modules/module/configuration/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +
-        "ConsumerImplBuilder.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processRpcRegistry(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/config/rpcRegistry.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/modules/module/configuration/"+ lowerApp+
-        "/consumer/impl/RpcRegistry.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processRpcRegistryBuilder(String appName, VelocityEngine ve)  throws Exception{
-    /*  next, get the Template  */
-    Template template = ve.getTemplate( "consumer/yang-gen-sal/config/rpcRegistryBuilder.vm" );
-    /*  create a context and add data */
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "consumer/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp+"/consumer/impl/rev140523/modules/module/configuration/"+ lowerApp+
-        "/consumer/impl/RpcRegistryBuilder.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
 }
\ No newline at end of file
index e5493327fb29dc3bc5384792d08b5e4734197e47..496946d56dab6e9b6276cfdbd7a7420ee0162780 100644 (file)
@@ -13,20 +13,19 @@ public class ProviderTemplateProcessor {
   public static void processProviderTemplates(String appName, Set fieldKeys, VelocityEngine ve)  throws Exception{
     processProviderTemplate(appName, fieldKeys, ve);
     processProviderYang(appName, ve);
-    processProviderSalImpl(appName, ve);
-    processProviderSalYangModImpl(appName, ve);
-    processProviderSalYangBinding(appName, ve);
-    processProviderSalConfImpl(appName, ve);
-    processProviderSalConfBuilder(appName, ve);
-    processProviderSalDataBroker(appName, ve);
-    processProviderSalRpc(appName, ve);
-    processProviderSalBrokerBuilder(appName, ve);
-    processProviderSalRpcBuilder(appName, ve);
-    processProviderAbstractModule(appName, ve);
-    processProviderAbstractModuleFactory(appName, ve);
-    processProviderMXBean(appName, ve);
     processProviderModule(appName, ve);
-    processProviderModuleFactory(appName, ve);
+    processInitialConfig( appName, ve );
+  }
+
+  private static void processInitialConfig( String appName, VelocityEngine ve) throws Exception{
+      /*  next, get the Template  */
+      Template template = ve.getTemplate( "provider/initialConfig_provider.vm" );
+      /*  create a context and add data */
+      VelocityContext context = new VelocityContext();
+      context.put("app", appName);
+      /* now render the template into a File */
+      String path = "provider/src/main/resources/configuration/initial/05-provider-" + appName + "-sample.xml";
+      CodeGeneratorUtil.writeFile(CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
   }
 
   private static void processProviderTemplate(String appName, Set fieldKeys, VelocityEngine ve)  throws Exception{
@@ -56,121 +55,6 @@ public class ProviderTemplateProcessor {
     CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
   }
 
-  private static void processProviderSalImpl(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/providerImpl.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/" + CodeGeneratorUtil.capitalizeFirstLetter(appName) +"ProviderImpl.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalYangModImpl(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/yangModuleInfoImpl.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/$YangModuleInfoImpl.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalYangBinding(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/yangModelBindingProvider.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/$YangModelBindingProvider.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalConfImpl(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/config/providerImpl.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/modules/module/configuration/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +"ProviderImpl.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalConfBuilder(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/config/providerImplBuilder.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/modules/module/configuration/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +"ProviderImplBuilder.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalDataBroker(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/config/dataBroker.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/modules/module/configuration/"+ lowerApp +"/provider/impl/DataBroker.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalBrokerBuilder(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/config/dataBrokerBuilder.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/modules/module/configuration/"+ lowerApp +"/provider/impl/DataBrokerBuilder.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalRpc(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/config/rpcRegistry.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/modules/module/configuration/"+ lowerApp +"/provider/impl/RpcRegistry.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderSalRpcBuilder(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-sal/config/rpcRegistryBuilder.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String lowerApp = appName.toLowerCase();
-    context.put("lowerApp", lowerApp);
-    String path = "provider/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/controller/config/"
-        + lowerApp + "/provider/impl/rev140523/modules/module/configuration/"+ lowerApp +"/provider/impl/RpcRegistryBuilder.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderAbstractModule(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-config/abstractProviderModule.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String path = "provider/src/main/yang-gen-config/org/opendaylight/controller/config/yang/config/"
-        + appName + "_provider/impl/Abstract"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +"ProviderModule.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderAbstractModuleFactory(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-config/abstractProviderModuleFactory.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String path = "provider/src/main/yang-gen-config/org/opendaylight/controller/config/yang/config/"
-        + appName + "_provider/impl/Abstract"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +"ProviderModuleFactory.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
-  private static void processProviderMXBean(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/yang-gen-config/providerModuleMXBean.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String path = "provider/src/main/yang-gen-config/org/opendaylight/controller/config/yang/config/"
-        + appName + "_provider/impl/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +"ProviderModuleMXBean.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
-
   private static void processProviderModule(String appName, VelocityEngine ve)  throws Exception {
     Template template = ve.getTemplate( "provider/providerModule.vm" );
     VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
@@ -180,11 +64,4 @@ public class ProviderTemplateProcessor {
     CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
   }
 
-  private static void processProviderModuleFactory(String appName, VelocityEngine ve)  throws Exception {
-    Template template = ve.getTemplate( "provider/providerModuleFactory.vm" );
-    VelocityContext context = CodeGeneratorUtil.createBasicVelocityContext(appName);
-    String path = "provider/src/main/java/org/opendaylight/controller/config/yang/config/"
-        + appName + "_provider/impl/"+ CodeGeneratorUtil.capitalizeFirstLetter(appName) +"ProviderModuleFactory.java";
-    CodeGeneratorUtil.writeFile( CodeGenerator.PATH_TO_ROOT_DIR, path, context, template);
-  }
 }
\ No newline at end of file
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/consumerModuleFactory.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/consumerModuleFactory.vm
deleted file mode 100644 (file)
index fc0f51e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-consumer-impl yang module local name: ${app}-consumer-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Sat May 24 19:33:40 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_consumer.impl;
-public class ${capitalApp}ConsumerModuleFactory extends org.opendaylight.controller.config.yang.config.${app}_consumer.impl.Abstract${capitalApp}ConsumerModuleFactory {
-
-}
     <configuration>
         <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
             <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-                <module>
-                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl">
-                        prefix:${app}-provider-impl
-                    </type>
-                    <name>${app}-provider-impl</name>
-
-                    <rpc-registry>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
-                        <name>binding-rpc-broker</name>
-                    </rpc-registry>
-                    <data-broker>
-                       <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
-                       <name>binding-data-broker</name>
-                    </data-broker>
-                </module>
 
                 <module>
                     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl">
@@ -55,7 +40,6 @@
     </configuration>
 
     <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:${app}-consumer:impl?module=${app}-consumer-impl&amp;revision=2014-05-23</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl?module=${app}-provider-impl&amp;revision=2014-05-23</capability>
     </required-capabilities>
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/abstractConsumerModule.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/abstractConsumerModule.vm
deleted file mode 100644 (file)
index 506986d..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-consumer-impl yang module local name: ${app}-consumer-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue May 27 13:19:37 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_consumer.impl;
-@org.opendaylight.yangtools.yang.binding.annotations.ModuleQName(revision = "2014-05-23", name = "${app}-consumer-impl", namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl")
-
-public abstract class Abstract${capitalApp}ConsumerModule implements org.opendaylight.controller.config.spi.Module,org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModuleMXBean,org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerServiceServiceInterface {
-    private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(org.opendaylight.controller.config.yang.config.${app}_consumer.impl.Abstract${capitalApp}ConsumerModule.class);
-
-    //attributes start
-
-    public static final org.opendaylight.controller.config.api.JmxAttribute rpcRegistryJmxAttribute = new org.opendaylight.controller.config.api.JmxAttribute("RpcRegistry");
-    private javax.management.ObjectName rpcRegistry; // mandatory
-
-    //attributes end
-
-    private final Abstract${capitalApp}ConsumerModule oldModule;
-    private final AutoCloseable oldInstance;
-    private AutoCloseable instance;
-    private final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver;
-    private final org.opendaylight.controller.config.api.ModuleIdentifier identifier;
-    @Override
-    public org.opendaylight.controller.config.api.ModuleIdentifier getIdentifier() {
-        return identifier;
-    }
-
-    public Abstract${capitalApp}ConsumerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        this.identifier = identifier;
-        this.dependencyResolver = dependencyResolver;
-        this.oldInstance=null;
-        ;this.oldModule=null;
-    }
-
-    public Abstract${capitalApp}ConsumerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,Abstract${capitalApp}ConsumerModule oldModule,AutoCloseable oldInstance) {
-        this.identifier = identifier;
-        this.dependencyResolver = dependencyResolver;
-        this.oldModule = oldModule;
-        this.oldInstance = oldInstance;
-    }
-
-    @Override
-    public void validate() {
-        dependencyResolver.validateDependency(org.opendaylight.controller.config.yang.md.sal.binding.RpcProviderRegistryServiceInterface.class, rpcRegistry, rpcRegistryJmxAttribute);
-        customValidation();
-    }
-
-    protected void customValidation() {
-    }
-
-    private org.opendaylight.controller.sal.binding.api.RpcProviderRegistry rpcRegistryDependency;
-    protected final org.opendaylight.controller.sal.binding.api.RpcProviderRegistry getRpcRegistryDependency(){
-        return rpcRegistryDependency;
-    }
-
-    @Override
-    public final AutoCloseable getInstance() {
-        if(instance==null) {
-            rpcRegistryDependency = dependencyResolver.resolveInstance(org.opendaylight.controller.sal.binding.api.RpcProviderRegistry.class, rpcRegistry, rpcRegistryJmxAttribute);if(oldInstance!=null && canReuseInstance(oldModule)) {
-                instance = reuseInstance(oldInstance);
-            } else {
-                if(oldInstance!=null) {
-                    try {
-                        oldInstance.close();
-                    } catch(Exception e) {
-                        logger.error("An error occurred while closing old instance " + oldInstance, e);
-                    }
-                }
-                instance = createInstance();
-                if (instance == null) {
-                    throw new IllegalStateException("Error in createInstance - null is not allowed as return value");
-                }
-            }
-        }
-        return instance;
-    }
-    public abstract AutoCloseable createInstance();
-
-    public boolean canReuseInstance(Abstract${capitalApp}ConsumerModule oldModule){
-        // allow reusing of old instance if no parameters was changed
-        return isSame(oldModule);
-    }
-
-    public AutoCloseable reuseInstance(AutoCloseable oldInstance){
-        // implement if instance reuse should be supported. Override canReuseInstance to change the criteria.
-        return oldInstance;
-    }
-
-    public boolean isSame(Abstract${capitalApp}ConsumerModule other) {
-        if (other == null) {
-            throw new IllegalArgumentException("Parameter 'other' is null");
-        }
-        if (rpcRegistryDependency != other.rpcRegistryDependency) { // reference to dependency must be same
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Abstract${capitalApp}ConsumerModule that = (Abstract${capitalApp}ConsumerModule) o;
-        return identifier.equals(that.identifier);
-    }
-
-    @Override
-    public int hashCode() {
-        return identifier.hashCode();
-    }
-
-    // getters and setters
-    @Override
-    public javax.management.ObjectName getRpcRegistry() {
-        return rpcRegistry;
-    }
-
-    @Override
-    @org.opendaylight.controller.config.api.annotations.RequireInterface(value = org.opendaylight.controller.config.yang.md.sal.binding.RpcProviderRegistryServiceInterface.class)
-    public void setRpcRegistry(javax.management.ObjectName rpcRegistry) {
-        this.rpcRegistry = rpcRegistry;
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/abstractConsumerModuleFactory.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/abstractConsumerModuleFactory.vm
deleted file mode 100644 (file)
index dd99d16..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-consumer-impl yang module local name: ${app}-consumer-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue May 27 13:19:37 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_consumer.impl;
-@org.opendaylight.yangtools.yang.binding.annotations.ModuleQName(revision = "2014-05-23", name = "${app}-consumer-impl", namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl")
-
-public abstract class Abstract${capitalApp}ConsumerModuleFactory implements org.opendaylight.controller.config.spi.ModuleFactory {
-    public static final String NAME = "${app}-consumer-impl";
-
-    private static final java.util.Set<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>> serviceIfcs;
-
-    @Override
-    public final String getImplementationName() {
-        return NAME;
-    }
-
-    static {
-        java.util.Set<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>> serviceIfcs2 = new java.util.HashSet<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>>();
-        serviceIfcs2.add(org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerServiceServiceInterface.class);
-        serviceIfcs = java.util.Collections.unmodifiableSet(serviceIfcs2);
-    }
-
-    @Override
-    public final boolean isModuleImplementingServiceInterface(Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface> serviceInterface) {
-        for (Class<?> ifc: serviceIfcs) {
-            if (serviceInterface.isAssignableFrom(ifc)){
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public java.util.Set<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>> getImplementedServiceIntefaces() {
-        return serviceIfcs;
-    }
-
-    @Override
-    public org.opendaylight.controller.config.spi.Module createModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.osgi.framework.BundleContext bundleContext) {
-        return instantiateModule(instanceName, dependencyResolver, bundleContext);
-    }
-
-    @Override
-    public org.opendaylight.controller.config.spi.Module createModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.api.DynamicMBeanWithInstance old, org.osgi.framework.BundleContext bundleContext) throws Exception {
-        org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule oldModule = null;
-        try {
-            oldModule = (org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule) old.getModule();
-        } catch(Exception e) {
-            return handleChangedClass(old);
-        }
-        org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule module = instantiateModule(instanceName, dependencyResolver, oldModule, old.getInstance(), bundleContext);
-        module.setRpcRegistry(oldModule.getRpcRegistry());
-
-        return module;
-    }
-
-    public org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule instantiateModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule oldModule, AutoCloseable oldInstance, org.osgi.framework.BundleContext bundleContext) {
-        return new org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule(new org.opendaylight.controller.config.api.ModuleIdentifier(NAME, instanceName), dependencyResolver, oldModule, oldInstance);
-    }
-
-    public org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule instantiateModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.osgi.framework.BundleContext bundleContext) {
-        return new org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule(new org.opendaylight.controller.config.api.ModuleIdentifier(NAME, instanceName), dependencyResolver);
-    }
-
-    public org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule handleChangedClass(org.opendaylight.controller.config.api.DynamicMBeanWithInstance old) throws Exception {
-        throw new UnsupportedOperationException("Class reloading is not supported");
-    }
-
-    @Override
-    public java.util.Set<org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule> getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory dependencyResolverFactory, org.osgi.framework.BundleContext bundleContext) {
-        return new java.util.HashSet<org.opendaylight.controller.config.yang.config.${app}_consumer.impl.${capitalApp}ConsumerModule>();
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/consumerModuleMXBean.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/consumerModuleMXBean.vm
deleted file mode 100644 (file)
index ab92641..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-consumer-impl yang module local name: ${app}-consumer-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue May 27 13:19:37 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_consumer.impl;
-public interface ${capitalApp}ConsumerModuleMXBean {
-    public javax.management.ObjectName getRpcRegistry();
-
-    public void setRpcRegistry(javax.management.ObjectName rpcRegistry);
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/consumerServiceInterface.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-config/consumerServiceInterface.vm
deleted file mode 100644 (file)
index 3c1e5b8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-consumer-impl yang module local name: ${app}-consumer-service
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue May 27 13:19:36 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_consumer.impl;
-@org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation(value = "(urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl?revision=2014-05-23)${app}-consumer-service", osgiRegistrationType = ${package}.consumer.${capitalApp}ConsumerService.class, namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl", revision = "2014-05-23", localName = "${app}-consumer-service")
-
-@org.opendaylight.yangtools.yang.binding.annotations.ModuleQName(namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl", revision = "2014-05-23", name = "${app}-consumer-impl")
-
-public interface ${capitalApp}ConsumerServiceServiceInterface extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface {
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/abstractConsumerImpl.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/abstractConsumerImpl.vm
deleted file mode 100644 (file)
index 6fe09a2..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ModuleType;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public abstract class ${capitalApp}ConsumerImpl extends ModuleType
- {
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl","2014-05-23","${app}-consumer-impl")
-    ;
-
-    public ${capitalApp}ConsumerImpl() {
-    }
-
-
-
-
-
-
-
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/abstractConsumerService.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/abstractConsumerService.vm
deleted file mode 100644 (file)
index 50d055b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public abstract class ${capitalApp}ConsumerService extends ServiceType
- {
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl","2014-05-23","${app}-consumer-service")
-    ;
-
-    public ${capitalApp}ConsumerService() {
-    }
-
-
-
-
-
-
-
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/consumerImpl.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/consumerImpl.vm
deleted file mode 100644 (file)
index e61702e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.modules.module.Configuration;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public interface ${capitalApp}ConsumerImpl
-    extends
-    DataObject,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>,
-    Configuration
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl","2014-05-23","${app}-consumer-impl")
-    ;
-
-    RpcRegistry getRpcRegistry();
-
-}
-
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/consumerImplBuilder.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/consumerImplBuilder.vm
deleted file mode 100644 (file)
index 06ff71b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry;
-import java.util.Map;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import java.util.HashMap;
-import java.util.Collections;
-
-
-
-public class ${capitalApp}ConsumerImplBuilder {
-
-    private RpcRegistry _rpcRegistry;
-
-    private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>> augmentation = new HashMap<>();
-
-    public ${capitalApp}ConsumerImplBuilder() {
-    }
-
-
-
-    public RpcRegistry getRpcRegistry() {
-        return _rpcRegistry;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>> E getAugmentation(Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-    public ${capitalApp}ConsumerImplBuilder setRpcRegistry(RpcRegistry value) {
-
-        this._rpcRegistry = value;
-        return this;
-    }
-
-    public ${capitalApp}ConsumerImplBuilder addAugmentation(Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl> augmentation) {
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public ${capitalApp}ConsumerImpl build() {
-        return new ${capitalApp}ConsumerImplImpl(this);
-    }
-
-    private static final class ${capitalApp}ConsumerImplImpl implements ${capitalApp}ConsumerImpl {
-
-        public Class<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl> getImplementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl.class;
-        }
-
-        private final RpcRegistry _rpcRegistry;
-
-        private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>> augmentation;
-
-        private ${capitalApp}ConsumerImplImpl(${capitalApp}ConsumerImplBuilder builder) {
-            this._rpcRegistry = builder.getRpcRegistry();
-            switch (builder.augmentation.size()) {
-             case 0:
-                 this.augmentation = Collections.emptyMap();
-                 break;
-             case 1:
-                 final Map.Entry<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>> e = builder.augmentation.entrySet().iterator().next();
-                 this.augmentation = Collections.<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>>singletonMap(e.getKey(), e.getValue());
-                 break;
-             default :
-                 this.augmentation = new HashMap<>(builder.augmentation);
-             }
-        }
-
-        @Override
-        public RpcRegistry getRpcRegistry() {
-            return _rpcRegistry;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${capitalApp}ConsumerImpl>> E getAugmentation(Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((_rpcRegistry == null) ? 0 : _rpcRegistry.hashCode());
-            result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            ${capitalApp}ConsumerImplImpl other = (${capitalApp}ConsumerImplImpl) obj;
-            if (_rpcRegistry == null) {
-                if (other._rpcRegistry != null) {
-                    return false;
-                }
-            } else if(!_rpcRegistry.equals(other._rpcRegistry)) {
-                return false;
-            }
-            if (augmentation == null) {
-                if (other.augmentation != null) {
-                    return false;
-                }
-            } else if(!augmentation.equals(other.augmentation)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder builder = new StringBuilder("${capitalApp}ConsumerImpl [");
-            boolean first = true;
-
-            if (_rpcRegistry != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_rpcRegistry=");
-                builder.append(_rpcRegistry);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/rpcRegistry.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/rpcRegistry.vm
deleted file mode 100644 (file)
index 25b7aad..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl;
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.modules.Module;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public interface RpcRegistry
-    extends
-    ChildOf<Module>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>,
-    ServiceRef
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl","2014-05-23","rpc-registry")
-    ;
-
-
-}
-
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/rpcRegistryBuilder.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/config/rpcRegistryBuilder.vm
deleted file mode 100644 (file)
index ff341fc..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl;
-import java.util.Map;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import java.util.HashMap;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import java.util.Collections;
-
-
-
-public class RpcRegistryBuilder {
-
-    private Object _name;
-    private Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> _type;
-
-    private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>> augmentation = new HashMap<>();
-
-    public RpcRegistryBuilder() {
-    }
-
-    public RpcRegistryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef arg) {
-        this._name = arg.getName();
-        this._type = arg.getType();
-    }
-
-    /**
-     Set fields from given grouping argument. Valid argument is instance of one of following types:
-     * <ul>
-     * <li>org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef</li>
-     * </ul>
-     *
-     * @param arg grouping object
-     * @throws IllegalArgumentException if given argument is none of valid types
-    */
-    public void fieldsFrom(DataObject arg) {
-        boolean isValidArg = false;
-        if (arg instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef) {
-            this._name = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef)arg).getName();
-            this._type = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef)arg).getType();
-            isValidArg = true;
-        }
-        if (!isValidArg) {
-            throw new IllegalArgumentException(
-              "expected one of: [org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef] \n" +
-              "but was: " + arg
-            );
-        }
-    }
-
-    public Object getName() {
-        return _name;
-    }
-
-    public Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> getType() {
-        return _type;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>> E getAugmentation(Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-    public RpcRegistryBuilder setName(Object value) {
-
-        this._name = value;
-        return this;
-    }
-
-    public RpcRegistryBuilder setType(Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> value) {
-
-        this._type = value;
-        return this;
-    }
-
-    public RpcRegistryBuilder addAugmentation(Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry> augmentation) {
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public RpcRegistry build() {
-        return new RpcRegistryImpl(this);
-    }
-
-    private static final class RpcRegistryImpl implements RpcRegistry {
-
-        public Class<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry> getImplementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry.class;
-        }
-
-        private final Object _name;
-        private final Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> _type;
-
-        private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>> augmentation;
-
-        private RpcRegistryImpl(RpcRegistryBuilder builder) {
-            this._name = builder.getName();
-            this._type = builder.getType();
-            switch (builder.augmentation.size()) {
-             case 0:
-                 this.augmentation = Collections.emptyMap();
-                 break;
-             case 1:
-                 final Map.Entry<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>> e = builder.augmentation.entrySet().iterator().next();
-                 this.augmentation = Collections.<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>>singletonMap(e.getKey(), e.getValue());
-                 break;
-             default :
-                 this.augmentation = new HashMap<>(builder.augmentation);
-             }
-        }
-
-        @Override
-        public Object getName() {
-            return _name;
-        }
-
-        @Override
-        public Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> getType() {
-            return _type;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523.modules.module.configuration.${lowerApp}.consumer.impl.RpcRegistry>> E getAugmentation(Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((_name == null) ? 0 : _name.hashCode());
-            result = prime * result + ((_type == null) ? 0 : _type.hashCode());
-            result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            RpcRegistryImpl other = (RpcRegistryImpl) obj;
-            if (_name == null) {
-                if (other._name != null) {
-                    return false;
-                }
-            } else if(!_name.equals(other._name)) {
-                return false;
-            }
-            if (_type == null) {
-                if (other._type != null) {
-                    return false;
-                }
-            } else if(!_type.equals(other._type)) {
-                return false;
-            }
-            if (augmentation == null) {
-                if (other.augmentation != null) {
-                    return false;
-                }
-            } else if(!augmentation.equals(other.augmentation)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder builder = new StringBuilder("RpcRegistry [");
-            boolean first = true;
-
-            if (_name != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_name=");
-                builder.append(_name);
-             }
-            if (_type != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_type=");
-                builder.append(_type);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/yangModelBindingProvider.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/yangModelBindingProvider.vm
deleted file mode 100644 (file)
index 242a375..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523;
-
-public final class $YangModelBindingProvider implements org.opendaylight.yangtools.yang.binding.YangModelBindingProvider {
-
-    public org.opendaylight.yangtools.yang.binding.YangModuleInfo getModuleInfo() {
-        return $YangModuleInfoImpl.getInstance();
-    }
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/yangModuleInfoImpl.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/consumer/yang-gen-sal/yangModuleInfoImpl.vm
deleted file mode 100644 (file)
index 74f8a97..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.consumer.impl.rev140523 ;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import java.util.Set;
-import java.util.HashSet;
-import com.google.common.collect.ImmutableSet;
-import java.io.InputStream;
-import java.io.IOException;
-public final class $YangModuleInfoImpl implements YangModuleInfo {
-
-    private static final YangModuleInfo INSTANCE = new $YangModuleInfoImpl();
-
-    private final String name = "${app}-consumer-impl";
-    private final String namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-consumer:impl";
-    private final String revision = "2014-05-23";
-    private final String resourcePath = "/META-INF/yang/${app}-consumer-impl.yang";
-
-    private final Set<YangModuleInfo> importedModules;
-
-    public static YangModuleInfo getInstance() {
-        return INSTANCE;
-    }
-
-    private $YangModuleInfoImpl() {
-        Set<YangModuleInfo> set = new HashSet<>();
-        set.add(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.$YangModuleInfoImpl.getInstance());
-        set.add(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.rev131028.$YangModuleInfoImpl.getInstance());
-        importedModules = ImmutableSet.copyOf(set);
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IllegalStateException("Resource '" + resourcePath + "' is missing");
-        }
-        try {
-            stream.close();
-        } catch (IOException e) {
-        // Resource leak, but there is nothing we can do
-        }
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getRevision() {
-        return revision;
-    }
-
-    @Override
-    public String getNamespace() {
-        return namespace;
-    }
-
-    @Override
-    public InputStream getModuleSourceStream() throws IOException {
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IOException("Resource " + resourcePath + " is missing");
-        }
-        return stream;
-    }
-
-    @Override
-    public Set<YangModuleInfo> getImportedModules() {
-        return importedModules;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(this.getClass().getCanonicalName());
-        sb.append("[");
-        sb.append("name = " + name);
-        sb.append(", namespace = " + namespace);
-        sb.append(", revision = " + revision);
-        sb.append(", resourcePath = " + resourcePath);
-        sb.append(", imports = " + importedModules);
-        sb.append("]");
-        return sb.toString();
-    }
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/initialConfig_provider.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/initialConfig_provider.vm
new file mode 100644 (file)
index 0000000..491faeb
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2013 Cisco Systems, Inc. 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
+-->
+<snapshot>
+    <configuration>
+        <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+            <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+                <module>
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl">
+                        prefix:${app}-provider-impl
+                    </type>
+                    <name>${app}-provider-impl</name>
+
+                    <rpc-registry>
+                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
+                        <name>binding-rpc-broker</name>
+                    </rpc-registry>
+                    <data-broker>
+                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
+                        <name>binding-data-broker</name>
+                    </data-broker>
+                     <notification-service>
+                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+                            binding:binding-notification-service
+                        </type>
+                        <name>binding-notification-broker</name>
+                    </notification-service>
+                </module>
+
+            </modules>
+        </data>
+
+    </configuration>
+
+    <required-capabilities>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl?module=${app}-provider-impl&amp;revision=2014-05-23</capability>
+    </required-capabilities>
+
+</snapshot>
+
index 79f9ee9e9e9f6d334fbd119c51f807b8cd202432..085d8d649b4692f4611f250bd5d1104105d836ce 100644 (file)
@@ -7,7 +7,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.common.util.Rpcs;
 import org.opendaylight.yang.gen.v1.opendaylight.sample.rev140407.EntryId;
@@ -35,15 +35,15 @@ public class ${capitalApp}Provider implements ${capitalApp}Service, AutoCloseabl
 
     private static final Logger log = LoggerFactory.getLogger(${capitalApp}Provider.class);
 
-    private DataBrokerService dataService;
+    private DataBroker dataService;
 
     private final ExecutorService executor;
 
-    public DataBrokerService getDataService() {
+    public DataBroker getDataService() {
       return dataService;
     }
 
-    public void setDataService(DataBrokerService dataService) {
+    public void setDataService(DataBroker dataService) {
       this.dataService = dataService;
     }
 
@@ -111,9 +111,9 @@ public class ${capitalApp}Provider implements ${capitalApp}Service, AutoCloseabl
             .child(Entry.class, entry.getKey());
         InstanceIdentifier<Entry> path = entryIdBuilder.toInstance();
         // Place entry in data store tree
-        final DataModificationTransaction it = dataService.beginTransaction();
-        it.putOperationalData(path, entry);
-        it.commit();
+        //final DataModificationTransaction it = dataService.beginTransaction();
+        //it.putOperationalData(path, entry);
+        //it.commit();
           return Rpcs.<Void> getRpcResult(true, null, Collections.<RpcError> emptySet());
       }
    }
index 9faed90d233ffb8e549e202e463fcac09c3270b2..4bac0dc7b4d5dbab0718008cecf973affc51d018 100644 (file)
@@ -1,8 +1,10 @@
 package org.opendaylight.controller.config.yang.config.${app}_provider.impl;
 
 import ${package}.provider.${capitalApp}Provider;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.yang.gen.v1.opendaylight.sample.rev140407.${capitalApp}Service;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -27,14 +29,21 @@ public class ${capitalApp}ProviderModule extends org.opendaylight.controller.con
     public AutoCloseable createInstance() {
         final ${capitalApp}Provider appProvider = new ${capitalApp}Provider();
 
-        DataProviderService dataBrokerService = getDataBrokerDependency();
+        DataBroker dataBrokerService = getDataBrokerDependency();
         appProvider.setDataService(dataBrokerService);
-        final BindingAwareBroker.RpcRegistration<${capitalApp}Service> rpcRegistration = getRpcRegistryDependency()
-                .addRpcImplementation(${capitalApp}Service.class, appProvider);
+
+        RpcProviderRegistry rpcRegistryDependency = getRpcRegistryDependency();
+        final BindingAwareBroker.RpcRegistration<${capitalApp}Service> rpcRegistration =
+                                rpcRegistryDependency
+                                    .addRpcImplementation(${capitalApp}Service.class, appProvider);
+
+        //retrieves the notification service for publishing notifications
+        NotificationProviderService notificationService = getNotificationServiceDependency();
+
 
         // Wrap toaster as AutoCloseable and close registrations to md-sal at
         // close()
-        final class AutoCloseableToaster implements AutoCloseable {
+        final class CloseResources implements AutoCloseable {
 
             @Override
             public void close() throws Exception {
@@ -44,7 +53,7 @@ public class ${capitalApp}ProviderModule extends org.opendaylight.controller.con
             }
         }
 
-        AutoCloseable ret = new AutoCloseableToaster();
+        AutoCloseable ret = new CloseResources();
         log.info("${capitalApp}Provider (instance {}) initialized.", ret);
         return ret;
     }
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/providerModuleFactory.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/providerModuleFactory.vm
deleted file mode 100644 (file)
index 2473654..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-provider-impl yang module local name: ${app}-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Fri May 23 11:39:12 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_provider.impl;
-public class ${capitalApp}ProviderModuleFactory extends org.opendaylight.controller.config.yang.config.${app}_provider.impl.Abstract${capitalApp}ProviderModuleFactory {
-
-}
index 65a4f08192e1b6d293efb6875437988f96c30674..b975a91bdd68270fc1a9807cdcca858db79c5e71 100644 (file)
@@ -25,6 +25,7 @@ module ${app}-provider-impl {
     }
 
     // Augments the 'configuration' choice node under modules/module.
+    // We consume the three main services, RPCs, DataStore, and Notifications
     augment "/config:modules/config:module/config:configuration" {
         case ${app}-provider-impl {
             when "/config:modules/config:module/config:type = '${app}-provider-impl'";
@@ -38,11 +39,20 @@ module ${app}-provider-impl {
                 }
             }
 
+            container notification-service {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity mdsal:binding-notification-service;
+                    }
+                }
+            }
+
             container data-broker {
                 uses config:service-ref {
                     refine type {
                         mandatory false;
-                        config:required-identity mdsal:binding-data-broker;
+                        config:required-identity mdsal:binding-async-data-broker;
                     }
                 }
             }
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/abstractProviderModule.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/abstractProviderModule.vm
deleted file mode 100644 (file)
index 6564e67..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-provider-impl yang module local name: ${app}-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Fri May 23 16:54:25 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_provider.impl;
-@org.opendaylight.yangtools.yang.binding.annotations.ModuleQName(revision = "2014-05-23", name = "${app}-provider-impl", namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl")
-
-public abstract class Abstract${capitalApp}ProviderModule implements org.opendaylight.controller.config.spi.Module,org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModuleMXBean {
-    private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(org.opendaylight.controller.config.yang.config.${app}_provider.impl.Abstract${capitalApp}ProviderModule.class);
-
-    //attributes start
-
-    public static final org.opendaylight.controller.config.api.JmxAttribute rpcRegistryJmxAttribute = new org.opendaylight.controller.config.api.JmxAttribute("RpcRegistry");
-    private javax.management.ObjectName rpcRegistry; // mandatory
-
-    public static final org.opendaylight.controller.config.api.JmxAttribute dataBrokerJmxAttribute = new org.opendaylight.controller.config.api.JmxAttribute("DataBroker");
-    private javax.management.ObjectName dataBroker; // optional
-
-    //attributes end
-
-    private final Abstract${capitalApp}ProviderModule oldModule;
-    private final AutoCloseable oldInstance;
-    private AutoCloseable instance;
-    private final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver;
-    private final org.opendaylight.controller.config.api.ModuleIdentifier identifier;
-    @Override
-    public org.opendaylight.controller.config.api.ModuleIdentifier getIdentifier() {
-        return identifier;
-    }
-
-    public Abstract${capitalApp}ProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        this.identifier = identifier;
-        this.dependencyResolver = dependencyResolver;
-        this.oldInstance=null;
-        ;this.oldModule=null;
-    }
-
-    public Abstract${capitalApp}ProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,Abstract${capitalApp}ProviderModule oldModule,AutoCloseable oldInstance) {
-        this.identifier = identifier;
-        this.dependencyResolver = dependencyResolver;
-        this.oldModule = oldModule;
-        this.oldInstance = oldInstance;
-    }
-
-    @Override
-    public void validate() {
-        dependencyResolver.validateDependency(org.opendaylight.controller.config.yang.md.sal.binding.RpcProviderRegistryServiceInterface.class, rpcRegistry, rpcRegistryJmxAttribute);
-        customValidation();
-    }
-
-    protected void customValidation() {
-    }
-
-    private org.opendaylight.controller.sal.binding.api.RpcProviderRegistry rpcRegistryDependency;
-    protected final org.opendaylight.controller.sal.binding.api.RpcProviderRegistry getRpcRegistryDependency(){
-        return rpcRegistryDependency;
-    }private org.opendaylight.controller.sal.binding.api.data.DataProviderService dataBrokerDependency;
-    protected final org.opendaylight.controller.sal.binding.api.data.DataProviderService getDataBrokerDependency(){
-        return dataBrokerDependency;
-    }
-
-    @Override
-    public final AutoCloseable getInstance() {
-        if(instance==null) {
-            if (dataBroker!=null) {
-                dataBrokerDependency = dependencyResolver.resolveInstance(org.opendaylight.controller.sal.binding.api.data.DataProviderService.class, dataBroker, dataBrokerJmxAttribute);;
-            }rpcRegistryDependency = dependencyResolver.resolveInstance(org.opendaylight.controller.sal.binding.api.RpcProviderRegistry.class, rpcRegistry, rpcRegistryJmxAttribute);if(oldInstance!=null && canReuseInstance(oldModule)) {
-                instance = reuseInstance(oldInstance);
-            } else {
-                if(oldInstance!=null) {
-                    try {
-                        oldInstance.close();
-                    } catch(Exception e) {
-                        logger.error("An error occurred while closing old instance " + oldInstance, e);
-                    }
-                }
-                instance = createInstance();
-                if (instance == null) {
-                    throw new IllegalStateException("Error in createInstance - null is not allowed as return value");
-                }
-            }
-        }
-        return instance;
-    }
-    public abstract AutoCloseable createInstance();
-
-    public boolean canReuseInstance(Abstract${capitalApp}ProviderModule oldModule){
-        // allow reusing of old instance if no parameters was changed
-        return isSame(oldModule);
-    }
-
-    public AutoCloseable reuseInstance(AutoCloseable oldInstance){
-        // implement if instance reuse should be supported. Override canReuseInstance to change the criteria.
-        return oldInstance;
-    }
-
-    public boolean isSame(Abstract${capitalApp}ProviderModule other) {
-        if (other == null) {
-            throw new IllegalArgumentException("Parameter 'other' is null");
-        }
-        if (rpcRegistryDependency != other.rpcRegistryDependency) { // reference to dependency must be same
-            return false;
-        }
-        if (dataBrokerDependency != other.dataBrokerDependency) { // reference to dependency must be same
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Abstract${capitalApp}ProviderModule that = (Abstract${capitalApp}ProviderModule) o;
-        return identifier.equals(that.identifier);
-    }
-
-    @Override
-    public int hashCode() {
-        return identifier.hashCode();
-    }
-
-    // getters and setters
-    @Override
-    public javax.management.ObjectName getRpcRegistry() {
-        return rpcRegistry;
-    }
-
-    @Override
-    @org.opendaylight.controller.config.api.annotations.RequireInterface(value = org.opendaylight.controller.config.yang.md.sal.binding.RpcProviderRegistryServiceInterface.class)
-    public void setRpcRegistry(javax.management.ObjectName rpcRegistry) {
-        this.rpcRegistry = rpcRegistry;
-    }
-
-    @Override
-    public javax.management.ObjectName getDataBroker() {
-        return dataBroker;
-    }
-
-    @Override
-    @org.opendaylight.controller.config.api.annotations.RequireInterface(value = org.opendaylight.controller.config.yang.md.sal.binding.DataProviderServiceServiceInterface.class)
-    public void setDataBroker(javax.management.ObjectName dataBroker) {
-        this.dataBroker = dataBroker;
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/abstractProviderModuleFactory.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/abstractProviderModuleFactory.vm
deleted file mode 100644 (file)
index 75e697d..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-provider-impl yang module local name: ${app}-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Fri May 23 16:54:25 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_provider.impl;
-@org.opendaylight.yangtools.yang.binding.annotations.ModuleQName(revision = "2014-05-23", name = "${app}-provider-impl", namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl")
-
-public abstract class Abstract${capitalApp}ProviderModuleFactory implements org.opendaylight.controller.config.spi.ModuleFactory {
-    public static final String NAME = "${app}-provider-impl";
-
-    private static final java.util.Set<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>> serviceIfcs;
-
-    @Override
-    public final String getImplementationName() {
-        return NAME;
-    }
-
-    static {
-        java.util.Set<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>> serviceIfcs2 = new java.util.HashSet<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>>();
-        serviceIfcs = java.util.Collections.unmodifiableSet(serviceIfcs2);
-    }
-
-    @Override
-    public final boolean isModuleImplementingServiceInterface(Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface> serviceInterface) {
-        for (Class<?> ifc: serviceIfcs) {
-            if (serviceInterface.isAssignableFrom(ifc)){
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public java.util.Set<Class<? extends org.opendaylight.controller.config.api.annotations.AbstractServiceInterface>> getImplementedServiceIntefaces() {
-        return serviceIfcs;
-    }
-
-    @Override
-    public org.opendaylight.controller.config.spi.Module createModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.osgi.framework.BundleContext bundleContext) {
-        return instantiateModule(instanceName, dependencyResolver, bundleContext);
-    }
-
-    @Override
-    public org.opendaylight.controller.config.spi.Module createModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.api.DynamicMBeanWithInstance old, org.osgi.framework.BundleContext bundleContext) throws Exception {
-        org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule oldModule = null;
-        try {
-            oldModule = (org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule) old.getModule();
-        } catch(Exception e) {
-            return handleChangedClass(old);
-        }
-        org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule module = instantiateModule(instanceName, dependencyResolver, oldModule, old.getInstance(), bundleContext);
-        module.setRpcRegistry(oldModule.getRpcRegistry());
-        module.setDataBroker(oldModule.getDataBroker());
-
-        return module;
-    }
-
-    public org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule instantiateModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule oldModule, AutoCloseable oldInstance, org.osgi.framework.BundleContext bundleContext) {
-        return new org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule(new org.opendaylight.controller.config.api.ModuleIdentifier(NAME, instanceName), dependencyResolver, oldModule, oldInstance);
-    }
-
-    public org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule instantiateModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.osgi.framework.BundleContext bundleContext) {
-        return new org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule(new org.opendaylight.controller.config.api.ModuleIdentifier(NAME, instanceName), dependencyResolver);
-    }
-
-    public org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule handleChangedClass(org.opendaylight.controller.config.api.DynamicMBeanWithInstance old) throws Exception {
-        throw new UnsupportedOperationException("Class reloading is not supported");
-    }
-
-    @Override
-    public java.util.Set<org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule> getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory dependencyResolverFactory, org.osgi.framework.BundleContext bundleContext) {
-        return new java.util.HashSet<org.opendaylight.controller.config.yang.config.${app}_provider.impl.${capitalApp}ProviderModule>();
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/providerModuleMXBean.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-config/providerModuleMXBean.vm
deleted file mode 100644 (file)
index a68703d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: ${app}-provider-impl yang module local name: ${app}-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Fri May 23 16:54:25 PDT 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.${app}_provider.impl;
-public interface ${capitalApp}ProviderModuleMXBean {
-    public javax.management.ObjectName getRpcRegistry();
-
-    public void setRpcRegistry(javax.management.ObjectName rpcRegistry);
-
-    public javax.management.ObjectName getDataBroker();
-
-    public void setDataBroker(javax.management.ObjectName dataBroker);
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/dataBroker.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/dataBroker.vm
deleted file mode 100644 (file)
index 0ea9275..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.modules.Module;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public interface DataBroker
-    extends
-    ChildOf<Module>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>,
-    ServiceRef
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl","2014-05-23","data-broker")
-    ;
-
-
-}
-
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/dataBrokerBuilder.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/dataBrokerBuilder.vm
deleted file mode 100644 (file)
index 3683a17..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl;
-
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-public class DataBrokerBuilder {
-
-    private Object _name;
-    private Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> _type;
-
-    private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>> augmentation = new HashMap<>();
-
-    public DataBrokerBuilder() {
-    }
-
-    public DataBrokerBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef arg) {
-        this._name = arg.getName();
-        this._type = arg.getType();
-    }
-
-    /**
-     Set fields from given grouping argument. Valid argument is instance of one of following types:
-     * <ul>
-     * <li>org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef</li>
-     * </ul>
-     *
-     * @param arg grouping object
-     * @throws IllegalArgumentException if given argument is none of valid types
-    */
-    public void fieldsFrom(DataObject arg) {
-        boolean isValidArg = false;
-        if (arg instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef) {
-            this._name = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef)arg).getName();
-            this._type = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef)arg).getType();
-            isValidArg = true;
-        }
-        if (!isValidArg) {
-            throw new IllegalArgumentException(
-              "expected one of: [org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef] \n" +
-              "but was: " + arg
-            );
-        }
-    }
-
-    public Object getName() {
-        return _name;
-    }
-
-    public Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> getType() {
-        return _type;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>> E getAugmentation(Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-    public DataBrokerBuilder setName(Object value) {
-
-        this._name = value;
-        return this;
-    }
-
-    public DataBrokerBuilder setType(Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> value) {
-
-        this._type = value;
-        return this;
-    }
-
-    public DataBrokerBuilder addAugmentation(Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker> augmentation) {
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public DataBroker build() {
-        return new DataBrokerImpl(this);
-    }
-
-    private static final class DataBrokerImpl implements DataBroker {
-
-        public Class<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker> getImplementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker.class;
-        }
-
-        private final Object _name;
-        private final Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> _type;
-
-        private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>> augmentation;
-
-        private DataBrokerImpl(DataBrokerBuilder builder) {
-            this._name = builder.getName();
-            this._type = builder.getType();
-            switch (builder.augmentation.size()) {
-             case 0:
-                 this.augmentation = Collections.emptyMap();
-                 break;
-             case 1:
-                 final Map.Entry<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>> e = builder.augmentation.entrySet().iterator().next();
-                 this.augmentation = Collections.<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>>singletonMap(e.getKey(), e.getValue());
-                 break;
-             default :
-                 this.augmentation = new HashMap<>(builder.augmentation);
-             }
-        }
-
-        @Override
-        public Object getName() {
-            return _name;
-        }
-
-        @Override
-        public Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> getType() {
-            return _type;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker>> E getAugmentation(Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((_name == null) ? 0 : _name.hashCode());
-            result = prime * result + ((_type == null) ? 0 : _type.hashCode());
-            result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            DataBrokerImpl other = (DataBrokerImpl) obj;
-            if (_name == null) {
-                if (other._name != null) {
-                    return false;
-                }
-            } else if(!_name.equals(other._name)) {
-                return false;
-            }
-            if (_type == null) {
-                if (other._type != null) {
-                    return false;
-                }
-            } else if(!_type.equals(other._type)) {
-                return false;
-            }
-            if (augmentation == null) {
-                if (other.augmentation != null) {
-                    return false;
-                }
-            } else if(!augmentation.equals(other.augmentation)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder builder = new StringBuilder("DataBroker [");
-            boolean first = true;
-
-            if (_name != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_name=");
-                builder.append(_name);
-             }
-            if (_type != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_type=");
-                builder.append(_type);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/providerImpl.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/providerImpl.vm
deleted file mode 100644 (file)
index cd46a61..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.modules.module.Configuration;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public interface ${capitalApp}ProviderImpl
-    extends
-    DataObject,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>,
-    Configuration
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl","2014-05-23","${app}-provider-impl")
-    ;
-
-    DataBroker getDataBroker();
-
-    RpcRegistry getRpcRegistry();
-
-}
-
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/providerImplBuilder.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/providerImplBuilder.vm
deleted file mode 100644 (file)
index 807ea03..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.DataBroker;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-public class ${capitalApp}ProviderImplBuilder {
-
-    private DataBroker _dataBroker;
-    private RpcRegistry _rpcRegistry;
-
-    private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>> augmentation = new HashMap<>();
-
-    public ${capitalApp}ProviderImplBuilder() {
-    }
-
-
-
-    public DataBroker getDataBroker() {
-        return _dataBroker;
-    }
-
-    public RpcRegistry getRpcRegistry() {
-        return _rpcRegistry;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>> E getAugmentation(Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-    public ${capitalApp}ProviderImplBuilder setDataBroker(DataBroker value) {
-
-        this._dataBroker = value;
-        return this;
-    }
-
-    public ${capitalApp}ProviderImplBuilder setRpcRegistry(RpcRegistry value) {
-
-        this._rpcRegistry = value;
-        return this;
-    }
-
-    public ${capitalApp}ProviderImplBuilder addAugmentation(Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl> augmentation) {
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public ${capitalApp}ProviderImpl build() {
-        return new ${capitalApp}ProviderImplImpl(this);
-    }
-
-    private static final class ${capitalApp}ProviderImplImpl implements ${capitalApp}ProviderImpl {
-
-        public Class<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl> getImplementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl.class;
-        }
-
-        private final DataBroker _dataBroker;
-        private final RpcRegistry _rpcRegistry;
-
-        private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>> augmentation;
-
-        private ${capitalApp}ProviderImplImpl(${capitalApp}ProviderImplBuilder builder) {
-            this._dataBroker = builder.getDataBroker();
-            this._rpcRegistry = builder.getRpcRegistry();
-            switch (builder.augmentation.size()) {
-             case 0:
-                 this.augmentation = Collections.emptyMap();
-                 break;
-             case 1:
-                 final Map.Entry<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>> e = builder.augmentation.entrySet().iterator().next();
-                 this.augmentation = Collections.<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>>singletonMap(e.getKey(), e.getValue());
-                 break;
-             default :
-                 this.augmentation = new HashMap<>(builder.augmentation);
-             }
-        }
-
-        @Override
-        public DataBroker getDataBroker() {
-            return _dataBroker;
-        }
-
-        @Override
-        public RpcRegistry getRpcRegistry() {
-            return _rpcRegistry;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${capitalApp}ProviderImpl>> E getAugmentation(Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((_dataBroker == null) ? 0 : _dataBroker.hashCode());
-            result = prime * result + ((_rpcRegistry == null) ? 0 : _rpcRegistry.hashCode());
-            result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            ${capitalApp}ProviderImplImpl other = (${capitalApp}ProviderImplImpl) obj;
-            if (_dataBroker == null) {
-                if (other._dataBroker != null) {
-                    return false;
-                }
-            } else if(!_dataBroker.equals(other._dataBroker)) {
-                return false;
-            }
-            if (_rpcRegistry == null) {
-                if (other._rpcRegistry != null) {
-                    return false;
-                }
-            } else if(!_rpcRegistry.equals(other._rpcRegistry)) {
-                return false;
-            }
-            if (augmentation == null) {
-                if (other.augmentation != null) {
-                    return false;
-                }
-            } else if(!augmentation.equals(other.augmentation)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder builder = new StringBuilder("${capitalApp}ProviderImpl [");
-            boolean first = true;
-
-            if (_dataBroker != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_dataBroker=");
-                builder.append(_dataBroker);
-             }
-            if (_rpcRegistry != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_rpcRegistry=");
-                builder.append(_rpcRegistry);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/rpcRegistry.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/rpcRegistry.vm
deleted file mode 100644 (file)
index ed18ffd..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.modules.Module;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public interface RpcRegistry
-    extends
-    ChildOf<Module>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>,
-    ServiceRef
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl","2014-05-23","rpc-registry")
-    ;
-
-
-}
-
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/rpcRegistryBuilder.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/config/rpcRegistryBuilder.vm
deleted file mode 100644 (file)
index 8499855..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl;
-
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-public class RpcRegistryBuilder {
-
-    private Object _name;
-    private Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> _type;
-
-    private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>> augmentation = new HashMap<>();
-
-    public RpcRegistryBuilder() {
-    }
-
-    public RpcRegistryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef arg) {
-        this._name = arg.getName();
-        this._type = arg.getType();
-    }
-
-    /**
-     Set fields from given grouping argument. Valid argument is instance of one of following types:
-     * <ul>
-     * <li>org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef</li>
-     * </ul>
-     *
-     * @param arg grouping object
-     * @throws IllegalArgumentException if given argument is none of valid types
-    */
-    public void fieldsFrom(DataObject arg) {
-        boolean isValidArg = false;
-        if (arg instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef) {
-            this._name = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef)arg).getName();
-            this._type = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef)arg).getType();
-            isValidArg = true;
-        }
-        if (!isValidArg) {
-            throw new IllegalArgumentException(
-              "expected one of: [org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceRef] \n" +
-              "but was: " + arg
-            );
-        }
-    }
-
-    public Object getName() {
-        return _name;
-    }
-
-    public Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> getType() {
-        return _type;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>> E getAugmentation(Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-    public RpcRegistryBuilder setName(Object value) {
-
-        this._name = value;
-        return this;
-    }
-
-    public RpcRegistryBuilder setType(Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> value) {
-
-        this._type = value;
-        return this;
-    }
-
-    public RpcRegistryBuilder addAugmentation(Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry> augmentation) {
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public RpcRegistry build() {
-        return new RpcRegistryImpl(this);
-    }
-
-    private static final class RpcRegistryImpl implements RpcRegistry {
-
-        public Class<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry> getImplementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry.class;
-        }
-
-        private final Object _name;
-        private final Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> _type;
-
-        private final Map<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>> augmentation;
-
-        private RpcRegistryImpl(RpcRegistryBuilder builder) {
-            this._name = builder.getName();
-            this._type = builder.getType();
-            switch (builder.augmentation.size()) {
-             case 0:
-                 this.augmentation = Collections.emptyMap();
-                 break;
-             case 1:
-                 final Map.Entry<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>> e = builder.augmentation.entrySet().iterator().next();
-                 this.augmentation = Collections.<Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>>singletonMap(e.getKey(), e.getValue());
-                 break;
-             default :
-                 this.augmentation = new HashMap<>(builder.augmentation);
-             }
-        }
-
-        @Override
-        public Object getName() {
-            return _name;
-        }
-
-        @Override
-        public Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ServiceType> getType() {
-            return _type;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523.modules.module.configuration.${lowerApp}.provider.impl.RpcRegistry>> E getAugmentation(Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((_name == null) ? 0 : _name.hashCode());
-            result = prime * result + ((_type == null) ? 0 : _type.hashCode());
-            result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            RpcRegistryImpl other = (RpcRegistryImpl) obj;
-            if (_name == null) {
-                if (other._name != null) {
-                    return false;
-                }
-            } else if(!_name.equals(other._name)) {
-                return false;
-            }
-            if (_type == null) {
-                if (other._type != null) {
-                    return false;
-                }
-            } else if(!_type.equals(other._type)) {
-                return false;
-            }
-            if (augmentation == null) {
-                if (other.augmentation != null) {
-                    return false;
-                }
-            } else if(!augmentation.equals(other.augmentation)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder builder = new StringBuilder("RpcRegistry [");
-            boolean first = true;
-
-            if (_name != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_name=");
-                builder.append(_name);
-             }
-            if (_type != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_type=");
-                builder.append(_type);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/providerImpl.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/providerImpl.vm
deleted file mode 100644 (file)
index f5509c8..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.ModuleType;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-public abstract class ${capitalApp}ProviderImpl extends ModuleType
- {
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl","2014-05-23","${app}-provider-impl")
-    ;
-
-    public ${capitalApp}ProviderImpl() {
-    }
-
-
-
-
-
-
-
-
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/yangModelBindingProvider.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/yangModelBindingProvider.vm
deleted file mode 100644 (file)
index ddfb2d2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.{lowerApp}.provider.impl.rev140523;
-
-public final class $YangModelBindingProvider implements org.opendaylight.yangtools.yang.binding.YangModelBindingProvider {
-
-    public org.opendaylight.yangtools.yang.binding.YangModuleInfo getModuleInfo() {
-        return $YangModuleInfoImpl.getInstance();
-    }
-}
diff --git a/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/yangModuleInfoImpl.vm b/main/archetypes/archetype-md-sal-app-simple/src/main/resources/archetype-resources/generate/src/main/template/provider/yang-gen-sal/yangModuleInfoImpl.vm
deleted file mode 100644 (file)
index 10ac8a5..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.${lowerApp}.provider.impl.rev140523 ;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import java.util.Set;
-import java.util.HashSet;
-import com.google.common.collect.ImmutableSet;
-import java.io.InputStream;
-import java.io.IOException;
-public final class $YangModuleInfoImpl implements YangModuleInfo {
-
-    private static final YangModuleInfo INSTANCE = new $YangModuleInfoImpl();
-
-    private final String name = "${app}-provider-impl";
-    private final String namespace = "urn:opendaylight:params:xml:ns:yang:controller:config:${app}-provider:impl";
-    private final String revision = "2014-05-23";
-    private final String resourcePath = "/META-INF/yang/${app}-provider-impl.yang";
-
-    private final Set<YangModuleInfo> importedModules;
-
-    public static YangModuleInfo getInstance() {
-        return INSTANCE;
-    }
-
-    private $YangModuleInfoImpl() {
-        Set<YangModuleInfo> set = new HashSet<>();
-        set.add(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.$YangModuleInfoImpl.getInstance());
-        set.add(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.binding.rev131028.$YangModuleInfoImpl.getInstance());
-        importedModules = ImmutableSet.copyOf(set);
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IllegalStateException("Resource '" + resourcePath + "' is missing");
-        }
-        try {
-            stream.close();
-        } catch (IOException e) {
-        // Resource leak, but there is nothing we can do
-        }
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getRevision() {
-        return revision;
-    }
-
-    @Override
-    public String getNamespace() {
-        return namespace;
-    }
-
-    @Override
-    public InputStream getModuleSourceStream() throws IOException {
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IOException("Resource " + resourcePath + " is missing");
-        }
-        return stream;
-    }
-
-    @Override
-    public Set<YangModuleInfo> getImportedModules() {
-        return importedModules;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(this.getClass().getCanonicalName());
-        sb.append("[");
-        sb.append("name = " + name);
-        sb.append(", namespace = " + namespace);
-        sb.append(", revision = " + revision);
-        sb.append(", resourcePath = " + resourcePath);
-        sb.append(", imports = " + importedModules);
-        sb.append("]");
-        return sb.toString();
-    }
-}