Fix issues and remove re-registrations.
Change-Id: Ie9edcaabbc8ce755a20e0f01091562800e0fefb1
diff --git a/models/l3vpn/BUCK b/models/l3vpn/BUCK
index 8098905..7f6d5b8 100644
--- a/models/l3vpn/BUCK
+++ b/models/l3vpn/BUCK
@@ -1,4 +1,5 @@
COMPILE_DEPS = [
+ '//lib:CORE_DEPS',
'//models/common:onos-models-common',
]
@@ -9,6 +10,7 @@
yang_model(
app_name = 'org.onosproject.models.l3vpn',
title = 'L3VPN YANG Models',
+ custom_registrator = True,
deps = COMPILE_DEPS,
required_apps = APPS,
)
diff --git a/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/L3VpnModelRegistrator.java b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/L3VpnModelRegistrator.java
new file mode 100644
index 0000000..3c34d1b
--- /dev/null
+++ b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/L3VpnModelRegistrator.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.models.l3vpn;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.felix.scr.annotations.Component;
+import org.onosproject.yang.AbstractYangModelRegistrator;
+import org.onosproject.yang.gen.v1.ietfl3vpnsvc.rev20160730.IetfL3VpnSvc;
+import org.onosproject.yang.gen.v1.l3vpnsvcext.rev20160730.L3VpnSvcExt;
+import org.onosproject.yang.model.DefaultYangModuleId;
+import org.onosproject.yang.model.YangModuleId;
+import org.onosproject.yang.runtime.AppModuleInfo;
+import org.onosproject.yang.runtime.DefaultAppModuleInfo;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Representation of L3VPN model registrator which registers L3VPN service
+ * model.
+ */
+@Component(immediate = true)
+public class L3VpnModelRegistrator extends AbstractYangModelRegistrator {
+
+ /**
+ * Creates L3VPN model registrator.
+ */
+ public L3VpnModelRegistrator() {
+ super(L3VpnModelRegistrator.class, getAppInfo());
+ }
+
+ private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
+ Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
+ appInfo.put(new DefaultYangModuleId("ietf-l3vpn-svc", "2016-07-30"),
+ new DefaultAppModuleInfo(IetfL3VpnSvc.class, null));
+ appInfo.put(new DefaultYangModuleId("l3vpn-svc-ext", "2016-07-30"),
+ new DefaultAppModuleInfo(L3VpnSvcExt.class, null));
+ return ImmutableMap.copyOf(appInfo);
+ }
+}
diff --git a/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/package-info.java b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/package-info.java
new file mode 100644
index 0000000..55e1dbb
--- /dev/null
+++ b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * L3vpn YANG models.
+ */
+package org.onosproject.models.l3vpn;