blob: b5ec202483424c68cc39c5be59b07990fef3b63a [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;
23import org.apache.felix.scr.annotations.Component;
24import org.onosproject.yang.AbstractYangModelRegistrator;
hirokid8fd7862018-10-09 15:24:24 +090025import org.onosproject.yang.gen.v1.tapicommon.rev20181016.TapiCommon;
26import org.onosproject.yang.gen.v1.tapiconnectivity.rev20181016.TapiConnectivity;
27import org.onosproject.yang.gen.v1.tapipathcomputation.rev20181016.TapiPathComputation;
28import org.onosproject.yang.gen.v1.tapiphotonicmedia.rev20181016.TapiPhotonicMedia;
29import org.onosproject.yang.gen.v1.tapitopology.rev20181016.TapiTopology;
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080030import org.onosproject.yang.model.DefaultYangModuleId;
31import org.onosproject.yang.model.YangModuleId;
32import org.onosproject.yang.runtime.AppModuleInfo;
33import org.onosproject.yang.runtime.DefaultAppModuleInfo;
34
35import java.util.HashMap;
36import java.util.Map;
37
38
39/**
40 * Component to register the TAPI 2.0 service model and its dependencies.
41 */
42@Component(immediate = true)
43public class TapiModelRegistrator extends AbstractYangModelRegistrator {
44
45 public TapiModelRegistrator() {
46 super(TapiModelRegistrator.class, getAppInfo());
47 }
48
49 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
50 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
51
hirokid8fd7862018-10-09 15:24:24 +090052 appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2018-10-16"),
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080053 new DefaultAppModuleInfo(TapiConnectivity.class, null));
54
hirokid8fd7862018-10-09 15:24:24 +090055 appInfo.put(new DefaultYangModuleId("tapi-common", "2018-10-16"),
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080056 new DefaultAppModuleInfo(TapiCommon.class, null));
57
hirokid8fd7862018-10-09 15:24:24 +090058 appInfo.put(new DefaultYangModuleId("tapi-topology", "2018-10-16"),
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080059 new DefaultAppModuleInfo(TapiTopology.class, null));
60
hirokid8fd7862018-10-09 15:24:24 +090061 appInfo.put(new DefaultYangModuleId("tapi-photonic-media", "2018-10-16"),
62 new DefaultAppModuleInfo(TapiPhotonicMedia.class, null));
63
64 appInfo.put(new DefaultYangModuleId("tapi-path-computation", "2018-10-16"),
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080065 new DefaultAppModuleInfo(TapiPathComputation.class, null));
66
67 return ImmutableMap.copyOf(appInfo);
68 }
69}