Initial check-in Open ROADM app v1.2.1 (ONOS-5354).

Change-Id: I077b40c308efe257af0e23f0d87de1215c3789ad
diff --git a/apps/openroadm/service/BUCK b/apps/openroadm/service/BUCK
new file mode 100644
index 0000000..ed9d919
--- /dev/null
+++ b/apps/openroadm/service/BUCK
@@ -0,0 +1,9 @@
+COMPILE_DEPS = [
+  '//lib:CORE_DEPS',
+  '//apps/openroadm/yangmodel:onos-apps-openroadm-yangmodel',
+  '//core/store/serializers:onos-core-serializers',
+] + YANG_TOOLS
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+)
diff --git a/apps/openroadm/service/pom.xml b/apps/openroadm/service/pom.xml
new file mode 100644
index 0000000..7f5499a
--- /dev/null
+++ b/apps/openroadm/service/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<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-openroadm</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.2.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-apps-openroadm-service</artifactId>
+    <version>1.2.1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <description>Open ROADM Service Model</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-yang</artifactId>
+            <version>1.10.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/apps/openroadm/service/src/main/java/org/onosproject/openroadm/service/OpenRoadmServiceModelRegistrator.java b/apps/openroadm/service/src/main/java/org/onosproject/openroadm/service/OpenRoadmServiceModelRegistrator.java
new file mode 100644
index 0000000..f5f68b6
--- /dev/null
+++ b/apps/openroadm/service/src/main/java/org/onosproject/openroadm/service/OpenRoadmServiceModelRegistrator.java
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+package org.onosproject.openroadm.service;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.felix.scr.annotations.Component;
+import org.onosproject.yang.AbstractYangModelRegistrator;
+import org.onosproject.yang.gen.v1.http.org.openroadm.common.service.types.rev20161014.OrgOpenroadmCommonServiceTypes;
+import org.onosproject.yang.gen.v1.http.org.openroadm.common.types.rev20161014.OrgOpenroadmCommonTypes;
+import org.onosproject.yang.gen.v1.http.org.openroadm.resource.rev20161014.OrgOpenroadmResource;
+import org.onosproject.yang.gen.v1.http.org.openroadm.resource.types.rev20161014.OrgOpenroadmResourceTypes;
+import org.onosproject.yang.gen.v1.http.org.openroadm.routing.constrains.rev20161014.OrgOpenroadmRoutingConstraints;
+import org.onosproject.yang.gen.v1.http.org.openroadm.service.rev20161014.OrgOpenroadmService;
+import org.onosproject.yang.gen.v1.http.org.openroadm.topology.rev20161014.OrgOpenroadmTopology;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev20130715.IetfInetTypes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev20130715.IetfYangTypes;
+import org.onosproject.yang.model.DefaultYangModuleId;
+import org.onosproject.yang.model.YangModuleId;
+import org.onosproject.yang.runtime.AppModuleInfo;
+import org.onosproject.yang.runtime.DefaultAppModuleInfo;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Component to register the Open ROADM service model and its dependencies.
+ */
+@Component(immediate = true)
+public class OpenRoadmServiceModelRegistrator extends AbstractYangModelRegistrator {
+    public OpenRoadmServiceModelRegistrator() {
+        super(OrgOpenroadmService.class, getAppInfo());
+    }
+
+    private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
+        Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
+        // Dependencies for org-openroadm-service
+        appInfo.put(new DefaultYangModuleId("ietf-yang-types", "2013-07-15"),
+                new DefaultAppModuleInfo(IetfYangTypes.class, null));
+        appInfo.put(new DefaultYangModuleId("org-openroadm-routing-constraints", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmRoutingConstraints.class, null));
+        appInfo.put(new DefaultYangModuleId("org-openroadm-common-types", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmCommonTypes.class, null));
+        appInfo.put(new DefaultYangModuleId("org-openroadm-resource-types", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmResourceTypes.class, null));
+        appInfo.put(new DefaultYangModuleId("org-openroadm-common-service-types", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmCommonServiceTypes.class, null));
+
+        // Dependencies for org-openroadm-common-service-types
+        appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-07-15"),
+                new DefaultAppModuleInfo(IetfInetTypes.class, null));
+        appInfo.put(new DefaultYangModuleId("org-openroadm-topology", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmTopology.class, null));
+        appInfo.put(new DefaultYangModuleId("org-openroadm-topology", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmTopology.class, null));
+
+        // Dependency for org-openroadm-topology
+        appInfo.put(new DefaultYangModuleId("org-openroadm-resource", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmResource.class, null));
+
+
+        appInfo.put(new DefaultYangModuleId("org-openroadm-service", "2016-10-14"),
+                new DefaultAppModuleInfo(OrgOpenroadmService.class, null));
+        return ImmutableMap.copyOf(appInfo);
+    }
+}