blob: c7938b726197ec550f89f1c050a5b1f50beed8b3 [file] [log] [blame]
Yuta HIGUCHIf1926102018-03-06 14:32:37 -08001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 *
17 * This work was partially supported by EC H2020 project METRO-HAUL (761727).
18 */
19
20package org.onosproject.models.tapi;
21
22import com.google.common.collect.ImmutableMap;
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080023import org.onosproject.yang.AbstractYangModelRegistrator;
hiroki96ab3c22018-12-11 14:10:52 -080024import org.onosproject.yang.gen.v1.tapicommon.rev20181210.TapiCommon;
25import org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.TapiConnectivity;
Ai Hamano3d7a1812019-01-22 13:40:48 +090026import org.onosproject.yang.gen.v1.tapidsr.rev20181210.TapiDsr;
27import org.onosproject.yang.gen.v1.tapieth.rev20181210.TapiEth;
28import org.onosproject.yang.gen.v1.tapinotification.rev20181210.TapiNotification;
Andrea Campanella49d92a02018-12-18 12:48:20 +010029import org.onosproject.yang.gen.v1.tapioam.rev20181210.TapiOam;
30import org.onosproject.yang.gen.v1.tapiodu.rev20181210.TapiOdu;
hiroki96ab3c22018-12-11 14:10:52 -080031import org.onosproject.yang.gen.v1.tapipathcomputation.rev20181210.TapiPathComputation;
32import org.onosproject.yang.gen.v1.tapiphotonicmedia.rev20181210.TapiPhotonicMedia;
33import org.onosproject.yang.gen.v1.tapitopology.rev20181210.TapiTopology;
Ai Hamano3d7a1812019-01-22 13:40:48 +090034import org.onosproject.yang.gen.v1.tapivirtualnetwork.rev20181210.TapiVirtualNetwork;
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080035import org.onosproject.yang.model.DefaultYangModuleId;
36import org.onosproject.yang.model.YangModuleId;
37import org.onosproject.yang.runtime.AppModuleInfo;
38import org.onosproject.yang.runtime.DefaultAppModuleInfo;
Andrea Campanella49d92a02018-12-18 12:48:20 +010039import org.osgi.service.component.annotations.Component;
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080040
41import java.util.HashMap;
42import java.util.Map;
43
44
45/**
Andrea Campanella49d92a02018-12-18 12:48:20 +010046 * Component to register the TAPI 2.1.X service model and its
Ramon Casellas659df2c2018-12-18 11:27:19 +010047 * dependencies.
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080048 */
49@Component(immediate = true)
50public class TapiModelRegistrator extends AbstractYangModelRegistrator {
51
52 public TapiModelRegistrator() {
53 super(TapiModelRegistrator.class, getAppInfo());
54 }
55
56 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
57 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
58
Ramon Casellas659df2c2018-12-18 11:27:19 +010059 appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010060 new DefaultAppModuleInfo(TapiConnectivity.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080061
Ramon Casellas659df2c2018-12-18 11:27:19 +010062 appInfo.put(new DefaultYangModuleId("tapi-common", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010063 new DefaultAppModuleInfo(TapiCommon.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080064
Ramon Casellas659df2c2018-12-18 11:27:19 +010065 appInfo.put(new DefaultYangModuleId("tapi-topology", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010066 new DefaultAppModuleInfo(TapiTopology.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080067
Ramon Casellas659df2c2018-12-18 11:27:19 +010068 appInfo.put(new DefaultYangModuleId("tapi-photonic-media", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010069 new DefaultAppModuleInfo(TapiPhotonicMedia.class, null));
70
71 appInfo.put(new DefaultYangModuleId("tapi-oam", "2018-12-10"),
72 new DefaultAppModuleInfo(TapiOam.class, null));
73
74 appInfo.put(new DefaultYangModuleId("tapi-odu", "2018-12-10"),
75 new DefaultAppModuleInfo(TapiOdu.class, null));
hirokid8fd7862018-10-09 15:24:24 +090076
Ramon Casellas659df2c2018-12-18 11:27:19 +010077 appInfo.put(new DefaultYangModuleId("tapi-path-computation", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010078 new DefaultAppModuleInfo(TapiPathComputation.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080079
Ai Hamano3d7a1812019-01-22 13:40:48 +090080 appInfo.put(new DefaultYangModuleId("tapi-notification", "2018-12-10"),
81 new DefaultAppModuleInfo(TapiNotification.class, null));
82
83 appInfo.put(new DefaultYangModuleId("tapi-virtual-network", "2018-12-10"),
84 new DefaultAppModuleInfo(TapiVirtualNetwork.class, null));
85
86 appInfo.put(new DefaultYangModuleId("tapi-dsr", "2018-12-10"),
87 new DefaultAppModuleInfo(TapiDsr.class, null));
88
89 appInfo.put(new DefaultYangModuleId("tapi-eth", "2018-12-10"),
90 new DefaultAppModuleInfo(TapiEth.class, null));
91
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080092 return ImmutableMap.copyOf(appInfo);
93 }
94}