Initial check-in Open ROADM app v1.2.1 (ONOS-5354).
Change-Id: I077b40c308efe257af0e23f0d87de1215c3789ad
diff --git a/apps/openroadm/network/BUCK b/apps/openroadm/network/BUCK
new file mode 100644
index 0000000..ed9d919
--- /dev/null
+++ b/apps/openroadm/network/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/network/pom.xml b/apps/openroadm/network/pom.xml
new file mode 100644
index 0000000..87594ab
--- /dev/null
+++ b/apps/openroadm/network/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-network</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+ <description>Open ROADM Network 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/network/src/main/java/org/onosproject/openroadm/network/OpenRoadmNetworkModelRegistrator.java b/apps/openroadm/network/src/main/java/org/onosproject/openroadm/network/OpenRoadmNetworkModelRegistrator.java
new file mode 100644
index 0000000..d7a52b2
--- /dev/null
+++ b/apps/openroadm/network/src/main/java/org/onosproject/openroadm/network/OpenRoadmNetworkModelRegistrator.java
@@ -0,0 +1,75 @@
+/*
+ * 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.network;
+
+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.types.rev20161014.OrgOpenroadmCommonTypes;
+import org.onosproject.yang.gen.v1.http.org.openroadm.degree.rev20161014.OrgOpenroadmDegree;
+import org.onosproject.yang.gen.v1.http.org.openroadm.equipment.states.types.rev20161014.OrgOpenroadmEquipmentStatesTypes;
+import org.onosproject.yang.gen.v1.http.org.openroadm.external.pluggable.rev20161014.OrgOpenroadmExternalPluggable;
+import org.onosproject.yang.gen.v1.http.org.openroadm.network.rev20161014.OrgOpenroadmNetwork;
+import org.onosproject.yang.gen.v1.http.org.openroadm.roadm.rev20161014.OrgOpenroadmRoadm;
+import org.onosproject.yang.gen.v1.http.org.openroadm.srg.rev20161014.OrgOpenroadmSrg;
+import org.onosproject.yang.gen.v1.http.org.openroadm.xponder.rev20161014.OrgOpenroadmXponder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev20130715.IetfInetTypes;
+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 network model and its dependencies.
+ */
+@Component(immediate = true)
+public class OpenRoadmNetworkModelRegistrator extends AbstractYangModelRegistrator {
+ public OpenRoadmNetworkModelRegistrator() {
+ super(OrgOpenroadmNetwork.class, getAppInfo());
+ }
+
+ private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
+ Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
+ // Dependencies for org-openroadm-network
+ appInfo.put(new DefaultYangModuleId("org-openroadm-roadm", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmRoadm.class, null));
+ appInfo.put(new DefaultYangModuleId("org-openroadm-external-pluggable", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmExternalPluggable.class, null));
+ appInfo.put(new DefaultYangModuleId("org-openroadm-xponder", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmXponder.class, null));
+
+ // Dependencies for org-openroadm-roadm
+ appInfo.put(new DefaultYangModuleId("org-openroadm-srg", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmSrg.class, null));
+ appInfo.put(new DefaultYangModuleId("org-openroadm-degree", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmDegree.class, null));
+ appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-07-15"),
+ new DefaultAppModuleInfo(IetfInetTypes.class, null));
+ appInfo.put(new DefaultYangModuleId("org-openroadm-common-types", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmCommonTypes.class, null));
+
+ // Dependencies for org-openroadm-external-pluggable
+ appInfo.put(new DefaultYangModuleId("org-openroadm-equipment-states-types", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmEquipmentStatesTypes.class, null));
+
+ appInfo.put(new DefaultYangModuleId("org-openroadm-network", "2016-10-14"),
+ new DefaultAppModuleInfo(OrgOpenroadmNetwork.class, null));
+ return ImmutableMap.copyOf(appInfo);
+ }
+}