ONOS-6074 Dynamic Config integration with Yang Runtime, compiler & model

Change-Id: I6c95bde6999c7b1536aa339dadd7274fc058291d
diff --git a/apps/pom.xml b/apps/pom.xml
index 497e5cc..911920d 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -88,6 +88,7 @@
         <module>ofagent</module>
         <module>intentsync</module>
         <module>mappingmanagement</module>
+        <module>yang</module>
     </modules>
 
     <properties>
diff --git a/apps/yang/BUCK b/apps/yang/BUCK
new file mode 100644
index 0000000..8c0b321
--- /dev/null
+++ b/apps/yang/BUCK
@@ -0,0 +1,24 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:onos-yang-model',
+    '//lib:onos-yang-compiler-api',
+    '//lib:onos-yang-runtime',
+]
+
+BUNDLES = [
+    '//lib:onos-yang-model',
+    '//lib:onos-yang-compiler-api',
+    '//lib:onos-yang-runtime',
+]
+
+osgi_jar (
+    deps = COMPILE_DEPS,
+)
+
+onos_app (
+    title = 'ONOS YANG Extension',
+    category = 'Utility',
+    url = 'http://onosproject.org',
+    description = 'Base application to bring in the YANG libraries and assemble them for other apps to use.',
+    included_bundles = BUNDLES,
+)
\ No newline at end of file
diff --git a/apps/yang/pom.xml b/apps/yang/pom.xml
new file mode 100644
index 0000000..98d43c2
--- /dev/null
+++ b/apps/yang/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>onos-apps</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.10.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>onos-app-yang</artifactId>
+    <packaging>bundle</packaging>
+    <description>Onos Yang Extension</description>
+    <properties>
+        <onos.app.name>org.onosproject.yang</onos.app.name>
+        <onos.app.category>Utility</onos.app.category>
+        <onos.app.title>Onos Yang Extension</onos.app.title>
+        <onos.app.url>http://onosproject.org</onos.app.url>
+        <onos.app.readme>Onos Yang Extension.</onos.app.readme>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-model</artifactId>
+            <version>1.12-b3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-compiler-api</artifactId>
+            <version>1.12-b3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-runtime</artifactId>
+            <version>1.12-b3</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/apps/yang/src/main/java/org/onosproject/yang/YangManager.java b/apps/yang/src/main/java/org/onosproject/yang/YangManager.java
new file mode 100644
index 0000000..c41e950
--- /dev/null
+++ b/apps/yang/src/main/java/org/onosproject/yang/YangManager.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yang;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.slf4j.Logger;
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Base application to bring in the YANG libraries and assemble them for other apps to use.
+ *
+ */
+@Component(immediate = true)
+public class YangManager {
+    private final Logger log = getLogger(getClass());
+    @Activate
+    public void activate() {
+        //log.info("Onos Yang Extension Activated!!");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        //log.info("Onos Yang Extension Deactivated!!");
+    }
+}
\ No newline at end of file
diff --git a/apps/yang/src/main/java/org/onosproject/yang/package-info.java b/apps/yang/src/main/java/org/onosproject/yang/package-info.java
new file mode 100755
index 0000000..8cba760
--- /dev/null
+++ b/apps/yang/src/main/java/org/onosproject/yang/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Base application to bring in the YANG libraries and assemble them for other apps to use.
+ */
+package org.onosproject.yang;
\ No newline at end of file
diff --git a/lib/BUCK b/lib/BUCK
index 27cfaee..57ee7a0 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -45,6 +45,8 @@
     ':onos-yang-datamodel',
     ':onos-yang-utils-generator',
     ':onos-yang-model',
+    ':onos-yang-compiler-api',
+    ':onos-yang-runtime',
     ':org.apache.servicemix.bundles.dom4j',
     ':onos-yang-maven-plugin',
   ],
@@ -1196,10 +1198,28 @@
 
 remote_jar (
   name = 'onos-yang-model',
-  out = 'onos-yang-model-1.12-b3.jar',
-  url = 'mvn:org.onosproject:onos-yang-model:jar:1.12-b3',
-  sha1 = 'd34678c2512e6207d9e0b5fb90930ad347a1119d',
-  maven_coords = 'org.onosproject:onos-yang-model:jar:NON-OSGI:1.12-b3',
+  out = 'onos-yang-model-1.12.0-b5.jar',
+  url = 'mvn:org.onosproject:onos-yang-model:jar:1.12.0-b5',
+  sha1 = '802d4dde9f27a14ed790ad57259cf6be484f789e',
+  maven_coords = 'org.onosproject:onos-yang-model:jar:NON-OSGI:1.12.0-b5',
+  visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
+  name = 'onos-yang-compiler-api',
+  out = 'onos-yang-compiler-api-1.12.0-b5.jar',
+  url = 'mvn:org.onosproject:onos-yang-compiler-api:jar:1.12.0-b5',
+  sha1 = 'e38e65bcc5c1fb5619a491f259f1354dce6af187',
+  maven_coords = 'org.onosproject:onos-yang-compiler-api:jar:NON-OSGI:1.12.0-b5',
+  visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
+  name = 'onos-yang-runtime',
+  out = 'onos-yang-runtime-1.12.0-b5.jar',
+  url = 'mvn:org.onosproject:onos-yang-runtime:jar:1.12.0-b5',
+  sha1 = 'c41c166f852731ca5375d65f0e89a1502a80f716',
+  maven_coords = 'org.onosproject:onos-yang-runtime:jar:NON-OSGI:1.12.0-b5',
   visibility = [ 'PUBLIC' ],
 )
 
diff --git a/lib/deps.json b/lib/deps.json
index d6312a5..b1cfafc 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -33,6 +33,9 @@
       { "name": "jsr305", "compile_only": true },
       "onos-yang-datamodel",
       "onos-yang-utils-generator",
+      "onos-yang-model",
+      "onos-yang-compiler-api",
+      "onos-yang-runtime",
       "org.apache.servicemix.bundles.dom4j",
       "onos-yang-maven-plugin"
     ],
@@ -209,6 +212,9 @@
     "onos-yang-datamodel": "mvn:org.onosproject:onos-yang-datamodel:1.11",
     "onos-yang-maven-plugin": "mvn:org.onosproject:onos-yang-maven-plugin:1.11",
     "onos-yang-utils-generator": "mvn:org.onosproject:onos-yang-utils-generator:1.11",
+    "onos-yang-model":"mvn:org.onosproject:onos-yang-model:1.12.0-b5",
+    "onos-yang-compiler-api":"mvn:org.onosproject:onos-yang-compiler-api:1.12.0-b5",
+    "onos-yang-runtime":"mvn:org.onosproject:onos-yang-runtime:1.12.0-b5",
     "org.apache.servicemix.bundles.dom4j":"mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.dom4j:1.6.1_5",
     "openflowj-3.0": {
       "uri": "mvn:org.projectfloodlight:openflowj:3.0.0-SNAPSHOT",
diff --git a/modules.defs b/modules.defs
index cd7ae6d..b983af1 100644
--- a/modules.defs
+++ b/modules.defs
@@ -189,6 +189,7 @@
     '//protocols/restconf/server:onos-protocols-restconf-server-oar',
     '//apps/restconf:onos-apps-restconf-oar',
     '//apps/flowspec-api:onos-apps-flowspec-api-oar',
+    '//apps/yang:onos-apps-yang-oar'
 ]
 
 APP_JARS = [