Revert "Revert "YANG runtime manager to register default serializers.""
This reverts commit 6beebeb73e2029e486b713869eed5d64e7f3b066.
Change-Id: Ia044dcbe86ae5557324f330e8659bd9e4b35cf12
diff --git a/apps/yang/BUCK b/apps/yang/BUCK
index 7af28b0..85e557c 100644
--- a/apps/yang/BUCK
+++ b/apps/yang/BUCK
@@ -3,6 +3,10 @@
'//lib:onos-yang-model',
'//lib:onos-yang-compiler-api',
'//lib:onos-yang-runtime',
+ '//lib:onos-yang-serializers-json',
+ '//lib:onos-yang-serializers-xml',
+ '//lib:onos-yang-serializers-utils',
+ '//lib:org.apache.servicemix.bundles.dom4j',
]
BUNDLES = [
@@ -12,6 +16,13 @@
'//lib:onos-yang-runtime',
]
+EXCLUDED_BUNDLES = [
+ '//lib:onos-yang-serializers-json',
+ '//lib:onos-yang-serializers-xml',
+ '//lib:onos-yang-serializers-utils',
+ '//lib:org.apache.servicemix.bundles.dom4j',
+]
+
osgi_jar (
deps = COMPILE_DEPS,
)
@@ -22,4 +33,5 @@
url = 'http://onosproject.org',
description = 'Base application to bring in the YANG libraries and assemble them for other apps to use.',
included_bundles = BUNDLES,
+ excluded_bundles = EXCLUDED_BUNDLES,
)
\ No newline at end of file
diff --git a/apps/yang/pom.xml b/apps/yang/pom.xml
index c277ece..d523e25 100644
--- a/apps/yang/pom.xml
+++ b/apps/yang/pom.xml
@@ -35,5 +35,15 @@
<artifactId>onos-yang-runtime</artifactId>
<version>${yang.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-yang-serializers-json</artifactId>
+ <version>${yang.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-yang-serializers-xml</artifactId>
+ <version>${yang.version}</version>
+ </dependency>
</dependencies>
</project>
\ 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 1df5f13..c9a9ce9 100644
--- a/apps/yang/src/main/java/org/onosproject/yang/YangRuntimeManager.java
+++ b/apps/yang/src/main/java/org/onosproject/yang/YangRuntimeManager.java
@@ -36,6 +36,8 @@
import org.onosproject.yang.runtime.impl.DefaultYangModelRegistry;
import org.onosproject.yang.runtime.impl.DefaultYangRuntimeHandler;
import org.onosproject.yang.runtime.impl.DefaultYangSerializerRegistry;
+import org.onosproject.yang.serializers.json.JsonSerializer;
+import org.onosproject.yang.serializers.xml.XmlSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,6 +68,8 @@
serializerRegistry = new DefaultYangSerializerRegistry();
modelRegistry = new DefaultYangModelRegistry();
runtimeService = new DefaultYangRuntimeHandler(serializerRegistry, modelRegistry);
+ serializerRegistry.registerSerializer(new JsonSerializer());
+ serializerRegistry.registerSerializer(new XmlSerializer());
log.info("Started");
}
diff --git a/lib/BUCK b/lib/BUCK
index 807d1e2..5b92525 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Thu, 9 Mar 2017 11:45:41 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Fri, 10 Mar 2017 07:03:42 GMT. Do not edit this file manually. *****
# ***** Use onos-lib-gen *****
pass_thru_pom(
@@ -47,6 +47,9 @@
':onos-yang-model',
':onos-yang-compiler-api',
':onos-yang-maven-plugin',
+ ':onos-yang-serializers-json',
+ ':onos-yang-serializers-xml',
+ ':onos-yang-serializers-utils',
':org.apache.servicemix.bundles.dom4j',
],
)
@@ -1214,6 +1217,33 @@
)
remote_jar (
+ name = 'onos-yang-serializers-json',
+ out = 'onos-yang-serializers-json-1.12.0-b6.jar',
+ url = 'mvn:org.onosproject:onos-yang-serializers-json:jar:1.12.0-b6',
+ sha1 = '75286e48c80605ea1fa0fe667c0a8e6933e5c04f',
+ maven_coords = 'org.onosproject:onos-yang-serializers-json:1.12.0-b6',
+ visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
+ name = 'onos-yang-serializers-xml',
+ out = 'onos-yang-serializers-xml-1.12.0-b6.jar',
+ url = 'mvn:org.onosproject:onos-yang-serializers-xml:jar:1.12.0-b6',
+ sha1 = 'f748a79f2dca0704afbdf5769f700976961017c1',
+ maven_coords = 'org.onosproject:onos-yang-serializers-xml:1.12.0-b6',
+ visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
+ name = 'onos-yang-serializers-utils',
+ out = 'onos-yang-serializers-utils-1.12.0-b6.jar',
+ url = 'mvn:org.onosproject:onos-yang-serializers-utils:jar:1.12.0-b6',
+ sha1 = 'f6c2fecd595ec7a4ea3c61f21fad38f5202563e6',
+ maven_coords = 'org.onosproject:onos-yang-serializers-utils:1.12.0-b6',
+ visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
name = 'org.apache.servicemix.bundles.dom4j',
out = 'org.apache.servicemix.bundles.dom4j-1.6.1_5.jar',
url = 'mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.dom4j:jar:1.6.1_5',
diff --git a/lib/deps.json b/lib/deps.json
index 172b80e..765e534 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -36,6 +36,9 @@
"onos-yang-model",
"onos-yang-compiler-api",
"onos-yang-maven-plugin",
+ "onos-yang-serializers-json",
+ "onos-yang-serializers-xml",
+ "onos-yang-serializers-utils",
"org.apache.servicemix.bundles.dom4j"
],
"CORE_DEPS": [
@@ -213,6 +216,9 @@
"onos-yang-model":"mvn:org.onosproject:onos-yang-model:1.12.0-b6",
"onos-yang-compiler-api":"mvn:org.onosproject:onos-yang-compiler-api:1.12.0-b6",
"onos-yang-runtime":"mvn:org.onosproject:onos-yang-runtime:1.12.0-b6",
+ "onos-yang-serializers-json":"mvn:org.onosproject:onos-yang-serializers-json:1.12.0-b6",
+ "onos-yang-serializers-xml":"mvn:org.onosproject:onos-yang-serializers-xml:1.12.0-b6",
+ "onos-yang-serializers-utils":"mvn:org.onosproject:onos-yang-serializers-utils:1.12.0-b6",
"org.apache.servicemix.bundles.dom4j":"mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.dom4j:1.6.1_5",
"openflowj-3.0": {
"uri": "mvn:org.projectfloodlight:openflowj:3.0.0-SNAPSHOT",