Fix delete operation for leaf nodes 99/98699/15
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Mon, 13 Dec 2021 19:31:34 +0000 (20:31 +0100)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Thu, 13 Jan 2022 09:24:40 +0000 (10:24 +0100)
commit14323f32667c16d5206e73bfe34eea48d4e2272f
tree02bdbbd6ca27be1e6125cde110093b8ed3289fa5
parent91ef75da940c025390675ed35e239a5914fdf31f
Fix delete operation for leaf nodes

In case of delete operation we do not have
NormalizedNode representing data.

To create NormalizedNode we cannot use
ImmutableNodes.fromInstanceId() because it violates
leaf node non-null value contract.

Instead we have to emit data to delete using
EmptyListXmlWriter the similar way as its
done with filters.

Similar way we have to emit data together
with metadata using EmptyListXmlMetadatWriter
to overcome NormalizedMetadataWriter' write
method which requires data in the form of NormalizedNode.

JIRA: NETCONF-833
Change-Id: I2dc2921a78e7fc41d1d5eda101978c3a2e36ec12
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/EmptyListXmlMetadataWriter.java [new file with mode: 0644]
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/NetconfUtil.java
netconf/netconf-util/src/test/resources/netconfMessages/edit-config-delete-container-node-candidate.xml [new file with mode: 0644]
netconf/netconf-util/src/test/resources/netconfMessages/edit-config-delete-leaf-node-candidate.xml [new file with mode: 0644]
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfBaseOpsTest.java