From 5e2399efc1284fd8c61a2c39c8c412ea04e1a7e8 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 7 Sep 2023 01:35:20 +0200 Subject: [PATCH] Use NormalizedNodeStreamWriter to emit JSON data We are already instantiating NormalizedNode-based writer, which means we get help in terms for formatting things. JIRA: NETCONF-1152 Change-Id: Ie076ba571887c70a94cdd1baf7ea5e1ec6d8e91f Signed-off-by: Robert Varga --- .../AbstractWebsocketSerializer.java | 35 ++++--- .../JSONDataTreeCandidateFormatter.java | 16 +--- .../JsonDataTreeCandidateSerializer.java | 45 +++++---- .../XmlDataTreeCandidateSerializer.java | 59 +++++------- .../listeners/ListenerAdapterTest.java | 3 +- .../instanceidentifier/yang/sal-remote.yang | 95 +++++++++++++++++++ .../notif-changed-leaves-create.json | 70 +++++++------- .../notif-changed-leaves-delete.json | 52 +++++----- .../notif-changed-leaves-update.json | 42 ++++---- .../notif-child-nodes-only-create.json | 8 +- .../notif-child-nodes-only-delete.json | 8 +- .../notif-child-nodes-only-update1.json | 10 +- .../notif-child-nodes-only-update2.json | 10 +- .../notif-cont-create.json | 4 +- .../notif-cont-delete.json | 4 +- .../notif-cont-update.json | 4 +- .../notif-leaves-create.json | 70 +++++++------- .../notif-leaves-delete.json | 54 +++++------ .../notif-leaves-update.json | 70 +++++++------- .../notif-list-create.json | 24 ++--- .../notif-list-delete.json | 14 +-- .../notif-list-update.json | 26 ++--- .../notif-without-data-cont-create.json | 4 +- .../notif-without-data-cont-delete.json | 4 +- .../notif-without-data-cont-update.json | 4 +- .../notif-without-data-list-create.json | 14 +-- .../notif-without-data-list-delete.json | 14 +-- .../notif-without-data-list-update.json | 14 +-- 28 files changed, 434 insertions(+), 343 deletions(-) create mode 100644 restconf/restconf-nb/src/test/resources/instanceidentifier/yang/sal-remote.yang diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/AbstractWebsocketSerializer.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/AbstractWebsocketSerializer.java index aa911e49ed..47c59d5070 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/AbstractWebsocketSerializer.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/AbstractWebsocketSerializer.java @@ -10,13 +10,19 @@ package org.opendaylight.restconf.nb.rfc8040.streams.listeners; import static com.google.common.base.Verify.verifyNotNull; import static java.util.Objects.requireNonNull; +import com.google.common.base.VerifyException; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.Deque; +import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.data.changed.notification.DataChangeEvent; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.data.changed.notification.DataChangeEvent.Operation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.data.changed.notification.data.change.event.Data; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; @@ -26,7 +32,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate; import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode; -import org.opendaylight.yangtools.yang.data.tree.api.ModificationType; import org.opendaylight.yangtools.yang.data.util.DataSchemaContext; import org.opendaylight.yangtools.yang.data.util.DataSchemaContextTree; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; @@ -37,6 +42,11 @@ import org.slf4j.LoggerFactory; abstract class AbstractWebsocketSerializer { private static final Logger LOG = LoggerFactory.getLogger(AbstractWebsocketSerializer.class); + static final @NonNull QName PATH_QNAME = QName.create(DataChangeEvent.QNAME, "path").intern(); + static final @NonNull NodeIdentifier PATH_NID = NodeIdentifier.create(PATH_QNAME); + static final @NonNull QName OPERATION_QNAME = QName.create(DataChangeEvent.QNAME, "operation").intern(); + static final @NonNull NodeIdentifier OPERATION_NID = NodeIdentifier.create(OPERATION_QNAME); + static final @NonNull String DATA_NAME = Data.QNAME.getLocalName(); private final EffectiveModelContext context; @@ -173,10 +183,6 @@ abstract class AbstractWebsocketSerializer { return before != null && after != null && before.body().equals(after.body()); } - abstract void serializePath(Collection pathArguments) throws T; - - abstract void serializeOperation(DataTreeCandidateNode candidate) throws T; - static final @Nullable NormalizedNode getDataAfter(final DataTreeCandidateNode candidate) { final var data = candidate.dataAfter(); if (data instanceof MapEntryNode mapEntry) { @@ -216,22 +222,21 @@ abstract class AbstractWebsocketSerializer { return sb.toString(); } - @Deprecated - static void appendQName(final StringBuilder sb, final QName qname) { + private static void appendQName(final StringBuilder sb, final QName qname) { // FIXME: err: what?! what is this replacement?! sb.append(qname.getNamespace().toString().replace(':', '-')).append(':').append(qname.getLocalName()); } - static final String modificationTypeToOperation(final DataTreeCandidateNode candidate, - final ModificationType modificationType) { - return switch (modificationType) { - case APPEARED, SUBTREE_MODIFIED, WRITE -> candidate.dataBefore() != null ? "updated" : "created"; - case DELETE, DISAPPEARED -> "deleted"; + static final @NonNull String modificationTypeToOperation(final DataTreeCandidateNode candidate) { + final var operation = switch (candidate.modificationType()) { + case APPEARED, SUBTREE_MODIFIED, WRITE -> candidate.dataBefore() != null ? Operation.Updated + : Operation.Created; + case DELETE, DISAPPEARED -> Operation.Deleted; case UNMODIFIED -> { - // shouldn't ever happen since the root of a modification is only triggered by some event - LOG.warn("DataTreeCandidate for a notification is unmodified. Candidate: {}", candidate); - yield "none"; + throw new VerifyException("DataTreeCandidate for a notification is unmodified. Candidate: " + + candidate); } }; + return operation.getName(); } } diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JSONDataTreeCandidateFormatter.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JSONDataTreeCandidateFormatter.java index 2c46fccf1a..c7c0e0625f 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JSONDataTreeCandidateFormatter.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JSONDataTreeCandidateFormatter.java @@ -16,28 +16,22 @@ import java.time.Instant; import java.util.Collection; import javax.xml.xpath.XPathExpressionException; import org.eclipse.jdt.annotation.NonNull; -import org.opendaylight.netconf.api.NamespaceURN; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.$YangModuleInfoImpl; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.DataChangedNotification; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.data.changed.notification.DataChangeEvent; -import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier; import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; public final class JSONDataTreeCandidateFormatter extends DataTreeCandidateFormatter { - private static final @NonNull String NOTIFICATION_NAME; + private static final @NonNull String NOTIFICATION_NAME = "ietf-restconf:notification"; + private static final @NonNull String DATA_CHANGED_NOTIFICATION_NAME; private static final @NonNull String DATA_CHANGED_EVENT_NAME = DataChangeEvent.QNAME.getLocalName(); - // FIXME: JSON codec operating on XMLNamespace values?! This really should be module names, right? static { - final var sb = new StringBuilder(); - AbstractWebsocketSerializer.appendQName(sb, QName.create(NamespaceURN.NOTIFICATION, "notification")); - NOTIFICATION_NAME = sb.toString(); - - sb.setLength(0); - AbstractWebsocketSerializer.appendQName(sb, DataChangedNotification.QNAME); - DATA_CHANGED_NOTIFICATION_NAME = sb.toString(); + final var salRemoteName = $YangModuleInfoImpl.getInstance().getName().getLocalName(); + DATA_CHANGED_NOTIFICATION_NAME = salRemoteName + ":" + DataChangedNotification.QNAME.getLocalName(); } private final JSONCodecFactorySupplier codecSupplier; diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JsonDataTreeCandidateSerializer.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JsonDataTreeCandidateSerializer.java index 46a46f34a2..225600e16c 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JsonDataTreeCandidateSerializer.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JsonDataTreeCandidateSerializer.java @@ -8,19 +8,28 @@ package org.opendaylight.restconf.nb.rfc8040.streams.listeners; import static java.util.Objects.requireNonNull; +import static org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter.createNestedWriter; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Collection; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.DataChangedNotification; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.data.changed.notification.DataChangeEvent; +import org.opendaylight.yangtools.yang.common.XMLNamespace; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter; import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier; -import org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode; +import org.opendaylight.yangtools.yang.data.tree.api.ModificationType; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; +import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute; import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; final class JsonDataTreeCandidateSerializer extends AbstractWebsocketSerializer { + private static final XMLNamespace SAL_REMOTE_NS = DataChangedNotification.QNAME.getNamespace(); + private static final Absolute DATA_CHANGE_EVENT = Absolute.of(DataChangedNotification.QNAME, DataChangeEvent.QNAME); + private final JSONCodecFactorySupplier codecSupplier; private final JsonWriter jsonWriter; @@ -36,35 +45,31 @@ final class JsonDataTreeCandidateSerializer extends AbstractWebsocketSerializer< final DataTreeCandidateNode candidate, final boolean skipData) throws IOException { jsonWriter.beginObject(); - final var codecs = codecSupplier.getShared(parent.getEffectiveModelContext()); - try (var nestedWriter = JSONNormalizedNodeStreamWriter.createNestedWriter(codecs, parent, null, jsonWriter)) { - serializePath(dataPath); + final var modificationType = candidate.modificationType(); + if (modificationType != ModificationType.UNMODIFIED) { + final var codecs = codecSupplier.getShared(parent.getEffectiveModelContext()); + try (var writer = createNestedWriter(codecs, DATA_CHANGE_EVENT, SAL_REMOTE_NS, jsonWriter)) { + writer.startLeafNode(PATH_NID); + writer.scalarValue(YangInstanceIdentifier.of(dataPath)); + writer.endNode(); + + writer.startLeafNode(OPERATION_NID); + writer.scalarValue(modificationTypeToOperation(candidate)); + writer.endNode(); + } if (!skipData) { final var dataAfter = getDataAfter(candidate); if (dataAfter != null) { jsonWriter.name("data").beginObject(); - NormalizedNodeWriter.forStreamWriter(nestedWriter).write(dataAfter).flush(); + try (var writer = createNestedWriter(codecs, parent, SAL_REMOTE_NS, jsonWriter)) { + NormalizedNodeWriter.forStreamWriter(writer).write(dataAfter).flush(); + } jsonWriter.endObject(); } } - - serializeOperation(candidate); } jsonWriter.endObject(); } - - @Override - void serializeOperation(final DataTreeCandidateNode candidate) - throws IOException { - jsonWriter.name("operation").value(modificationTypeToOperation(candidate, candidate.modificationType())); - } - - @Override - void serializePath(final Collection pathArguments) - throws IOException { - // FIXME: use proper JSON codec for YangInstanceIdentifier - jsonWriter.name("path").value(convertPath(pathArguments)); - } } diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XmlDataTreeCandidateSerializer.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XmlDataTreeCandidateSerializer.java index 74346acc8e..b39065617a 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XmlDataTreeCandidateSerializer.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XmlDataTreeCandidateSerializer.java @@ -11,13 +11,12 @@ import static java.util.Objects.requireNonNull; import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.NotificationFormatter.DATA_CHANGE_EVENT_ELEMENT; import java.util.Collection; -import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; -import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter; import org.opendaylight.yangtools.yang.data.codec.xml.XMLStreamNormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode; +import org.opendaylight.yangtools.yang.data.tree.api.ModificationType; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; @@ -30,39 +29,33 @@ final class XmlDataTreeCandidateSerializer extends AbstractWebsocketSerializer nodePath, + void serializeData(final Inference parent, final Collection dataPath, final DataTreeCandidateNode candidate, final boolean skipData) throws Exception { - NormalizedNodeStreamWriter nodeStreamWriter = XMLStreamNormalizedNodeStreamWriter.create(xmlWriter, parent); - xmlWriter.writeStartElement(DATA_CHANGE_EVENT_ELEMENT); - serializePath(nodePath); - - if (!skipData) { - final var dataAfter = getDataAfter(candidate); - if (dataAfter != null) { - xmlWriter.writeStartElement("data"); - NormalizedNodeWriter nnWriter = NormalizedNodeWriter.forStreamWriter(nodeStreamWriter); - nnWriter.write(dataAfter); - nnWriter.flush(); - xmlWriter.writeEndElement(); + final var modificationType = candidate.modificationType(); + if (modificationType != ModificationType.UNMODIFIED) { + xmlWriter.writeStartElement(DATA_CHANGE_EVENT_ELEMENT); + xmlWriter.writeStartElement("path"); + // FIXME: use proper XML codec for YangInstanceIdentifier + xmlWriter.writeCharacters(convertPath(dataPath)); + xmlWriter.writeEndElement(); + + xmlWriter.writeStartElement("operation"); + xmlWriter.writeCharacters(modificationTypeToOperation(candidate)); + xmlWriter.writeEndElement(); + + if (!skipData) { + final var dataAfter = getDataAfter(candidate); + if (dataAfter != null) { + xmlWriter.writeStartElement("data"); + final var nnWriter = NormalizedNodeWriter.forStreamWriter( + XMLStreamNormalizedNodeStreamWriter.create(xmlWriter, parent)); + nnWriter.write(dataAfter); + nnWriter.flush(); + xmlWriter.writeEndElement(); + } } - } - serializeOperation(candidate); - xmlWriter.writeEndElement(); - } - - @Override - public void serializePath(final Collection pathArguments) throws XMLStreamException { - xmlWriter.writeStartElement("path"); - // FIXME: use proper XML codec for YangInstanceIdentifier - xmlWriter.writeCharacters(convertPath(pathArguments)); - xmlWriter.writeEndElement(); - } - - @Override - public void serializeOperation(final DataTreeCandidateNode candidate) throws XMLStreamException { - xmlWriter.writeStartElement("operation"); - xmlWriter.writeCharacters(modificationTypeToOperation(candidate, candidate.modificationType())); - xmlWriter.writeEndElement(); + xmlWriter.writeEndElement(); + } } } diff --git a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java index 717e6473e0..704291597e 100644 --- a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java +++ b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapterTest.java @@ -545,8 +545,7 @@ public class ListenerAdapterTest extends AbstractConcurrentDataBrokerTest { static String withFakeDate(final String in) throws JSONException { final JSONObject doc = new JSONObject(in); - final JSONObject notification = - doc.getJSONObject("urn-ietf-params-xml-ns-netconf-notification-1.0:notification"); + final JSONObject notification = doc.getJSONObject("ietf-restconf:notification"); if (notification == null) { return in; } diff --git a/restconf/restconf-nb/src/test/resources/instanceidentifier/yang/sal-remote.yang b/restconf/restconf-nb/src/test/resources/instanceidentifier/yang/sal-remote.yang new file mode 100644 index 0000000000..0caefe1406 --- /dev/null +++ b/restconf/restconf-nb/src/test/resources/instanceidentifier/yang/sal-remote.yang @@ -0,0 +1,95 @@ +module sal-remote { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote"; + prefix "sal-remote"; + + organization "Cisco Systems, Inc."; + contact "Martin Bobak "; + + description + "This module contains the definition of methods related to + sal remote model. + + Copyright (c)2013 Cisco Systems, Inc. All rights reserved. + + This program and the accompanying materials are made available + under the terms of the Eclipse Public License v1.0 which + accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html"; + + revision "2014-01-14" { + description "Initial revision"; + } + + typedef q-name { + type string; + reference "http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#QName"; + } + + rpc create-data-change-event-subscription { + input { + leaf path { + type instance-identifier; + description "Subtree path. "; + mandatory true; + } + } + output { + leaf stream-name { + type string; + description "Notification stream name."; + } + } + } + + notification data-changed-notification { + description "Data change notification."; + list data-change-event { + key path; + leaf path { + type instance-identifier; + } + leaf store { + type enumeration { + enum config; + enum operation; + } + } + leaf operation { + type enumeration { + enum created; + enum updated; + enum deleted; + } + } + anyxml data{ + description "DataObject "; + } + } + } + + rpc create-notification-stream { + input { + leaf-list notifications { + type q-name; + description "Notification QNames"; + min-elements 1; + } + } + output { + leaf notification-stream-identifier { + type string; + description "Unique notification stream identifier, in which notifications will be propagated"; + } + } + } + + rpc begin-transaction { + output { + anyxml data-modification-transaction { + description "DataModificationTransaction xml"; + } + } + } +} diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-create.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-create.json index 4b1df00758..c55f655878 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-create.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-create.json @@ -1,37 +1,37 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": { - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": { - "data-change-event": [ - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11", - "data": { - "instance-identifier-patch-module:my-leaf11": "Jed" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name", - "data": { - "instance-identifier-patch-module:name": "Althea" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:leaf1", - "data": { - "augment-iip-module:leaf1": "AugmentLeaf" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:patch-choice2/augment-instance-identifier-patch-module:patch-sub-choice11/augment-instance-identifier-patch-module:patch-sub-sub-choice11/augment-instance-identifier-patch-module:case-leaf11", - "data": { - "augment-iip-module:case-leaf11": "ChoiceLeaf" - }, - "operation": "created" + "ietf-restconf:notification" : { + "event-time": "2022-09-22T19:07:42.107085298+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf11", + "operation" : "created", + "data" : { + "instance-identifier-patch-module:my-leaf11" : "Jed" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/name", + "operation" : "created", + "data" : { + "instance-identifier-patch-module:name" : "Althea" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:leaf1", + "operation" : "created", + "data" : { + "augment-iip-module:leaf1" : "AugmentLeaf" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:case-leaf11", + "operation" : "created", + "data" : { + "augment-iip-module:case-leaf11" : "ChoiceLeaf" + } + } + ] } - ] - }, - "event-time": "2022-09-22T19:07:42.107085298+02:00" - } -} \ No newline at end of file + } +} diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-delete.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-delete.json index cd08a61265..65428a1020 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-delete.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-delete.json @@ -1,29 +1,29 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": { - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": { - "data-change-event": [ - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:leaf1", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:patch-choice2/augment-instance-identifier-patch-module:patch-sub-choice11/augment-instance-identifier-patch-module:patch-sub-sub-choice11/augment-instance-identifier-patch-module:case-leaf11", - "operation": "deleted" + "ietf-restconf:notification" : { + "event-time": "2022-09-22T19:09:08.564261906+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf11", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/name", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf12", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:leaf1", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:case-leaf11", + "operation" : "deleted" + } + ] } - ] - }, - "event-time": "2022-09-22T19:09:08.564261906+02:00" - } + } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-update.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-update.json index 816b3b73e2..db263a2fc5 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-update.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-changed-leaves-update.json @@ -1,23 +1,23 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": { - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": { - "data-change-event": [ - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12", - "data": { - "instance-identifier-patch-module:my-leaf12": "Bertha" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:patch-choice2/augment-instance-identifier-patch-module:patch-sub-choice11/augment-instance-identifier-patch-module:patch-sub-sub-choice11/augment-instance-identifier-patch-module:case-leaf11", - "data": { - "augment-iip-module:case-leaf11": "ChoiceUpdate" - }, - "operation": "updated" + "ietf-restconf:notification" : { + "event-time" : "2022-09-22T19:08:32.400965352+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf12", + "operation" : "created", + "data" : { + "instance-identifier-patch-module:my-leaf12" : "Bertha" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:case-leaf11", + "operation" : "updated", + "data" : { + "augment-iip-module:case-leaf11" : "ChoiceUpdate" + } + } + ] } - ] - }, - "event-time": "2022-09-22T19:08:32.400965352+02:00" - } -} \ No newline at end of file + } +} diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-create.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-create.json index e86e20be7f..c985b0a3a0 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-create.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-create.json @@ -1,6 +1,7 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "event-time":"2020-10-14T11:16:51.111635+02:00", + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", @@ -17,7 +18,6 @@ } } ] - }, - "event-time":"2020-10-14T11:16:51.111635+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-delete.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-delete.json index c0c5f34b2e..48b91eb51f 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-delete.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-delete.json @@ -1,13 +1,13 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "event-time":"2020-10-14T11:20:33.271836+02:00", + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", "operation":"deleted" } ] - }, - "event-time":"2020-10-14T11:20:33.271836+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update1.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update1.json index 0b67f483b0..62db45f88c 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update1.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update1.json @@ -1,9 +1,10 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "event-time":"2020-10-14T11:16:51.111635+02:00", + "sal-remote:data-changed-notification":{ "data-change-event":[ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']", + "path":"/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']", "operation":"updated", "data":{ "instance-identifier-patch-module:my-list1":[ @@ -15,7 +16,6 @@ } } ] - }, - "event-time":"2020-10-14T11:16:51.111635+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update2.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update2.json index 25c1331bc4..cc22ec1754 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update2.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-child-nodes-only-update2.json @@ -1,16 +1,16 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "event-time":"2020-10-14T11:19:34.549843+02:00", + "sal-remote:data-changed-notification":{ "data-change-event":[ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11", + "path":"/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf11", "operation":"updated", "data":{ "instance-identifier-patch-module:my-leaf11":"Jed" } } ] - }, - "event-time":"2020-10-14T11:19:34.549843+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-create.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-create.json index 39748b97d6..9c6988e0bf 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-create.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-create.json @@ -1,6 +1,6 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-delete.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-delete.json index 0c79ab6412..aa8fcf4852 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-delete.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-delete.json @@ -1,6 +1,6 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-update.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-update.json index 55dc269df8..71d5cad383 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-update.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-cont-update.json @@ -1,6 +1,6 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-create.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-create.json index eb408f3b25..413c4d4258 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-create.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-create.json @@ -1,37 +1,37 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": { - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": { - "data-change-event": [ - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11", - "data": { - "instance-identifier-patch-module:my-leaf11": "Jed" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name", - "data": { - "instance-identifier-patch-module:name": "Althea" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:patch-choice1/augment-instance-identifier-patch-module:case-leaf1", - "data": { - "augment-iip-module:case-leaf1": "ChoiceLeaf" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:leaf1", - "data": { - "augment-iip-module:leaf1": "AugmentLeaf" - }, - "operation": "created" + "ietf-restconf:notification" : { + "event-time" : "2022-02-18T18:04:25.177143+01:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/name", + "operation" : "created", + "data" : { + "instance-identifier-patch-module:name" : "Althea" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf11", + "operation" : "created", + "data" : { + "instance-identifier-patch-module:my-leaf11" : "Jed" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:leaf1", + "operation" : "created", + "data" : { + "augment-iip-module:leaf1" : "AugmentLeaf" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:case-leaf1", + "operation":"created", + "data" : { + "augment-iip-module:case-leaf1" : "ChoiceLeaf" + } + } + ] } - ] - }, - "event-time": "2022-02-18T18:04:25.177143+01:00" - } -} \ No newline at end of file + } +} diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-delete.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-delete.json index 7bba922254..0249a97226 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-delete.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-delete.json @@ -1,29 +1,29 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": { - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": { - "data-change-event": [ - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:patch-choice1/augment-instance-identifier-patch-module:case-leaf1", - "operation": "deleted" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:leaf1", - "operation": "deleted" + "ietf-restconf:notification" : { + "event-time": "2022-02-18T18:07:48.662524+01:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf11", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/name", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf12", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:leaf1", + "operation" : "deleted" + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:case-leaf1", + "operation" : "deleted" + } + ] } - ] - }, - "event-time": "2022-02-18T18:07:48.662524+01:00" - } -} \ No newline at end of file + } +} diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-update.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-update.json index ea825fd103..21bb5cb017 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-update.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-leaves-update.json @@ -1,37 +1,37 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": { - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": { - "data-change-event": [ - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name", - "data": { - "instance-identifier-patch-module:name": "Althea" - }, - "operation": "updated" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12", - "data": { - "instance-identifier-patch-module:my-leaf12": "Bertha" - }, - "operation": "created" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:patch-choice1/augment-instance-identifier-patch-module:case-leaf1", - "data": { - "augment-iip-module:case-leaf1": "ChoiceUpdate" - }, - "operation": "updated" - }, - { - "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:leaf1", - "data": { - "augment-iip-module:leaf1": "AugmentLeaf" - }, - "operation": "updated" + "ietf-restconf:notification" : { + "event-time": "2022-02-18T18:04:25.214583+01:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/name", + "operation" : "updated", + "data" : { + "instance-identifier-patch-module:name" : "Althea" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']/my-leaf12", + "operation" : "created", + "data" : { + "instance-identifier-patch-module:my-leaf12" : "Bertha" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:leaf1", + "operation" : "updated", + "data" : { + "augment-iip-module:leaf1" : "AugmentLeaf" + } + }, + { + "path" : "/instance-identifier-patch-module:patch-cont/augment-iip-module:case-leaf1", + "operation" : "updated", + "data" : { + "augment-iip-module:case-leaf1" : "ChoiceUpdate" + } + } + ] } - ] - }, - "event-time": "2022-02-18T18:04:25.214583+01:00" - } -} \ No newline at end of file + } +} diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-create.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-create.json index b9c2eeb93f..04bf6dccb2 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-create.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-create.json @@ -1,21 +1,21 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ - "data-change-event":[ + "ietf-restconf:notification" : { + "event-time" : "2020-10-14T11:16:51.111635+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']", - "data":{ - "instance-identifier-patch-module:my-list1":[ + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']", + "operation" : "created", + "data" : { + "instance-identifier-patch-module:my-list1" : [ { - "name":"Althea", - "my-leaf11":"Jed" + "name" : "Althea", + "my-leaf11" : "Jed" } ] - }, - "operation":"created" + } } ] - }, - "event-time":"2020-10-14T11:16:51.111635+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-delete.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-delete.json index e60fb2ec4b..39318d39e0 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-delete.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-delete.json @@ -1,13 +1,13 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ - "data-change-event":[ + "ietf-restconf:notification" : { + "event-time":"2020-10-14T11:20:33.271836+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']", - "operation":"deleted" + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']", + "operation" : "deleted" } ] - }, - "event-time":"2020-10-14T11:20:33.271836+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-update.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-update.json index 209bbb7873..7e25fe7082 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-update.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-list-update.json @@ -1,22 +1,22 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ - "data-change-event":[ + "ietf-restconf:notification" : { + "event-time":"2020-10-14T11:19:34.549843+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']", - "data":{ - "instance-identifier-patch-module:my-list1":[ + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']", + "operation" : "updated", + "data" : { + "instance-identifier-patch-module:my-list1" : [ { - "name":"Althea", - "my-leaf11":"Jed", - "my-leaf12":"Bertha" + "name" : "Althea", + "my-leaf11" : "Jed", + "my-leaf12" : "Bertha" } ] - }, - "operation":"updated" + } } ] - }, - "event-time":"2020-10-14T11:19:34.549843+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-create.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-create.json index 5ba5012223..86cb665e12 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-create.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-create.json @@ -1,6 +1,6 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-delete.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-delete.json index bcf15972a5..31da58c7f9 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-delete.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-delete.json @@ -1,6 +1,6 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-update.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-update.json index 703b978f9b..7ceec0a288 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-update.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-cont-update.json @@ -1,6 +1,6 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ + "ietf-restconf:notification":{ + "sal-remote:data-changed-notification":{ "data-change-event":[ { "path":"/instance-identifier-patch-module:patch-cont", diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-create.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-create.json index 56f32e79eb..f54a9fae32 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-create.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-create.json @@ -1,13 +1,13 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ - "data-change-event":[ + "ietf-restconf:notification" : { + "event-time":"2020-10-14T12:34:59.085525+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']", - "operation":"created" + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']", + "operation" : "created" } ] - }, - "event-time":"2020-10-14T12:34:59.085525+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-delete.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-delete.json index 089eebbf12..20a31dbe27 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-delete.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-delete.json @@ -1,13 +1,13 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ - "data-change-event":[ + "ietf-restconf:notification" : { + "event-time":"2020-10-14T12:34:59.085525+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']", - "operation":"deleted" + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']", + "operation" : "deleted" } ] - }, - "event-time":"2020-10-14T12:34:59.085525+02:00" + } } } diff --git a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-update.json b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-update.json index 0e051bba91..9cab46dd39 100644 --- a/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-update.json +++ b/restconf/restconf-nb/src/test/resources/listener-adapter-test/notif-without-data-list-update.json @@ -1,13 +1,13 @@ { - "urn-ietf-params-xml-ns-netconf-notification-1.0:notification":{ - "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification":{ - "data-change-event":[ + "ietf-restconf:notification" : { + "event-time":"2020-10-14T12:34:59.085525+02:00", + "sal-remote:data-changed-notification" : { + "data-change-event" : [ { - "path":"/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']", - "operation":"updated" + "path" : "/instance-identifier-patch-module:patch-cont/my-list1[name='Althea']", + "operation" : "updated" } ] - }, - "event-time":"2020-10-14T12:34:59.085525+02:00" + } } } -- 2.36.6