From 769622040a1fa819d2708c50d4904ac24b867a38 Mon Sep 17 00:00:00 2001 From: janani b Date: Mon, 8 Oct 2018 14:17:51 +0530 Subject: Resolving root level augment nodes Issue fix for root level augment nodes being added to the data format Issue-ID: CCSDK-324 Change-Id: I1c69f97739c6cb56c74b5f22bc4283f2f927719b Signed-off-by: janani b --- .../pnserializer/DefaultPropertiesNodeWalker.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'restconf-client/provider/src/main/java') diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/DefaultPropertiesNodeWalker.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/DefaultPropertiesNodeWalker.java index 8497805c..f2345265 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/DefaultPropertiesNodeWalker.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/DefaultPropertiesNodeWalker.java @@ -22,6 +22,7 @@ package org.onap.ccsdk.sli.plugins.yangserializers.pnserializer; import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import java.util.Collection; import java.util.Map; /** @@ -58,6 +59,32 @@ public class DefaultPropertiesNodeWalker implements Propert listener.exitPropertiesNode(node); } } + if (propertiesNode instanceof RootNode) { + processAugments(propertiesNode, listener); + } + } + + /** + * Processes the augments present in the root node. + * + * @param node root node + * @param listener properties node listener + * @throws SvcLogicException when augment node walking fails + */ + private void processAugments(PropertiesNode node, + PropertiesNodeListener listener) + throws SvcLogicException { + for (Map.Entry> + augToChild : node.augmentations().asMap().entrySet()) { + Collection child = augToChild.getValue(); + if (!child.isEmpty()) { + for (PropertiesNode p : child) { + listener.enterPropertiesNode(p); + walkChildNode(listener, p); + listener.exitPropertiesNode(p); + } + } + } } /** -- cgit 1.2.3-korg