blob: ea5e7cce1797daaf5e032a9a1571791ec7af1c8d [file] [log] [blame]
Gaurav Agrawal773167e2017-05-12 14:51:19 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Gaurav Agrawal773167e2017-05-12 14:51:19 +05303 *
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 Agrawal55880572017-11-15 18:41:49 +053017package org.onosproject.models.huawei;
Gaurav Agrawal773167e2017-05-12 14:51:19 +053018
19import com.google.common.collect.ImmutableMap;
Ray Milkeyd84f89b2018-08-17 14:54:17 -070020import org.osgi.service.component.annotations.Component;
Gaurav Agrawal773167e2017-05-12 14:51:19 +053021import org.onosproject.yang.AbstractYangModelRegistrator;
Vidyashree Rama04147ca2017-05-26 11:32:47 +053022import org.onosproject.yang.gen.v1.nebgpcomm.rev20141225.NeBgpcomm;
23import org.onosproject.yang.gen.v1.nebgpcommtype.rev20141225.NeBgpcommType;
24import org.onosproject.yang.gen.v1.nel3vpnapi.rev20141225.NeL3VpnApi;
25import org.onosproject.yang.gen.v1.nel3vpncomm.rev20141225.NeL3Vpncomm;
26import org.onosproject.yang.gen.v1.nel3vpncommtype.rev20141225.NeL3VpncommType;
janani b9ed76be2017-08-29 19:11:33 +053027import org.onosproject.yang.gen.v1.netnlm.rev20141225.NeTnlm;
28import org.onosproject.yang.gen.v1.netnlmtype.rev20141225.NeTnlmType;
Gaurav Agrawal773167e2017-05-12 14:51:19 +053029import org.onosproject.yang.model.DefaultYangModuleId;
30import org.onosproject.yang.model.YangModuleId;
31import org.onosproject.yang.runtime.AppModuleInfo;
32import org.onosproject.yang.runtime.DefaultAppModuleInfo;
33
34import java.util.HashMap;
35import java.util.Map;
36
37/**
38 * Representation of huawei model registrator which registers huawei device
39 * models.
40 */
41@Component(immediate = true)
42public class HuaweiModelRegistrator extends AbstractYangModelRegistrator {
43
Ray Milkey41b53022018-01-03 14:21:30 -080044 private static final String MODEL_VERSION = "2014-12-25";
45
Gaurav Agrawal773167e2017-05-12 14:51:19 +053046 /**
47 * Creates L3VPN model registrator.
48 */
49 public HuaweiModelRegistrator() {
Gaurav Agrawal55880572017-11-15 18:41:49 +053050 super(HuaweiModelRegistrator.class, getAppInfo());
Gaurav Agrawal773167e2017-05-12 14:51:19 +053051 }
52
53 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
54 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
Ray Milkey41b53022018-01-03 14:21:30 -080055 appInfo.put(new DefaultYangModuleId("ne-bgpcomm", MODEL_VERSION),
Gaurav Agrawal773167e2017-05-12 14:51:19 +053056 new DefaultAppModuleInfo(NeBgpcomm.class, null));
Ray Milkey41b53022018-01-03 14:21:30 -080057 appInfo.put(new DefaultYangModuleId("ne-bgpcomm-type", MODEL_VERSION),
Gaurav Agrawal773167e2017-05-12 14:51:19 +053058 new DefaultAppModuleInfo(NeBgpcommType.class, null));
Ray Milkey41b53022018-01-03 14:21:30 -080059 appInfo.put(new DefaultYangModuleId("ne-l3vpn-api", MODEL_VERSION),
Gaurav Agrawal773167e2017-05-12 14:51:19 +053060 new DefaultAppModuleInfo(NeL3VpnApi.class, null));
Ray Milkey41b53022018-01-03 14:21:30 -080061 appInfo.put(new DefaultYangModuleId("ne-l3vpncomm", MODEL_VERSION),
Gaurav Agrawal773167e2017-05-12 14:51:19 +053062 new DefaultAppModuleInfo(NeL3Vpncomm.class, null));
Ray Milkey41b53022018-01-03 14:21:30 -080063 appInfo.put(new DefaultYangModuleId("ne-l3vpncomm-type", MODEL_VERSION),
Gaurav Agrawal773167e2017-05-12 14:51:19 +053064 new DefaultAppModuleInfo(NeL3VpncommType.class, null));
Ray Milkey41b53022018-01-03 14:21:30 -080065 appInfo.put(new DefaultYangModuleId("ne-tnlm", MODEL_VERSION),
janani b9ed76be2017-08-29 19:11:33 +053066 new DefaultAppModuleInfo(NeTnlm.class, null));
Ray Milkey41b53022018-01-03 14:21:30 -080067 appInfo.put(new DefaultYangModuleId("ne-tnlm-type", MODEL_VERSION),
janani b9ed76be2017-08-29 19:11:33 +053068 new DefaultAppModuleInfo(NeTnlmType.class, null));
Gaurav Agrawal773167e2017-05-12 14:51:19 +053069 return ImmutableMap.copyOf(appInfo);
70 }
71}