Make ListenerAdapter serialize JSON directly 14/93214/9
authorTomas Cere <tomas.cere@pantheon.tech>
Thu, 25 Jun 2020 09:00:47 +0000 (11:00 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 4 Nov 2020 15:36:02 +0000 (15:36 +0000)
commit40ff777cd15b7146fea5c498a883065d60cb5bde
treeb1a2917e4a9f962bd5de3c58cf8c9ea93f3bdf9a
parenta8a56843c3dc31f61a01d6eff31cb79a5381398a
Make ListenerAdapter serialize JSON directly

Change websocket notification serialization to serialize
to json directly instead of first serializing to xml and
subsequently converting to json.
While we are here fixup the websocket notification format
so it actually conforms to the sal-remote.yang model and
encode namespaces according to the json-ietf standard
instead of bundling an xmlns node in the json ouptut.

JIRA: NETCONF-471
Change-Id: I1b90c99980c0692b217523640bd6f67050f21e14
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
38 files changed:
restconf/restconf-common/pom.xml
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/DataTreeCandidateFormatter.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/DataTreeCandidateFormatterFactory.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/EventFormatter.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/EventFormatterFactory.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/JSONDataTreeCandidateFormatter.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/JSONNotificationFormatter.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/NotificationFormatter.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/NotificationFormatterFactory.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/XMLDataTreeCandidateFormatter.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/XMLNotificationFormatter.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/serializer/AbstractWebsocketSerializer.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/serializer/JsonDataTreeCandidateSerializer.java [new file with mode: 0644]
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/serializer/XmlDataTreeCandidateSerializer.java [new file with mode: 0644]
restconf/restconf-nb-rfc8040/pom.xml
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/NotificationListenerAdapter.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapperTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JsonNotificationListenerTest.java [moved from restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/NotificationListenerTest.java with 94% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XmlNotificationListenerTest.java [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-create.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-create.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-del.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-delete.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-leaves-create.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-leaves-create.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-leaves-del.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-leaves-update.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-leaves-update.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-update.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-update.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-without-data-create.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-without-data-create.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-without-data-del.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-without-data-delete.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-without-data-update.json
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-without-data-update.xml [new file with mode: 0644]