diff options
author | janani b <janani.b@huawei.com> | 2018-10-08 14:17:51 +0530 |
---|---|---|
committer | Janani B <janani.b@huawei.com> | 2018-10-08 09:14:37 +0000 |
commit | 769622040a1fa819d2708c50d4904ac24b867a38 (patch) | |
tree | 7c92010c37da84613565b0549cbe737b1ff0244d /restconf-client/provider/src/main | |
parent | 87850a15d93c7a1162d30c129e0dc76cd1b66f94 (diff) |
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 <janani.b@huawei.com>
Diffstat (limited to 'restconf-client/provider/src/main')
-rw-r--r-- | restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/DefaultPropertiesNodeWalker.java | 27 |
1 files changed, 27 insertions, 0 deletions
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 8497805c2..f23452653 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<T extends NodeChild> 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<Object, Collection<PropertiesNode>> + augToChild : node.augmentations().asMap().entrySet()) { + Collection<PropertiesNode> child = augToChild.getValue(); + if (!child.isEmpty()) { + for (PropertiesNode p : child) { + listener.enterPropertiesNode(p); + walkChildNode(listener, p); + listener.exitPropertiesNode(p); + } + } + } } /** |