Gaurav Agrawal | 773167e | 2017-05-12 14:51:19 +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.drivers.huawei; |
| 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.l3vpn.comm.type.rev20141225.NeL3VpncommType; |
| 23 | import org.onosproject.yang.gen.v1.ne.bgpcomm.rev20141225.NeBgpcomm; |
| 24 | import org.onosproject.yang.gen.v1.ne.bgpcomm.type.rev20141225.NeBgpcommType; |
| 25 | import org.onosproject.yang.gen.v1.ne.l3vpn.api.rev20141225.NeL3VpnApi; |
| 26 | import org.onosproject.yang.gen.v1.ne.l3vpn.comm.rev20141225.NeL3Vpncomm; |
| 27 | import org.onosproject.yang.model.DefaultYangModuleId; |
| 28 | import org.onosproject.yang.model.YangModuleId; |
| 29 | import org.onosproject.yang.runtime.AppModuleInfo; |
| 30 | import org.onosproject.yang.runtime.DefaultAppModuleInfo; |
| 31 | |
| 32 | import java.util.HashMap; |
| 33 | import java.util.Map; |
| 34 | |
| 35 | /** |
| 36 | * Representation of huawei model registrator which registers huawei device |
| 37 | * models. |
| 38 | */ |
| 39 | @Component(immediate = true) |
| 40 | public class HuaweiModelRegistrator extends AbstractYangModelRegistrator { |
| 41 | |
| 42 | /** |
| 43 | * Creates L3VPN model registrator. |
| 44 | */ |
| 45 | public HuaweiModelRegistrator() { |
| 46 | super(NeBgpcomm.class, getAppInfo()); |
| 47 | } |
| 48 | |
| 49 | private static Map<YangModuleId, AppModuleInfo> getAppInfo() { |
| 50 | Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>(); |
| 51 | appInfo.put(new DefaultYangModuleId("NeBgpcomm.class", "2014-00-25"), |
| 52 | new DefaultAppModuleInfo(NeBgpcomm.class, null)); |
| 53 | appInfo.put(new DefaultYangModuleId("ne-bgpcomm-type", "2014-00-25"), |
| 54 | new DefaultAppModuleInfo(NeBgpcommType.class, null)); |
| 55 | appInfo.put(new DefaultYangModuleId("ne-l3vpn-api", "2014-00-25"), |
| 56 | new DefaultAppModuleInfo(NeL3VpnApi.class, null)); |
| 57 | appInfo.put(new DefaultYangModuleId("ne-l3vpncomm", "2014-00-25"), |
| 58 | new DefaultAppModuleInfo(NeL3Vpncomm.class, null)); |
| 59 | appInfo.put(new DefaultYangModuleId("ne-l3vpncomm-type", "2014-00-25"), |
| 60 | new DefaultAppModuleInfo(NeL3VpncommType.class, null)); |
| 61 | return ImmutableMap.copyOf(appInfo); |
| 62 | } |
| 63 | } |