blob: 87c882f13e53059274994132902188f907681744 [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;
25import org.onosproject.yang.gen.v1.tapicommon.rev20180216.TapiCommon;
26import org.onosproject.yang.gen.v1.tapiconnectivity.rev20180216.TapiConnectivity;
27import org.onosproject.yang.gen.v1.tapipathcomputation.rev20180216.TapiPathComputation;
28import org.onosproject.yang.gen.v1.tapitopology.rev20180216.TapiTopology;
29import org.onosproject.yang.model.DefaultYangModuleId;
30import org.onosproject.yang.model.YangModuleId;
31import org.onosproject.yang.runtime.AppModuleInfo;
32import org.onosproject.yang.runtime.DefaultAppModuleInfo;
33
34import java.util.HashMap;
35import java.util.Map;
36
37
38/**
39 * Component to register the TAPI 2.0 service model and its dependencies.
40 */
41@Component(immediate = true)
42public class TapiModelRegistrator extends AbstractYangModelRegistrator {
43
44 public TapiModelRegistrator() {
45 super(TapiModelRegistrator.class, getAppInfo());
46 }
47
48 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
49 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
50
51 appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2018-02-16"),
52 new DefaultAppModuleInfo(TapiConnectivity.class, null));
53
54 appInfo.put(new DefaultYangModuleId("tapi-common", "2018-02-16"),
55 new DefaultAppModuleInfo(TapiCommon.class, null));
56
57 appInfo.put(new DefaultYangModuleId("tapi-topology", "2018-02-16"),
58 new DefaultAppModuleInfo(TapiTopology.class, null));
59
60 appInfo.put(new DefaultYangModuleId("tapi-path-computation", "2018-02-16"),
61 new DefaultAppModuleInfo(TapiPathComputation.class, null));
62
63 return ImmutableMap.copyOf(appInfo);
64 }
65}