Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +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 | 773167e | 2017-05-12 14:51:19 +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.huawei; |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +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; |
Vidyashree Rama | 04147ca | 2017-05-26 11:32:47 +0530 | [diff] [blame] | 22 | import org.onosproject.yang.gen.v1.nebgpcomm.rev20141225.NeBgpcomm; |
| 23 | import org.onosproject.yang.gen.v1.nebgpcommtype.rev20141225.NeBgpcommType; |
| 24 | import org.onosproject.yang.gen.v1.nel3vpnapi.rev20141225.NeL3VpnApi; |
| 25 | import org.onosproject.yang.gen.v1.nel3vpncomm.rev20141225.NeL3Vpncomm; |
| 26 | import org.onosproject.yang.gen.v1.nel3vpncommtype.rev20141225.NeL3VpncommType; |
janani b | 9ed76be | 2017-08-29 19:11:33 +0530 | [diff] [blame] | 27 | import org.onosproject.yang.gen.v1.netnlm.rev20141225.NeTnlm; |
| 28 | import org.onosproject.yang.gen.v1.netnlmtype.rev20141225.NeTnlmType; |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 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 | * Representation of huawei model registrator which registers huawei device |
| 39 | * models. |
| 40 | */ |
| 41 | @Component(immediate = true) |
| 42 | public class HuaweiModelRegistrator extends AbstractYangModelRegistrator { |
| 43 | |
| 44 | /** |
| 45 | * Creates L3VPN model registrator. |
| 46 | */ |
| 47 | public HuaweiModelRegistrator() { |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 48 | super(HuaweiModelRegistrator.class, getAppInfo()); |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | private static Map<YangModuleId, AppModuleInfo> getAppInfo() { |
| 52 | Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>(); |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 53 | appInfo.put(new DefaultYangModuleId("ne-bgpcomm", "2014-12-25"), |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 54 | new DefaultAppModuleInfo(NeBgpcomm.class, null)); |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 55 | appInfo.put(new DefaultYangModuleId("ne-bgpcomm-type", "2014-12-25"), |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 56 | new DefaultAppModuleInfo(NeBgpcommType.class, null)); |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 57 | appInfo.put(new DefaultYangModuleId("ne-l3vpn-api", "2014-12-25"), |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 58 | new DefaultAppModuleInfo(NeL3VpnApi.class, null)); |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 59 | appInfo.put(new DefaultYangModuleId("ne-l3vpncomm", "2014-12-25"), |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 60 | new DefaultAppModuleInfo(NeL3Vpncomm.class, null)); |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 61 | appInfo.put(new DefaultYangModuleId("ne-l3vpncomm-type", "2014-12-25"), |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 62 | new DefaultAppModuleInfo(NeL3VpncommType.class, null)); |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 63 | appInfo.put(new DefaultYangModuleId("ne-tnlm", "2014-12-25"), |
janani b | 9ed76be | 2017-08-29 19:11:33 +0530 | [diff] [blame] | 64 | new DefaultAppModuleInfo(NeTnlm.class, null)); |
Gaurav Agrawal | 5588057 | 2017-11-15 18:41:49 +0530 | [diff] [blame] | 65 | appInfo.put(new DefaultYangModuleId("ne-tnlm-type", "2014-12-25"), |
janani b | 9ed76be | 2017-08-29 19:11:33 +0530 | [diff] [blame] | 66 | new DefaultAppModuleInfo(NeTnlmType.class, null)); |
Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +0530 | [diff] [blame] | 67 | return ImmutableMap.copyOf(appInfo); |
| 68 | } |
| 69 | } |