blob: fa4313d623d62dd5e040d71542371fada3a21eff [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;
Andrea Campanella49d92a02018-12-18 12:48:20 +010026import org.onosproject.yang.gen.v1.tapioam.rev20181210.TapiOam;
27import org.onosproject.yang.gen.v1.tapiodu.rev20181210.TapiOdu;
hiroki96ab3c22018-12-11 14:10:52 -080028import org.onosproject.yang.gen.v1.tapipathcomputation.rev20181210.TapiPathComputation;
29import org.onosproject.yang.gen.v1.tapiphotonicmedia.rev20181210.TapiPhotonicMedia;
30import org.onosproject.yang.gen.v1.tapitopology.rev20181210.TapiTopology;
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080031import org.onosproject.yang.model.DefaultYangModuleId;
32import org.onosproject.yang.model.YangModuleId;
33import org.onosproject.yang.runtime.AppModuleInfo;
34import org.onosproject.yang.runtime.DefaultAppModuleInfo;
Andrea Campanella49d92a02018-12-18 12:48:20 +010035import org.osgi.service.component.annotations.Component;
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080036
37import java.util.HashMap;
38import java.util.Map;
39
40
41/**
Andrea Campanella49d92a02018-12-18 12:48:20 +010042 * Component to register the TAPI 2.1.X service model and its
Ramon Casellas659df2c2018-12-18 11:27:19 +010043 * dependencies.
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080044 */
45@Component(immediate = true)
46public class TapiModelRegistrator extends AbstractYangModelRegistrator {
47
48 public TapiModelRegistrator() {
49 super(TapiModelRegistrator.class, getAppInfo());
50 }
51
52 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
53 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
54
Ramon Casellas659df2c2018-12-18 11:27:19 +010055 appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010056 new DefaultAppModuleInfo(TapiConnectivity.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080057
Ramon Casellas659df2c2018-12-18 11:27:19 +010058 appInfo.put(new DefaultYangModuleId("tapi-common", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010059 new DefaultAppModuleInfo(TapiCommon.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080060
Ramon Casellas659df2c2018-12-18 11:27:19 +010061 appInfo.put(new DefaultYangModuleId("tapi-topology", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010062 new DefaultAppModuleInfo(TapiTopology.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080063
Ramon Casellas659df2c2018-12-18 11:27:19 +010064 appInfo.put(new DefaultYangModuleId("tapi-photonic-media", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010065 new DefaultAppModuleInfo(TapiPhotonicMedia.class, null));
66
67 appInfo.put(new DefaultYangModuleId("tapi-oam", "2018-12-10"),
68 new DefaultAppModuleInfo(TapiOam.class, null));
69
70 appInfo.put(new DefaultYangModuleId("tapi-odu", "2018-12-10"),
71 new DefaultAppModuleInfo(TapiOdu.class, null));
hirokid8fd7862018-10-09 15:24:24 +090072
Ramon Casellas659df2c2018-12-18 11:27:19 +010073 appInfo.put(new DefaultYangModuleId("tapi-path-computation", "2018-12-10"),
Andrea Campanella49d92a02018-12-18 12:48:20 +010074 new DefaultAppModuleInfo(TapiPathComputation.class, null));
Yuta HIGUCHIf1926102018-03-06 14:32:37 -080075
76 return ImmutableMap.copyOf(appInfo);
77 }
78}