Gaurav Agrawal | 8dbd273 | 2017-04-14 18:57:30 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Laboratory |
| 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 | package org.onosproject.l3vpn.netl3vpn.impl; |
| 18 | |
| 19 | import com.google.common.collect.ImmutableMap; |
| 20 | import org.apache.felix.scr.annotations.Component; |
| 21 | import org.onosproject.yang.AbstractYangModelRegistrator; |
| 22 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev20130715.IetfInetTypes; |
| 23 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.l3vpn.svc.rev20160730.IetfL3VpnSvc; |
| 24 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev20130715.IetfYangTypes; |
| 25 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.l3vpn.svc.ext.rev20160730.L3VpnSvcExt; |
| 26 | import org.onosproject.yang.model.DefaultYangModuleId; |
| 27 | import org.onosproject.yang.model.YangModuleId; |
| 28 | import org.onosproject.yang.runtime.AppModuleInfo; |
| 29 | import org.onosproject.yang.runtime.DefaultAppModuleInfo; |
| 30 | |
| 31 | import java.util.HashMap; |
| 32 | import java.util.Map; |
| 33 | |
| 34 | /** |
| 35 | * Representation of L3VPN model registrator which registers L3VPN service |
| 36 | * model. |
| 37 | */ |
| 38 | @Component(immediate = true) |
| 39 | public class L3VpnModelRegistrator extends AbstractYangModelRegistrator { |
| 40 | |
| 41 | /** |
| 42 | * Creates L3VPN model registrator. |
| 43 | */ |
| 44 | public L3VpnModelRegistrator() { |
| 45 | super(IetfL3VpnSvc.class, getAppInfo()); |
| 46 | } |
| 47 | |
| 48 | private static Map<YangModuleId, AppModuleInfo> getAppInfo() { |
| 49 | Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>(); |
| 50 | appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-00-15"), |
| 51 | new DefaultAppModuleInfo(IetfInetTypes.class, null)); |
| 52 | appInfo.put(new DefaultYangModuleId("ietf-l3vpn-svc", "2016-00-30"), |
| 53 | new DefaultAppModuleInfo(IetfL3VpnSvc.class, null)); |
| 54 | appInfo.put(new DefaultYangModuleId("ietf-yang-types", "2013-00-15"), |
| 55 | new DefaultAppModuleInfo(IetfYangTypes.class, null)); |
| 56 | appInfo.put(new DefaultYangModuleId("l3vpn-svc-ext", "2016-00-30"), |
| 57 | new DefaultAppModuleInfo(L3VpnSvcExt.class, null)); |
| 58 | return ImmutableMap.copyOf(appInfo); |
| 59 | } |
| 60 | } |