blob: c4f1550dfd02b588858e786e975859a475503b60 [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;
Ray Milkeyd84f89b2018-08-17 14:54:17 -070023import org.osgi.service.component.annotations.Component;
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080024import org.onosproject.yang.AbstractYangModelRegistrator;
hiroki96ab3c22018-12-11 14:10:52 -080025import org.onosproject.yang.gen.v1.tapicommon.rev20181210.TapiCommon;
26import org.onosproject.yang.gen.v1.tapiconnectivity.rev20181210.TapiConnectivity;
27import org.onosproject.yang.gen.v1.tapipathcomputation.rev20181210.TapiPathComputation;
28import org.onosproject.yang.gen.v1.tapiphotonicmedia.rev20181210.TapiPhotonicMedia;
29import org.onosproject.yang.gen.v1.tapitopology.rev20181210.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}