blob: 3c34d1b531086009b3b333093dd71c08fb440ba5 [file] [log] [blame]
Gaurav Agrawal8dbd2732017-04-14 18:57:30 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Gaurav Agrawal8dbd2732017-04-14 18:57:30 +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.l3vpn;
Gaurav Agrawal8dbd2732017-04-14 18:57:30 +053018
19import com.google.common.collect.ImmutableMap;
20import org.apache.felix.scr.annotations.Component;
21import org.onosproject.yang.AbstractYangModelRegistrator;
Vidyashree Rama04147ca2017-05-26 11:32:47 +053022import org.onosproject.yang.gen.v1.ietfl3vpnsvc.rev20160730.IetfL3VpnSvc;
Vidyashree Rama04147ca2017-05-26 11:32:47 +053023import org.onosproject.yang.gen.v1.l3vpnsvcext.rev20160730.L3VpnSvcExt;
Gaurav Agrawal8dbd2732017-04-14 18:57:30 +053024import org.onosproject.yang.model.DefaultYangModuleId;
25import org.onosproject.yang.model.YangModuleId;
26import org.onosproject.yang.runtime.AppModuleInfo;
27import org.onosproject.yang.runtime.DefaultAppModuleInfo;
28
29import java.util.HashMap;
30import java.util.Map;
31
32/**
33 * Representation of L3VPN model registrator which registers L3VPN service
34 * model.
35 */
36@Component(immediate = true)
37public class L3VpnModelRegistrator extends AbstractYangModelRegistrator {
38
39 /**
40 * Creates L3VPN model registrator.
41 */
42 public L3VpnModelRegistrator() {
Gaurav Agrawal55880572017-11-15 18:41:49 +053043 super(L3VpnModelRegistrator.class, getAppInfo());
Gaurav Agrawal8dbd2732017-04-14 18:57:30 +053044 }
45
46 private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
47 Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
Gaurav Agrawal00335032017-05-17 17:09:14 +053048 appInfo.put(new DefaultYangModuleId("ietf-l3vpn-svc", "2016-07-30"),
Gaurav Agrawal8dbd2732017-04-14 18:57:30 +053049 new DefaultAppModuleInfo(IetfL3VpnSvc.class, null));
Gaurav Agrawal00335032017-05-17 17:09:14 +053050 appInfo.put(new DefaultYangModuleId("l3vpn-svc-ext", "2016-07-30"),
Gaurav Agrawal8dbd2732017-04-14 18:57:30 +053051 new DefaultAppModuleInfo(L3VpnSvcExt.class, null));
52 return ImmutableMap.copyOf(appInfo);
53 }
54}