blob: b04aac1557f0115e4d99bda3a7b3f873a9dabebe [file] [log] [blame]
Sean Condon1dbcd712017-10-19 12:09:21 +01001/*
2 * Copyright 2017-present Open Networking Foundation
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 */
16package org.onosproject.models.microsemi;
17
18import com.google.common.collect.ImmutableMap;
19import org.onosproject.yang.AbstractYangModelRegistrator;
20import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.IetfSystem;
21import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.IetfSystemMicrosemi;
22import org.apache.felix.scr.annotations.Component;
23import org.onosproject.yang.gen.v1.mseacfm.rev20160229.MseaCfm;
24import org.onosproject.yang.gen.v1.mseasoampm.rev20160229.MseaSoamPm;
25import org.onosproject.yang.gen.v1.mseasoamfm.rev20160229.MseaSoamFm;
26import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.MseaSaFiltering;
27import org.onosproject.yang.gen.v1.mseaunievcservice.rev20160317.MseaUniEvcService;
28import org.onosproject.yang.model.DefaultYangModuleId;
29import org.onosproject.yang.model.YangModuleId;
30import org.onosproject.yang.runtime.AppModuleInfo;
31import org.onosproject.yang.runtime.DefaultAppModuleInfo;
32
33import java.util.List;
34import java.util.ArrayList;
35import java.util.HashMap;
36import java.util.Map;
37
38@Component(immediate = true)
39public class MicrosemiModelRegistrator extends AbstractYangModelRegistrator {
40 public MicrosemiModelRegistrator() {
41 super(MicrosemiModelRegistrator.class, getAppInfo());
42 }
43
44 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
45 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
46 List<String> sysMicrosemiFeatures = new ArrayList<>();
47 sysMicrosemiFeatures.add("serial-number");
48 appInfo.put(new DefaultYangModuleId("ietf-system-microsemi", "2016-05-05"),
49 new DefaultAppModuleInfo(IetfSystemMicrosemi.class, sysMicrosemiFeatures));
50
51 List<String> systemFeatures = new ArrayList<>();
52 systemFeatures.add("local-users");
53 systemFeatures.add("authentication");
54 systemFeatures.add("ntp");
55 appInfo.put(new DefaultYangModuleId("ietf-system", "2014-08-06"),
56 new DefaultAppModuleInfo(IetfSystem.class, systemFeatures));
57
58 appInfo.put(new DefaultYangModuleId("msea-uni-evc-service", "2016-03-17"),
59 new DefaultAppModuleInfo(MseaUniEvcService.class, null));
60 appInfo.put(new DefaultYangModuleId("msea-cfm", "2016-02-29"),
61 new DefaultAppModuleInfo(MseaCfm.class, null));
62 appInfo.put(new DefaultYangModuleId("msea-soam-fm", "2016-02-29"),
63 new DefaultAppModuleInfo(MseaSoamFm.class, null));
64 appInfo.put(new DefaultYangModuleId("msea-soam-pm", "2016-02-29"),
65 new DefaultAppModuleInfo(MseaSoamPm.class, null));
66 appInfo.put(new DefaultYangModuleId("msea-sa-filtering", "2016-04-12"),
67 new DefaultAppModuleInfo(MseaSaFiltering.class, null));
68
69 return ImmutableMap.copyOf(appInfo);
70 // TODO: Do some other registration tasks...
71 }
72}