Refactoring OpenROADM app to distribute the model as a separate app
and to locate the YANG models under /models tree.

Change-Id: Iff36569d7880e7930b4a1c24a6b36a7ea3760f20
diff --git a/apps/openroadm/BUCK b/apps/openroadm/BUCK
index c405f9d..c3fa40f 100644
--- a/apps/openroadm/BUCK
+++ b/apps/openroadm/BUCK
@@ -7,10 +7,10 @@
   'org.onosproject.protocols.restconfserver',
   'org.onosproject.netconf',
   'org.onosproject.netconfsb',
+  'org.onosproject.models.openroadm',
 ]
 
 BUNDLES = [
-  '//apps/openroadm/yangmodel:onos-apps-openroadm-yangmodel',
   '//apps/openroadm/service:onos-apps-openroadm-service',
   '//apps/openroadm/network:onos-apps-openroadm-network',
 ]
diff --git a/apps/openroadm/network/BUCK b/apps/openroadm/network/BUCK
index ed9d919..7e8d0b2 100644
--- a/apps/openroadm/network/BUCK
+++ b/apps/openroadm/network/BUCK
@@ -1,6 +1,6 @@
 COMPILE_DEPS = [
   '//lib:CORE_DEPS',
-  '//apps/openroadm/yangmodel:onos-apps-openroadm-yangmodel',
+  '//models/openroadm:onos-models-openroadm',
   '//core/store/serializers:onos-core-serializers',
 ] + YANG_TOOLS
 
diff --git a/apps/openroadm/service/BUCK b/apps/openroadm/service/BUCK
index ed9d919..7e8d0b2 100644
--- a/apps/openroadm/service/BUCK
+++ b/apps/openroadm/service/BUCK
@@ -1,6 +1,6 @@
 COMPILE_DEPS = [
   '//lib:CORE_DEPS',
-  '//apps/openroadm/yangmodel:onos-apps-openroadm-yangmodel',
+  '//models/openroadm:onos-models-openroadm',
   '//core/store/serializers:onos-core-serializers',
 ] + YANG_TOOLS
 
diff --git a/apps/openroadm/yangmodel/BUCK b/apps/openroadm/yangmodel/BUCK
deleted file mode 100644
index a4a4307..0000000
--- a/apps/openroadm/yangmodel/BUCK
+++ /dev/null
@@ -1,8 +0,0 @@
-yang_osgi_jar(
-  deps = YANG_TOOLS,
-  name = 'onos-apps-openroadm-yangmodel',
-  srcs = glob(['src/main/**/*.yang']),
-  visibility = [
-    'PUBLIC'
-  ],
-)
\ No newline at end of file
diff --git a/models/openroadm/BUCK b/models/openroadm/BUCK
new file mode 100644
index 0000000..275f574
--- /dev/null
+++ b/models/openroadm/BUCK
@@ -0,0 +1,5 @@
+
+yang_model(
+  app_name = 'org.onosproject.models.openroadm',
+  title = 'OpenROADM YANG Model',
+)
\ No newline at end of file
diff --git a/apps/openroadm/yangmodel/pom.xml b/models/openroadm/pom.xml
similarity index 100%
rename from apps/openroadm/yangmodel/pom.xml
rename to models/openroadm/pom.xml
diff --git a/apps/openroadm/yangmodel/src/main/yang/iana-afn-safi@2013-07-04.yang b/models/openroadm/src/main/yang/iana-afn-safi@2013-07-04.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/iana-afn-safi@2013-07-04.yang
rename to models/openroadm/src/main/yang/iana-afn-safi@2013-07-04.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/ietf-inet-types@2013-07-15.yang b/models/openroadm/src/main/yang/ietf-inet-types@2013-07-15.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/ietf-inet-types@2013-07-15.yang
rename to models/openroadm/src/main/yang/ietf-inet-types@2013-07-15.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/ietf-netconf-acm@2012-02-22.yang b/models/openroadm/src/main/yang/ietf-netconf-acm@2012-02-22.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/ietf-netconf-acm@2012-02-22.yang
rename to models/openroadm/src/main/yang/ietf-netconf-acm@2012-02-22.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/ietf-netconf@2011-06-01.yang b/models/openroadm/src/main/yang/ietf-netconf@2011-06-01.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/ietf-netconf@2011-06-01.yang
rename to models/openroadm/src/main/yang/ietf-netconf@2011-06-01.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/ietf-yang-types@2013-07-15.yang b/models/openroadm/src/main/yang/ietf-yang-types@2013-07-15.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/ietf-yang-types@2013-07-15.yang
rename to models/openroadm/src/main/yang/ietf-yang-types@2013-07-15.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-common-service-types.yang b/models/openroadm/src/main/yang/org-openroadm-common-service-types.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-common-service-types.yang
rename to models/openroadm/src/main/yang/org-openroadm-common-service-types.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-common-types.yang b/models/openroadm/src/main/yang/org-openroadm-common-types.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-common-types.yang
rename to models/openroadm/src/main/yang/org-openroadm-common-types.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-database.yang b/models/openroadm/src/main/yang/org-openroadm-database.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-database.yang
rename to models/openroadm/src/main/yang/org-openroadm-database.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-de-operations.yang b/models/openroadm/src/main/yang/org-openroadm-de-operations.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-de-operations.yang
rename to models/openroadm/src/main/yang/org-openroadm-de-operations.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-degree.yang b/models/openroadm/src/main/yang/org-openroadm-degree.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-degree.yang
rename to models/openroadm/src/main/yang/org-openroadm-degree.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-device-resource-types.yang b/models/openroadm/src/main/yang/org-openroadm-device-resource-types.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-device-resource-types.yang
rename to models/openroadm/src/main/yang/org-openroadm-device-resource-types.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-device.yang b/models/openroadm/src/main/yang/org-openroadm-device.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-device.yang
rename to models/openroadm/src/main/yang/org-openroadm-device.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-equipment-states-types.yang b/models/openroadm/src/main/yang/org-openroadm-equipment-states-types.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-equipment-states-types.yang
rename to models/openroadm/src/main/yang/org-openroadm-equipment-states-types.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-ethernet-interfaces.yang b/models/openroadm/src/main/yang/org-openroadm-ethernet-interfaces.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-ethernet-interfaces.yang
rename to models/openroadm/src/main/yang/org-openroadm-ethernet-interfaces.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-external-pluggable.yang b/models/openroadm/src/main/yang/org-openroadm-external-pluggable.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-external-pluggable.yang
rename to models/openroadm/src/main/yang/org-openroadm-external-pluggable.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-file-transfer.yang b/models/openroadm/src/main/yang/org-openroadm-file-transfer.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-file-transfer.yang
rename to models/openroadm/src/main/yang/org-openroadm-file-transfer.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-fwdl.yang b/models/openroadm/src/main/yang/org-openroadm-fwdl.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-fwdl.yang
rename to models/openroadm/src/main/yang/org-openroadm-fwdl.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-interfaces.yang b/models/openroadm/src/main/yang/org-openroadm-interfaces.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-interfaces.yang
rename to models/openroadm/src/main/yang/org-openroadm-interfaces.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-lldp.yang b/models/openroadm/src/main/yang/org-openroadm-lldp.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-lldp.yang
rename to models/openroadm/src/main/yang/org-openroadm-lldp.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-maintenance-loopback.yang b/models/openroadm/src/main/yang/org-openroadm-maintenance-loopback.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-maintenance-loopback.yang
rename to models/openroadm/src/main/yang/org-openroadm-maintenance-loopback.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-maintenance-testsignal.yang b/models/openroadm/src/main/yang/org-openroadm-maintenance-testsignal.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-maintenance-testsignal.yang
rename to models/openroadm/src/main/yang/org-openroadm-maintenance-testsignal.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-network.yang b/models/openroadm/src/main/yang/org-openroadm-network.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-network.yang
rename to models/openroadm/src/main/yang/org-openroadm-network.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-optical-channel-interfaces.yang b/models/openroadm/src/main/yang/org-openroadm-optical-channel-interfaces.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-optical-channel-interfaces.yang
rename to models/openroadm/src/main/yang/org-openroadm-optical-channel-interfaces.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-optical-transport-interfaces.yang b/models/openroadm/src/main/yang/org-openroadm-optical-transport-interfaces.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-optical-transport-interfaces.yang
rename to models/openroadm/src/main/yang/org-openroadm-optical-transport-interfaces.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-otn-odu-interfaces.yang b/models/openroadm/src/main/yang/org-openroadm-otn-odu-interfaces.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-otn-odu-interfaces.yang
rename to models/openroadm/src/main/yang/org-openroadm-otn-odu-interfaces.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-otn-otu-interfaces.yang b/models/openroadm/src/main/yang/org-openroadm-otn-otu-interfaces.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-otn-otu-interfaces.yang
rename to models/openroadm/src/main/yang/org-openroadm-otn-otu-interfaces.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-physical-types.yang b/models/openroadm/src/main/yang/org-openroadm-physical-types.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-physical-types.yang
rename to models/openroadm/src/main/yang/org-openroadm-physical-types.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-port-types.yang b/models/openroadm/src/main/yang/org-openroadm-port-types.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-port-types.yang
rename to models/openroadm/src/main/yang/org-openroadm-port-types.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-resource-types.yang b/models/openroadm/src/main/yang/org-openroadm-resource-types.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-resource-types.yang
rename to models/openroadm/src/main/yang/org-openroadm-resource-types.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-resource.yang b/models/openroadm/src/main/yang/org-openroadm-resource.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-resource.yang
rename to models/openroadm/src/main/yang/org-openroadm-resource.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-roadm.yang b/models/openroadm/src/main/yang/org-openroadm-roadm.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-roadm.yang
rename to models/openroadm/src/main/yang/org-openroadm-roadm.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-routing-constraints.yang b/models/openroadm/src/main/yang/org-openroadm-routing-constraints.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-routing-constraints.yang
rename to models/openroadm/src/main/yang/org-openroadm-routing-constraints.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-rstp.yang b/models/openroadm/src/main/yang/org-openroadm-rstp.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-rstp.yang
rename to models/openroadm/src/main/yang/org-openroadm-rstp.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-service.yang b/models/openroadm/src/main/yang/org-openroadm-service.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-service.yang
rename to models/openroadm/src/main/yang/org-openroadm-service.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-srg.yang b/models/openroadm/src/main/yang/org-openroadm-srg.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-srg.yang
rename to models/openroadm/src/main/yang/org-openroadm-srg.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-swdl.yang b/models/openroadm/src/main/yang/org-openroadm-swdl.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-swdl.yang
rename to models/openroadm/src/main/yang/org-openroadm-swdl.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-syslog.yang b/models/openroadm/src/main/yang/org-openroadm-syslog.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-syslog.yang
rename to models/openroadm/src/main/yang/org-openroadm-syslog.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-topology.yang b/models/openroadm/src/main/yang/org-openroadm-topology.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-topology.yang
rename to models/openroadm/src/main/yang/org-openroadm-topology.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-user-mgmt.yang b/models/openroadm/src/main/yang/org-openroadm-user-mgmt.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-user-mgmt.yang
rename to models/openroadm/src/main/yang/org-openroadm-user-mgmt.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-wavelength-map.yang b/models/openroadm/src/main/yang/org-openroadm-wavelength-map.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-wavelength-map.yang
rename to models/openroadm/src/main/yang/org-openroadm-wavelength-map.yang
diff --git a/apps/openroadm/yangmodel/src/main/yang/org-openroadm-xponder.yang b/models/openroadm/src/main/yang/org-openroadm-xponder.yang
similarity index 100%
rename from apps/openroadm/yangmodel/src/main/yang/org-openroadm-xponder.yang
rename to models/openroadm/src/main/yang/org-openroadm-xponder.yang
diff --git a/modules.defs b/modules.defs
index 764ed15..0ffb9ee 100644
--- a/modules.defs
+++ b/modules.defs
@@ -197,10 +197,12 @@
     '//apps/cord-support:onos-apps-cord-support-oar',
     '//apps/network-troubleshoot:onos-apps-network-troubleshoot-oar',
     '//apps/l3vpn:onos-apps-l3vpn-oar',
+    '//apps/openroadm:onos-apps-openroadm-oar',
 ]
 
 MODELS = [
     '//models/demo:onos-models-demo-oar',
+    '//models/openroadm:onos-models-openroadm-oar',
 ]
 
 APP_JARS = [