Yuta HIGUCHI | f192610 | 2018-03-06 14:32:37 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 20 | package org.onosproject.models.tapi; |
| 21 | |
| 22 | import com.google.common.collect.ImmutableMap; |
| 23 | import org.apache.felix.scr.annotations.Component; |
| 24 | import org.onosproject.yang.AbstractYangModelRegistrator; |
| 25 | import org.onosproject.yang.gen.v1.tapicommon.rev20180216.TapiCommon; |
| 26 | import org.onosproject.yang.gen.v1.tapiconnectivity.rev20180216.TapiConnectivity; |
| 27 | import org.onosproject.yang.gen.v1.tapipathcomputation.rev20180216.TapiPathComputation; |
| 28 | import org.onosproject.yang.gen.v1.tapitopology.rev20180216.TapiTopology; |
| 29 | import org.onosproject.yang.model.DefaultYangModuleId; |
| 30 | import org.onosproject.yang.model.YangModuleId; |
| 31 | import org.onosproject.yang.runtime.AppModuleInfo; |
| 32 | import org.onosproject.yang.runtime.DefaultAppModuleInfo; |
| 33 | |
| 34 | import java.util.HashMap; |
| 35 | import java.util.Map; |
| 36 | |
| 37 | |
| 38 | /** |
| 39 | * Component to register the TAPI 2.0 service model and its dependencies. |
| 40 | */ |
| 41 | @Component(immediate = true) |
| 42 | public 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 | } |