blob: bde6d7f36583d6ebd9d7fe4596c130cff46d6fda [file] [log] [blame]
Thomas Vachuska803278e2017-10-06 11:11:58 -07001/*
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.common;
17
Gaurav Agrawald5631a62017-10-09 15:22:22 +053018import com.google.common.collect.ImmutableMap;
Thomas Vachuska803278e2017-10-06 11:11:58 -070019import org.onosproject.yang.AbstractYangModelRegistrator;
Gaurav Agrawald5631a62017-10-09 15:22:22 +053020import org.onosproject.yang.gen.v1.ietfinettypes.rev20130715.IetfInetTypes;
21import org.onosproject.yang.gen.v1.ietfyangtypes.rev20130715.IetfYangTypes;
Thomas Vachuska803278e2017-10-06 11:11:58 -070022import org.apache.felix.scr.annotations.Component;
Gaurav Agrawald5631a62017-10-09 15:22:22 +053023import org.onosproject.yang.model.DefaultYangModuleId;
24import org.onosproject.yang.model.YangModuleId;
25import org.onosproject.yang.runtime.AppModuleInfo;
26import org.onosproject.yang.runtime.DefaultAppModuleInfo;
27
28import java.util.HashMap;
29import java.util.Map;
Thomas Vachuska803278e2017-10-06 11:11:58 -070030
31@Component(immediate = true)
32public class YangModelRegistrator extends AbstractYangModelRegistrator {
33 public YangModelRegistrator() {
Gaurav Agrawald5631a62017-10-09 15:22:22 +053034 super(YangModelRegistrator.class, getAppInfo());
35 }
Thomas Vachuska803278e2017-10-06 11:11:58 -070036
Gaurav Agrawald5631a62017-10-09 15:22:22 +053037 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
38 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
39 appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-07-15"),
40 new DefaultAppModuleInfo(IetfInetTypes.class, null));
41 appInfo.put(new DefaultYangModuleId("ietf-yang-types", "2013-07-15"),
42 new DefaultAppModuleInfo(IetfYangTypes.class, null));
43 return ImmutableMap.copyOf(appInfo);
Thomas Vachuska803278e2017-10-06 11:11:58 -070044 // TODO: Do some other registration tasks...
Thomas Vachuska803278e2017-10-06 11:11:58 -070045 }
46}