Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 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 | |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 17 | package org.onosproject.models.l3vpn; |
Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 18 | |
| 19 | import com.google.common.collect.ImmutableMap; |
| 20 | import org.apache.felix.scr.annotations.Component; |
| 21 | import org.onosproject.yang.AbstractYangModelRegistrator; |
Gaurav Agrawal | 3545370 | 2017-11-16 13:25:16 +0530 | [diff] [blame] | 22 | import org.onosproject.yang.gen.v1.ietfbgpl3vpn.rev20160909.IetfBgpL3Vpn; |
| 23 | import org.onosproject.yang.gen.v1.ietfinterfaces.rev20140508.IetfInterfaces; |
| 24 | import org.onosproject.yang.gen.v1.ietfip.rev20140616.IetfIp; |
Vidyashree Rama | 04147ca | 2017-05-26 11:32:47 +0530 | [diff] [blame] | 25 | import org.onosproject.yang.gen.v1.ietfl3vpnsvc.rev20160730.IetfL3VpnSvc; |
Gaurav Agrawal | 3545370 | 2017-11-16 13:25:16 +0530 | [diff] [blame] | 26 | import org.onosproject.yang.gen.v1.ietfnetworkinstance.rev20160623.IetfNetworkInstance; |
Vidyashree Rama | 04147ca | 2017-05-26 11:32:47 +0530 | [diff] [blame] | 27 | import org.onosproject.yang.gen.v1.l3vpnsvcext.rev20160730.L3VpnSvcExt; |
Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 28 | import org.onosproject.yang.model.DefaultYangModuleId; |
| 29 | import org.onosproject.yang.model.YangModuleId; |
| 30 | import org.onosproject.yang.runtime.AppModuleInfo; |
| 31 | import org.onosproject.yang.runtime.DefaultAppModuleInfo; |
| 32 | |
| 33 | import java.util.HashMap; |
| 34 | import java.util.Map; |
| 35 | |
| 36 | /** |
| 37 | * Representation of L3VPN model registrator which registers L3VPN service |
| 38 | * model. |
| 39 | */ |
| 40 | @Component(immediate = true) |
| 41 | public class L3VpnModelRegistrator extends AbstractYangModelRegistrator { |
| 42 | |
| 43 | /** |
| 44 | * Creates L3VPN model registrator. |
| 45 | */ |
| 46 | public L3VpnModelRegistrator() { |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 47 | super(L3VpnModelRegistrator.class, getAppInfo()); |
Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | private static Map<YangModuleId, AppModuleInfo> getAppInfo() { |
| 51 | Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>(); |
Gaurav Agrawal | 0033503 | 2017-05-17 17:09:14 +0530 | [diff] [blame] | 52 | appInfo.put(new DefaultYangModuleId("ietf-l3vpn-svc", "2016-07-30"), |
Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 53 | new DefaultAppModuleInfo(IetfL3VpnSvc.class, null)); |
Gaurav Agrawal | 0033503 | 2017-05-17 17:09:14 +0530 | [diff] [blame] | 54 | appInfo.put(new DefaultYangModuleId("l3vpn-svc-ext", "2016-07-30"), |
Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 55 | new DefaultAppModuleInfo(L3VpnSvcExt.class, null)); |
Gaurav Agrawal | 3545370 | 2017-11-16 13:25:16 +0530 | [diff] [blame] | 56 | appInfo.put(new DefaultYangModuleId("ietf-interfaces", "2014-05-08"), |
| 57 | new DefaultAppModuleInfo(IetfInterfaces.class, null)); |
| 58 | appInfo.put(new DefaultYangModuleId("ietf-bgp-l3vpn", "2016-09-09"), |
| 59 | new DefaultAppModuleInfo(IetfBgpL3Vpn.class, null)); |
| 60 | appInfo.put(new DefaultYangModuleId("ietf-ip", "2014-06-16"), |
| 61 | new DefaultAppModuleInfo(IetfIp.class, null)); |
| 62 | appInfo.put(new DefaultYangModuleId("ietf-network-instance", |
| 63 | "2016-06-23"), |
| 64 | new DefaultAppModuleInfo(IetfNetworkInstance.class, null)); |
Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 65 | return ImmutableMap.copyOf(appInfo); |
| 66 | } |
| 67 | } |