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; |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 23 | import org.osgi.service.component.annotations.Component; |
Yuta HIGUCHI | f192610 | 2018-03-06 14:32:37 -0800 | [diff] [blame] | 24 | import org.onosproject.yang.AbstractYangModelRegistrator; |
hiroki | d8fd786 | 2018-10-09 15:24:24 +0900 | [diff] [blame] | 25 | import org.onosproject.yang.gen.v1.tapicommon.rev20181016.TapiCommon; |
| 26 | import org.onosproject.yang.gen.v1.tapiconnectivity.rev20181016.TapiConnectivity; |
| 27 | import org.onosproject.yang.gen.v1.tapipathcomputation.rev20181016.TapiPathComputation; |
| 28 | import org.onosproject.yang.gen.v1.tapiphotonicmedia.rev20181016.TapiPhotonicMedia; |
| 29 | import org.onosproject.yang.gen.v1.tapitopology.rev20181016.TapiTopology; |
Yuta HIGUCHI | f192610 | 2018-03-06 14:32:37 -0800 | [diff] [blame] | 30 | import org.onosproject.yang.model.DefaultYangModuleId; |
| 31 | import org.onosproject.yang.model.YangModuleId; |
| 32 | import org.onosproject.yang.runtime.AppModuleInfo; |
| 33 | import org.onosproject.yang.runtime.DefaultAppModuleInfo; |
| 34 | |
| 35 | import java.util.HashMap; |
| 36 | import java.util.Map; |
| 37 | |
| 38 | |
| 39 | /** |
| 40 | * Component to register the TAPI 2.0 service model and its dependencies. |
| 41 | */ |
| 42 | @Component(immediate = true) |
| 43 | public 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 | |
hiroki | d8fd786 | 2018-10-09 15:24:24 +0900 | [diff] [blame] | 52 | appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2018-10-16"), |
Yuta HIGUCHI | f192610 | 2018-03-06 14:32:37 -0800 | [diff] [blame] | 53 | new DefaultAppModuleInfo(TapiConnectivity.class, null)); |
| 54 | |
hiroki | d8fd786 | 2018-10-09 15:24:24 +0900 | [diff] [blame] | 55 | appInfo.put(new DefaultYangModuleId("tapi-common", "2018-10-16"), |
Yuta HIGUCHI | f192610 | 2018-03-06 14:32:37 -0800 | [diff] [blame] | 56 | new DefaultAppModuleInfo(TapiCommon.class, null)); |
| 57 | |
hiroki | d8fd786 | 2018-10-09 15:24:24 +0900 | [diff] [blame] | 58 | appInfo.put(new DefaultYangModuleId("tapi-topology", "2018-10-16"), |
Yuta HIGUCHI | f192610 | 2018-03-06 14:32:37 -0800 | [diff] [blame] | 59 | new DefaultAppModuleInfo(TapiTopology.class, null)); |
| 60 | |
hiroki | d8fd786 | 2018-10-09 15:24:24 +0900 | [diff] [blame] | 61 | 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 HIGUCHI | f192610 | 2018-03-06 14:32:37 -0800 | [diff] [blame] | 65 | new DefaultAppModuleInfo(TapiPathComputation.class, null)); |
| 66 | |
| 67 | return ImmutableMap.copyOf(appInfo); |
| 68 | } |
| 69 | } |