Bumping ONOS dependency on the latest YANG tools.
Change-Id: I25bc3e1f47082920410fe70bc4ace41fee9298b3
diff --git a/apps/config/pom.xml b/apps/config/pom.xml
index 1b8e334..dcb6b7a 100755
--- a/apps/config/pom.xml
+++ b/apps/config/pom.xml
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-yang-model</artifactId>
- <version>1.12-b3</version>
+ <version>1.12.0-b5</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
diff --git a/apps/netconf/client/BUCK b/apps/netconf/client/BUCK
index 9db9512..b31c727 100644
--- a/apps/netconf/client/BUCK
+++ b/apps/netconf/client/BUCK
@@ -1,6 +1,6 @@
COMPILE_DEPS = [
'//lib:CORE_DEPS',
- '//lib:onos-yang-runtime-api',
+ '//lib:onos-yang-runtime',
'//protocols/netconf/api:onos-protocols-netconf-api'
]
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/api/NetconfTranslator.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/api/NetconfTranslator.java
index 7706896..973cdb9 100644
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/api/NetconfTranslator.java
+++ b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/api/NetconfTranslator.java
@@ -17,8 +17,8 @@
package org.onosproject.netconf.client.api;
import org.onosproject.net.DeviceId;
-import org.onosproject.yang.runtime.api.CompositeData;
import com.google.common.annotations.Beta;
+import org.onosproject.yang.runtime.CompositeData;
import java.io.IOException;
diff --git a/apps/yang/src/main/java/org/onosproject/yang/YangManager.java b/apps/yang/src/main/java/org/onosproject/yang/YangManager.java
deleted file mode 100644
index c41e950..0000000
--- a/apps/yang/src/main/java/org/onosproject/yang/YangManager.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * 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.yang;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.slf4j.Logger;
-import static org.slf4j.LoggerFactory.getLogger;
-
-/**
- * Base application to bring in the YANG libraries and assemble them for other apps to use.
- *
- */
-@Component(immediate = true)
-public class YangManager {
- private final Logger log = getLogger(getClass());
- @Activate
- public void activate() {
- //log.info("Onos Yang Extension Activated!!");
- }
-
- @Deactivate
- public void deactivate() {
- //log.info("Onos Yang Extension Deactivated!!");
- }
-}
\ No newline at end of file
diff --git a/apps/yang/src/main/java/org/onosproject/yang/YangRuntimeManager.java b/apps/yang/src/main/java/org/onosproject/yang/YangRuntimeManager.java
index 9522b67..1df5f13 100644
--- a/apps/yang/src/main/java/org/onosproject/yang/YangRuntimeManager.java
+++ b/apps/yang/src/main/java/org/onosproject/yang/YangRuntimeManager.java
@@ -24,7 +24,6 @@
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
import org.onosproject.core.CoreService;
-import org.onosproject.yang.model.SchemaContext;
import org.onosproject.yang.model.YangModel;
import org.onosproject.yang.runtime.CompositeData;
import org.onosproject.yang.runtime.CompositeStream;
@@ -57,20 +56,22 @@
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected CoreService coreService;
- private YangModelRegistry modelRegistry;
- private YangSerializerRegistry serializerRegistry;
+ private DefaultYangModelRegistry modelRegistry;
+ private DefaultYangSerializerRegistry serializerRegistry;
+ private DefaultYangRuntimeHandler runtimeService;
@Activate
public void activate() {
coreService.registerApplication(APP_ID);
serializerRegistry = new DefaultYangSerializerRegistry();
modelRegistry = new DefaultYangModelRegistry();
- log.info("YANG runtime manager started");
+ runtimeService = new DefaultYangRuntimeHandler(serializerRegistry, modelRegistry);
+ log.info("Started");
}
@Deactivate
public void deactivate() {
- log.info("YANG runtime manager stopped");
+ log.info("Stopped");
}
@@ -106,15 +107,11 @@
@Override
public CompositeData decode(CompositeStream cs, RuntimeContext rc) {
- YangRuntimeService service = new DefaultYangRuntimeHandler(
- serializerRegistry, (SchemaContext) modelRegistry);
- return service.decode(cs, rc);
+ return runtimeService.decode(cs, rc);
}
@Override
public CompositeStream encode(CompositeData cd, RuntimeContext rc) {
- YangRuntimeService service = new DefaultYangRuntimeHandler(
- serializerRegistry, (SchemaContext) modelRegistry);
- return service.encode(cd, rc);
+ return runtimeService.encode(cd, rc);
}
}