--- /dev/null
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-subsystem</artifactId>
+ <version>0.2.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>config-module-archetype</artifactId>
+ <name>config-module-archetype</name>
+ <description>Archetype for new module managed by configuration subsystem</description>
+
+</project>
--- /dev/null
+<archetype>
+ <id>config-module-archetype</id>
+
+ <allowPartial>true</allowPartial>
+
+ <requiredProperties>
+ <requiredProperty key="module-name">
+ </requiredProperty>
+ <requiredProperty key="module-name-java-prefix">
+ </requiredProperty>
+ <requiredProperty key="module-implementation-name">
+ <defaultValue>impl</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="config-api-yang-revision">
+ <defaultValue>2013-04-05</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="config-api-version">
+ <defaultValue>0.2.4-SNAPSHOT</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="yang-maven-plugin-version">
+ <defaultValue>0.6.2-SNAPSHOT</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="revision">
+ <defaultValue>2014-01-31</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="service-java-class">
+ <defaultValue>java.lang.AutoCloseable</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="maven-bundle-plugin-version">
+ <defaultValue>2.4.0</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="yang-namespace-mapping-from">
+ <defaultValue>urn:opendaylight:params:xml:ns:yang:controller</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="yang-namespace-mapping-to">
+ <defaultValue>org.opendaylight.controller.config.yang</defaultValue>
+ </requiredProperty>
+
+ </requiredProperties>
+
+ <fileSets>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/yang</directory>
+ </fileSet>
+ </fileSets>
+</archetype>
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <jmxGeneratorPath>${project.build.directory}/generated-sources/config</jmxGeneratorPath>
+ <config.version>${config-api-version}</config.version>
+ <maven.bundle.version>${maven-bundle-plugin-version}</maven.bundle.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-api</artifactId>
+ <version>${config.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ <version>${yang-maven-plugin-version}</version>
+ <executions>
+ <execution>
+ <id>config</id>
+ <goals>
+ <goal>generate-sources</goal>
+ </goals>
+ <configuration>
+ <codeGenerators>
+ <generator>
+ <codeGeneratorClass>
+ org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+ </codeGeneratorClass>
+ <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
+ <additionalConfiguration>
+ <namespaceToPackage1>
+ ${yang-namespace-mapping-from}==${yang-namespace-mapping-to}
+ </namespaceToPackage1>
+ </additionalConfiguration>
+ </generator>
+ </codeGenerators>
+ <inspectDependencies>true</inspectDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-jmx-generator-plugin</artifactId>
+ <version>${config.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${jmxGeneratorPath}</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${maven.bundle.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+ <Export-Package>
+ ${yang-namespace-mapping-to}.${module-name},
+ </Export-Package>
+ <Import-Package>
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+
+ </plugins>
+ </build>
+</project>
--- /dev/null
+// vi: set smarttab et sw=4 tabstop=4:
+module ${module-name}-${module-implementation-name} {
+
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:controller:config:${module-name}:${module-implementation-name}";
+ prefix "${module-name}-${module-implementation-name}";
+
+ import config { prefix config; revision-date ${config-api-yang-revision}; }
+ import ${module-name} { prefix ${module-name}; revision-date ${revision}; }
+
+ description
+ "This module contains the base YANG definitions for
+ ${module-name} ${module-implementation-name} implementation.";
+
+ revision "${revision}" {
+ description
+ "Initial revision.";
+ }
+
+ // This is the definition of a service implementation
+ identity ${module-name}-${module-implementation-name} {
+ base config:module-type;
+ config:provided-service ${module-name}:${module-name};
+ config:java-name-prefix ${module-name-java-prefix};
+ }
+
+ augment "/config:modules/config:module/config:configuration" {
+ case ${module-name}-${module-implementation-name} {
+ when "/config:modules/config:module/config:type = '${module-name}-${module-implementation-name}'";
+
+ leaf simple-attribute {
+ type uint32;
+ }
+
+ container dto-attribute {
+ leaf inner-attribute {
+ type string;
+ }
+ }
+
+ // Dependency attribute demonstration, the config:required-identity points to a service type
+ // In this case it is the same service type as this implementation provides: ${module-name}
+ container dependency-attribute {
+ uses config:service-ref {
+ refine type {
+ mandatory false;
+ config:required-identity ${module-name}:${module-name};
+ }
+ }
+ }
+
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// vi: set smarttab et sw=4 tabstop=4:
+module ${module-name} {
+
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:controller:config:${module-name}";
+ prefix "${module-name}";
+
+ import config { prefix config; revision-date ${config-api-yang-revision}; }
+
+ description
+ "This module contains the base YANG definitions for
+ ${module-name} services.";
+
+ revision "${revision}" {
+ description
+ "Initial revision.";
+ }
+
+ // This is the definition of a service
+ identity ${module-name} {
+
+ base "config:service-type";
+
+ // TODO modify the java class
+ config:java-class " ${service-java-class}";
+ }
+}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<!-- vi: set et smarttab sw=4 tabstop=4: --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<module>yang-test-plugin</module>
<module>shutdown-api</module>
<module>shutdown-impl</module>
+ <module>config-module-archetype</module>
</modules>
<profiles>
</goals>
</pluginExecutionFilter>
<action>
- <ignore />
+ <ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</plugins>
</pluginManagement>
</build>
-</project>
+</project>
\ No newline at end of file