Bump MRI upstreams
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / restconf / impl / BrokerFacade.java
index f67167ff5e910b66299e1dd63fa31ea1a79f1f2f..9ba30e5da870fff871ace01af66294789d3dc834 100644 (file)
@@ -76,13 +76,14 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.OrderedLeafSetNode;
-import org.opendaylight.yangtools.yang.data.api.schema.OrderedMapNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
+import org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode;
+import org.opendaylight.yangtools.yang.data.api.schema.UserLeafSetNode;
+import org.opendaylight.yangtools.yang.data.api.schema.UserMapNode;
+import org.opendaylight.yangtools.yang.data.api.schema.builder.CollectionNodeBuilder;
+import org.opendaylight.yangtools.yang.data.api.schema.builder.DataContainerNodeBuilder;
+import org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.SchemaAwareBuilders;
 import org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode;
 import org.opendaylight.yangtools.yang.data.util.DataSchemaContextTree;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
@@ -142,7 +143,7 @@ public class BrokerFacade implements Closeable {
      *            path of data
      * @return read date
      */
-    public NormalizedNode<?, ?> readConfigurationData(final YangInstanceIdentifier path) {
+    public NormalizedNode readConfigurationData(final YangInstanceIdentifier path) {
         return readConfigurationData(path, null);
     }
 
@@ -155,7 +156,7 @@ public class BrokerFacade implements Closeable {
      *            value of with-defaults parameter
      * @return read date
      */
-    public NormalizedNode<?, ?> readConfigurationData(final YangInstanceIdentifier path, final String withDefa) {
+    public NormalizedNode readConfigurationData(final YangInstanceIdentifier path, final String withDefa) {
         try (DOMDataTreeReadTransaction tx = this.domDataBroker.newReadOnlyTransaction()) {
             return readDataViaTransaction(tx, CONFIGURATION, path, withDefa);
         }
@@ -170,8 +171,7 @@ public class BrokerFacade implements Closeable {
      *            path of data
      * @return read data
      */
-    public NormalizedNode<?, ?> readConfigurationData(final DOMMountPoint mountPoint,
-            final YangInstanceIdentifier path) {
+    public NormalizedNode readConfigurationData(final DOMMountPoint mountPoint, final YangInstanceIdentifier path) {
         return readConfigurationData(mountPoint, path, null);
     }
 
@@ -186,7 +186,7 @@ public class BrokerFacade implements Closeable {
      *            value of with-defaults parameter
      * @return read data
      */
-    public NormalizedNode<?, ?> readConfigurationData(final DOMMountPoint mountPoint, final YangInstanceIdentifier path,
+    public NormalizedNode readConfigurationData(final DOMMountPoint mountPoint, final YangInstanceIdentifier path,
             final String withDefa) {
         final Optional<DOMDataBroker> domDataBrokerService = mountPoint.getService(DOMDataBroker.class);
         if (domDataBrokerService.isPresent()) {
@@ -204,7 +204,7 @@ public class BrokerFacade implements Closeable {
      *            path of data
      * @return read data
      */
-    public NormalizedNode<?, ?> readOperationalData(final YangInstanceIdentifier path) {
+    public NormalizedNode readOperationalData(final YangInstanceIdentifier path) {
         try (DOMDataTreeReadTransaction tx = this.domDataBroker.newReadOnlyTransaction()) {
             return readDataViaTransaction(tx, OPERATIONAL, path);
         }
@@ -219,7 +219,7 @@ public class BrokerFacade implements Closeable {
      *            path of data
      * @return read data
      */
-    public NormalizedNode<?, ?> readOperationalData(final DOMMountPoint mountPoint, final YangInstanceIdentifier path) {
+    public NormalizedNode readOperationalData(final DOMMountPoint mountPoint, final YangInstanceIdentifier path) {
         final Optional<DOMDataBroker> domDataBrokerService = mountPoint.getService(DOMDataBroker.class);
         if (domDataBrokerService.isPresent()) {
             try (DOMDataTreeReadTransaction tx = domDataBrokerService.get().newReadOnlyTransaction()) {
@@ -248,9 +248,8 @@ public class BrokerFacade implements Closeable {
      *            insert
      * @return wrapper of status and future of PUT
      */
-    public PutResult commitConfigurationDataPut(
-            final EffectiveModelContext globalSchema, final YangInstanceIdentifier path,
-            final NormalizedNode<?, ?> payload, final String insert, final String point) {
+    public PutResult commitConfigurationDataPut(final EffectiveModelContext globalSchema,
+            final YangInstanceIdentifier path, final NormalizedNode payload, final String insert, final String point) {
         requireNonNull(globalSchema);
         requireNonNull(path);
         requireNonNull(payload);
@@ -285,9 +284,8 @@ public class BrokerFacade implements Closeable {
      *            insert
      * @return wrapper of status and future of PUT
      */
-    public PutResult commitMountPointDataPut(
-            final DOMMountPoint mountPoint, final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
-            final String insert, final String point) {
+    public PutResult commitMountPointDataPut(final DOMMountPoint mountPoint, final YangInstanceIdentifier path,
+            final NormalizedNode payload, final String insert, final String point) {
         requireNonNull(mountPoint);
         requireNonNull(path);
         requireNonNull(payload);
@@ -467,7 +465,7 @@ public class BrokerFacade implements Closeable {
     // POST configuration
     public FluentFuture<? extends CommitInfo> commitConfigurationDataPost(
             final EffectiveModelContext globalSchema, final YangInstanceIdentifier path,
-            final NormalizedNode<?, ?> payload, final String insert, final String point) {
+            final NormalizedNode payload, final String insert, final String point) {
         isMounted.set(false);
         FluentFuture<? extends CommitInfo> future =
                 postDataViaTransaction(this.domDataBroker.newReadWriteTransaction(), CONFIGURATION, path, payload,
@@ -477,7 +475,7 @@ public class BrokerFacade implements Closeable {
     }
 
     public FluentFuture<? extends CommitInfo> commitConfigurationDataPost(
-            final DOMMountPoint mountPoint, final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final DOMMountPoint mountPoint, final YangInstanceIdentifier path, final NormalizedNode payload,
             final String insert, final String point) {
         isMounted.set(true);
         final Optional<DOMDataBroker> domDataBrokerService = mountPoint.getService(DOMDataBroker.class);
@@ -508,7 +506,7 @@ public class BrokerFacade implements Closeable {
 
     // RPC
     public ListenableFuture<? extends DOMRpcResult> invokeRpc(final @NonNull QName type,
-            final @NonNull NormalizedNode<?, ?> input) {
+            final @NonNull NormalizedNode input) {
         if (this.rpcService == null) {
             throw new RestconfDocumentedException(Status.SERVICE_UNAVAILABLE);
         }
@@ -535,17 +533,17 @@ public class BrokerFacade implements Closeable {
         listener.setRegistration(registration);
     }
 
-    private NormalizedNode<?, ?> readDataViaTransaction(final DOMDataTreeReadOperations transaction,
+    private NormalizedNode readDataViaTransaction(final DOMDataTreeReadOperations transaction,
             final LogicalDatastoreType datastore, final YangInstanceIdentifier path) {
         return readDataViaTransaction(transaction, datastore, path, null);
     }
 
-    private NormalizedNode<?, ?> readDataViaTransaction(final DOMDataTreeReadOperations transaction,
+    private NormalizedNode readDataViaTransaction(final DOMDataTreeReadOperations transaction,
             final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final String withDefa) {
         LOG.trace("Read {} via Restconf: {}", datastore.name(), path);
 
         try {
-            final Optional<NormalizedNode<?, ?>> optional = transaction.read(datastore, path).get();
+            final Optional<NormalizedNode> optional = transaction.read(datastore, path).get();
             return optional.map(normalizedNode -> withDefa == null ? normalizedNode :
                 prepareDataByParamWithDef(normalizedNode, path, withDefa)).orElse(null);
         } catch (InterruptedException e) {
@@ -558,7 +556,7 @@ public class BrokerFacade implements Closeable {
         }
     }
 
-    private NormalizedNode<?, ?> prepareDataByParamWithDef(final NormalizedNode<?, ?> result,
+    private NormalizedNode prepareDataByParamWithDef(final NormalizedNode result,
             final YangInstanceIdentifier path, final String withDefa) {
         boolean trim;
         switch (withDefa) {
@@ -577,13 +575,13 @@ public class BrokerFacade implements Closeable {
         final DataSchemaNode baseSchemaNode = baseSchemaCtxTree.findChild(path).orElseThrow().getDataSchemaNode();
         if (result instanceof ContainerNode) {
             final DataContainerNodeBuilder<NodeIdentifier, ContainerNode> builder =
-                    Builders.containerBuilder((ContainerSchemaNode) baseSchemaNode);
+                SchemaAwareBuilders.containerBuilder((ContainerSchemaNode) baseSchemaNode);
             buildCont(builder, (ContainerNode) result, baseSchemaCtxTree, path, trim);
             return builder.build();
         }
 
         final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> builder =
-                Builders.mapEntryBuilder((ListSchemaNode) baseSchemaNode);
+            SchemaAwareBuilders.mapEntryBuilder((ListSchemaNode) baseSchemaNode);
         buildMapEntryBuilder(builder, (MapEntryNode) result, baseSchemaCtxTree, path, trim,
             ((ListSchemaNode) baseSchemaNode).getKeyDefinition());
         return builder.build();
@@ -593,37 +591,37 @@ public class BrokerFacade implements Closeable {
             final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> builder,
             final MapEntryNode result, final DataSchemaContextTree baseSchemaCtxTree,
             final YangInstanceIdentifier actualPath, final boolean trim, final List<QName> keys) {
-        for (final DataContainerChild<? extends PathArgument, ?> child : result.getValue()) {
+        for (final DataContainerChild child : result.body()) {
             final YangInstanceIdentifier path = actualPath.node(child.getIdentifier());
             final DataSchemaNode childSchema = baseSchemaCtxTree.findChild(path).orElseThrow().getDataSchemaNode();
             if (child instanceof ContainerNode) {
                 final DataContainerNodeBuilder<NodeIdentifier, ContainerNode> childBuilder =
-                        Builders.containerBuilder((ContainerSchemaNode) childSchema);
+                        SchemaAwareBuilders.containerBuilder((ContainerSchemaNode) childSchema);
                 buildCont(childBuilder, (ContainerNode) child, baseSchemaCtxTree, path, trim);
                 builder.withChild(childBuilder.build());
             } else if (child instanceof MapNode) {
-                final CollectionNodeBuilder<MapEntryNode, MapNode> childBuilder =
-                        Builders.mapBuilder((ListSchemaNode) childSchema);
+                final CollectionNodeBuilder<MapEntryNode, SystemMapNode> childBuilder =
+                        SchemaAwareBuilders.mapBuilder((ListSchemaNode) childSchema);
                 buildList(childBuilder, (MapNode) child, baseSchemaCtxTree, path, trim,
                         ((ListSchemaNode) childSchema).getKeyDefinition());
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = child.getValue();
+                final Object nodeVal = child.body();
                 final NormalizedNodeBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
-                        Builders.leafBuilder((LeafSchemaNode) childSchema);
-                if (keys.contains(child.getNodeType())) {
-                    leafBuilder.withValue(child.getValue());
+                        SchemaAwareBuilders.leafBuilder((LeafSchemaNode) childSchema);
+                if (keys.contains(child.getIdentifier().getNodeType())) {
+                    leafBuilder.withValue(child.body());
                     builder.withChild(leafBuilder.build());
                 } else {
                     if (trim) {
                         if (defaultVal == null || !defaultVal.equals(nodeVal)) {
-                            leafBuilder.withValue(child.getValue());
+                            leafBuilder.withValue(child.body());
                             builder.withChild(leafBuilder.build());
                         }
                     } else {
                         if (defaultVal != null && defaultVal.equals(nodeVal)) {
-                            leafBuilder.withValue(child.getValue());
+                            leafBuilder.withValue(child.body());
                             builder.withChild(leafBuilder.build());
                         }
                     }
@@ -632,15 +630,15 @@ public class BrokerFacade implements Closeable {
         }
     }
 
-    private void buildList(final CollectionNodeBuilder<MapEntryNode, MapNode> builder, final MapNode result,
+    private void buildList(final CollectionNodeBuilder<MapEntryNode, SystemMapNode> builder, final MapNode result,
             final DataSchemaContextTree baseSchemaCtxTree, final YangInstanceIdentifier path, final boolean trim,
             final List<QName> keys) {
-        for (final MapEntryNode mapEntryNode : result.getValue()) {
+        for (final MapEntryNode mapEntryNode : result.body()) {
             final YangInstanceIdentifier actualNode = path.node(mapEntryNode.getIdentifier());
             final DataSchemaNode childSchema = baseSchemaCtxTree.findChild(actualNode).orElseThrow()
                     .getDataSchemaNode();
             final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> mapEntryBuilder =
-                    Builders.mapEntryBuilder((ListSchemaNode) childSchema);
+                    SchemaAwareBuilders.mapEntryBuilder((ListSchemaNode) childSchema);
             buildMapEntryBuilder(mapEntryBuilder, mapEntryNode, baseSchemaCtxTree, actualNode, trim, keys);
             builder.withChild(mapEntryBuilder.build());
         }
@@ -649,33 +647,33 @@ public class BrokerFacade implements Closeable {
     private void buildCont(final DataContainerNodeBuilder<NodeIdentifier, ContainerNode> builder,
             final ContainerNode result, final DataSchemaContextTree baseSchemaCtxTree,
             final YangInstanceIdentifier actualPath, final boolean trim) {
-        for (final DataContainerChild<? extends PathArgument, ?> child : result.getValue()) {
+        for (final DataContainerChild child : result.body()) {
             final YangInstanceIdentifier path = actualPath.node(child.getIdentifier());
             final DataSchemaNode childSchema = baseSchemaCtxTree.findChild(path).orElseThrow().getDataSchemaNode();
             if (child instanceof ContainerNode) {
                 final DataContainerNodeBuilder<NodeIdentifier, ContainerNode> builderChild =
-                        Builders.containerBuilder((ContainerSchemaNode) childSchema);
+                        SchemaAwareBuilders.containerBuilder((ContainerSchemaNode) childSchema);
                 buildCont(builderChild, result, baseSchemaCtxTree, actualPath, trim);
                 builder.withChild(builderChild.build());
             } else if (child instanceof MapNode) {
-                final CollectionNodeBuilder<MapEntryNode, MapNode> childBuilder =
-                        Builders.mapBuilder((ListSchemaNode) childSchema);
+                final CollectionNodeBuilder<MapEntryNode, SystemMapNode> childBuilder =
+                        SchemaAwareBuilders.mapBuilder((ListSchemaNode) childSchema);
                 buildList(childBuilder, (MapNode) child, baseSchemaCtxTree, path, trim,
                         ((ListSchemaNode) childSchema).getKeyDefinition());
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = child.getValue();
+                final Object nodeVal = child.body();
                 final NormalizedNodeBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
-                        Builders.leafBuilder((LeafSchemaNode) childSchema);
+                        SchemaAwareBuilders.leafBuilder((LeafSchemaNode) childSchema);
                 if (trim) {
                     if (defaultVal == null || !defaultVal.equals(nodeVal)) {
-                        leafBuilder.withValue(child.getValue());
+                        leafBuilder.withValue(child.body());
                         builder.withChild(leafBuilder.build());
                     }
                 } else {
                     if (defaultVal != null && defaultVal.equals(nodeVal)) {
-                        leafBuilder.withValue(child.getValue());
+                        leafBuilder.withValue(child.body());
                         builder.withChild(leafBuilder.build());
                     }
                 }
@@ -688,7 +686,7 @@ public class BrokerFacade implements Closeable {
      */
     private FluentFuture<? extends CommitInfo> postDataViaTransaction(
             final DOMDataTreeReadWriteTransaction rwTransaction, final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final YangInstanceIdentifier path, final NormalizedNode payload,
             final EffectiveModelContext schemaContext, final String insert, final String point) {
         LOG.trace("POST {} via Restconf: {} with payload {}", datastore.name(), path, payload);
         postData(rwTransaction, datastore, path, payload, schemaContext, insert, point);
@@ -700,14 +698,14 @@ public class BrokerFacade implements Closeable {
      */
     private void postDataWithinTransaction(
             final DOMDataTreeReadWriteTransaction rwTransaction, final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final YangInstanceIdentifier path, final NormalizedNode payload,
             final EffectiveModelContext schemaContext) {
         LOG.trace("POST {} within Restconf Patch: {} with payload {}", datastore.name(), path, payload);
         postData(rwTransaction, datastore, path, payload, schemaContext, null, null);
     }
 
     private void postData(final DOMDataTreeReadWriteTransaction rwTransaction, final LogicalDatastoreType datastore,
-                          final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+                          final YangInstanceIdentifier path, final NormalizedNode payload,
                           final EffectiveModelContext schemaContext, final String insert, final String point) {
         if (insert == null) {
             makeNormalPost(rwTransaction, datastore, path, payload, schemaContext);
@@ -719,9 +717,9 @@ public class BrokerFacade implements Closeable {
         switch (insert) {
             case "first":
                 if (schemaNode instanceof ListSchemaNode) {
-                    final OrderedMapNode readList =
-                            (OrderedMapNode) this.readConfigurationData(path.getParent().getParent());
-                    if (readList == null || readList.getValue().isEmpty()) {
+                    final UserMapNode readList =
+                            (UserMapNode) this.readConfigurationData(path.getParent().getParent());
+                    if (readList == null || readList.isEmpty()) {
                         simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
                     } else {
                         rwTransaction.delete(datastore, path.getParent().getParent());
@@ -730,9 +728,9 @@ public class BrokerFacade implements Closeable {
                             schemaContext);
                     }
                 } else {
-                    final OrderedLeafSetNode<?> readLeafList =
-                            (OrderedLeafSetNode<?>) readConfigurationData(path.getParent());
-                    if (readLeafList == null || readLeafList.getValue().isEmpty()) {
+                    final UserLeafSetNode<?> readLeafList =
+                            (UserLeafSetNode<?>) readConfigurationData(path.getParent());
+                    if (readLeafList == null || readLeafList.isEmpty()) {
                         simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
                     } else {
                         rwTransaction.delete(datastore, path.getParent());
@@ -747,9 +745,9 @@ public class BrokerFacade implements Closeable {
                 break;
             case "before":
                 if (schemaNode instanceof ListSchemaNode) {
-                    final OrderedMapNode readList =
-                            (OrderedMapNode) this.readConfigurationData(path.getParent().getParent());
-                    if (readList == null || readList.getValue().isEmpty()) {
+                    final UserMapNode readList =
+                            (UserMapNode) this.readConfigurationData(path.getParent().getParent());
+                    if (readList == null || readList.isEmpty()) {
                         simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
                     } else {
                         insertWithPointListPost(rwTransaction, datastore, path, payload, schemaContext, point,
@@ -757,9 +755,9 @@ public class BrokerFacade implements Closeable {
                             true);
                     }
                 } else {
-                    final OrderedLeafSetNode<?> readLeafList =
-                            (OrderedLeafSetNode<?>) readConfigurationData(path.getParent());
-                    if (readLeafList == null || readLeafList.getValue().isEmpty()) {
+                    final UserLeafSetNode<?> readLeafList =
+                            (UserLeafSetNode<?>) readConfigurationData(path.getParent());
+                    if (readLeafList == null || readLeafList.isEmpty()) {
                         simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
                     } else {
                         insertWithPointLeafListPost(rwTransaction, datastore, path, payload, schemaContext, point,
@@ -769,9 +767,9 @@ public class BrokerFacade implements Closeable {
                 break;
             case "after":
                 if (schemaNode instanceof ListSchemaNode) {
-                    final OrderedMapNode readList =
-                            (OrderedMapNode) this.readConfigurationData(path.getParent().getParent());
-                    if (readList == null || readList.getValue().isEmpty()) {
+                    final UserMapNode readList =
+                            (UserMapNode) this.readConfigurationData(path.getParent().getParent());
+                    if (readList == null || readList.isEmpty()) {
                         simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
                     } else {
                         insertWithPointListPost(rwTransaction, datastore, path, payload, schemaContext, point,
@@ -779,9 +777,9 @@ public class BrokerFacade implements Closeable {
                             false);
                     }
                 } else {
-                    final OrderedLeafSetNode<?> readLeafList =
-                            (OrderedLeafSetNode<?>) readConfigurationData(path.getParent());
-                    if (readLeafList == null || readLeafList.getValue().isEmpty()) {
+                    final UserLeafSetNode<?> readLeafList =
+                            (UserLeafSetNode<?>) readConfigurationData(path.getParent());
+                    if (readLeafList == null || readLeafList.isEmpty()) {
                         simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
                     } else {
                         insertWithPointLeafListPost(rwTransaction, datastore, path, payload, schemaContext, point,
@@ -797,13 +795,13 @@ public class BrokerFacade implements Closeable {
     }
 
     private void insertWithPointLeafListPost(final DOMDataTreeReadWriteTransaction rwTransaction,
-            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
-            final SchemaContext schemaContext, final String point, final OrderedLeafSetNode<?> readLeafList,
+            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode payload,
+            final SchemaContext schemaContext, final String point, final UserLeafSetNode<?> readLeafList,
             final boolean before) {
         rwTransaction.delete(datastore, path.getParent().getParent());
         final InstanceIdentifierContext<?> instanceIdentifier = controllerContext.toInstanceIdentifier(point);
         int lastItemPosition = 0;
-        for (final LeafSetEntryNode<?> nodeChild : readLeafList.getValue()) {
+        for (final LeafSetEntryNode<?> nodeChild : readLeafList.body()) {
             if (nodeChild.getIdentifier().equals(instanceIdentifier.getInstanceIdentifier().getLastPathArgument())) {
                 break;
             }
@@ -813,10 +811,9 @@ public class BrokerFacade implements Closeable {
             lastItemPosition++;
         }
         int lastInsertedPosition = 0;
-        final NormalizedNode<?, ?> emptySubtree =
-                ImmutableNodes.fromInstanceId(schemaContext, path.getParent().getParent());
+        final NormalizedNode emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path.getParent().getParent());
         rwTransaction.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
-        for (final LeafSetEntryNode<?> nodeChild : readLeafList.getValue()) {
+        for (final LeafSetEntryNode<?> nodeChild : readLeafList.body()) {
             if (lastInsertedPosition == lastItemPosition) {
                 checkItemDoesNotExists(rwTransaction, datastore, path);
                 simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
@@ -830,12 +827,12 @@ public class BrokerFacade implements Closeable {
 
     private void insertWithPointListPost(final DOMDataTreeReadWriteTransaction rwTransaction,
             final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload, final SchemaContext schemaContext,
+            final YangInstanceIdentifier path, final NormalizedNode payload, final SchemaContext schemaContext,
             final String point, final MapNode readList, final boolean before) {
         rwTransaction.delete(datastore, path.getParent().getParent());
         final InstanceIdentifierContext<?> instanceIdentifier = controllerContext.toInstanceIdentifier(point);
         int lastItemPosition = 0;
-        for (final MapEntryNode mapEntryNode : readList.getValue()) {
+        for (final MapEntryNode mapEntryNode : readList.body()) {
             if (mapEntryNode.getIdentifier()
                     .equals(instanceIdentifier.getInstanceIdentifier().getLastPathArgument())) {
                 break;
@@ -846,10 +843,9 @@ public class BrokerFacade implements Closeable {
             lastItemPosition++;
         }
         int lastInsertedPosition = 0;
-        final NormalizedNode<?, ?> emptySubtree =
-                ImmutableNodes.fromInstanceId(schemaContext, path.getParent().getParent());
+        final NormalizedNode emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path.getParent().getParent());
         rwTransaction.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
-        for (final MapEntryNode mapEntryNode : readList.getValue()) {
+        for (final MapEntryNode mapEntryNode : readList.body()) {
             if (lastInsertedPosition == lastItemPosition) {
                 checkItemDoesNotExists(rwTransaction, datastore, path);
                 simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
@@ -884,19 +880,19 @@ public class BrokerFacade implements Closeable {
     }
 
     private void makeNormalPost(final DOMDataTreeReadWriteTransaction rwTransaction,
-            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode payload,
             final SchemaContext schemaContext) {
-        final Collection<? extends NormalizedNode<?, ?>> children;
+        final Collection<? extends NormalizedNode> children;
         if (payload instanceof MapNode) {
-            children = ((MapNode) payload).getValue();
+            children = ((MapNode) payload).body();
         } else if (payload instanceof LeafSetNode) {
-            children = ((LeafSetNode<?>) payload).getValue();
+            children = ((LeafSetNode<?>) payload).body();
         } else {
             simplePostPut(rwTransaction, datastore, path, payload, schemaContext);
             return;
         }
 
-        final NormalizedNode<?, ?> emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path);
+        final NormalizedNode emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path);
         if (children.isEmpty()) {
             if (isMounted != null && !isMounted.get()) {
 
@@ -917,7 +913,7 @@ public class BrokerFacade implements Closeable {
             rwTransaction.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
             ensureParentsByMerge(datastore, path, rwTransaction, schemaContext);
         }
-        for (final NormalizedNode<?, ?> child : children) {
+        for (final NormalizedNode child : children) {
             // FIXME: we really want a create(YangInstanceIdentifier, NormalizedNode) method in the transaction,
             //        as that would allow us to skip the existence checks
             rwTransaction.put(datastore, path.node(child.getIdentifier()), child);
@@ -946,7 +942,7 @@ public class BrokerFacade implements Closeable {
     }
 
     private void simplePostPut(final DOMDataTreeReadWriteTransaction rwTransaction,
-            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode payload,
             final SchemaContext schemaContext) {
         checkItemDoesNotExists(rwTransaction, datastore, path);
         if (isMounted != null && !isMounted.get()) {
@@ -1011,7 +1007,7 @@ public class BrokerFacade implements Closeable {
      */
     private FluentFuture<? extends CommitInfo> putDataViaTransaction(
             final DOMDataTreeReadWriteTransaction readWriteTransaction, final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final YangInstanceIdentifier path, final NormalizedNode payload,
             final EffectiveModelContext schemaContext, final String insert, final String point) {
         LOG.trace("Put {} via Restconf: {} with payload {}", datastore.name(), path, payload);
         putData(readWriteTransaction, datastore, path, payload, schemaContext, insert, point);
@@ -1023,7 +1019,7 @@ public class BrokerFacade implements Closeable {
      */
     private void putDataWithinTransaction(
             final DOMDataTreeReadWriteTransaction writeTransaction, final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final YangInstanceIdentifier path, final NormalizedNode payload,
             final EffectiveModelContext schemaContext) {
         LOG.trace("Put {} within Restconf Patch: {} with payload {}", datastore.name(), path, payload);
         putData(writeTransaction, datastore, path, payload, schemaContext, null, null);
@@ -1031,7 +1027,7 @@ public class BrokerFacade implements Closeable {
 
     // FIXME: This is doing correct put for container and list children, not sure if this will work for choice case
     private void putData(final DOMDataTreeReadWriteTransaction rwTransaction, final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final YangInstanceIdentifier path, final NormalizedNode payload,
             final EffectiveModelContext schemaContext, final String insert, final String point) {
         if (insert == null) {
             makePut(rwTransaction, datastore, path, payload, schemaContext);
@@ -1043,9 +1039,8 @@ public class BrokerFacade implements Closeable {
         switch (insert) {
             case "first":
                 if (schemaNode instanceof ListSchemaNode) {
-                    final OrderedMapNode readList =
-                            (OrderedMapNode) this.readConfigurationData(path.getParent());
-                    if (readList == null || readList.getValue().isEmpty()) {
+                    final UserMapNode readList = (UserMapNode) this.readConfigurationData(path.getParent());
+                    if (readList == null || readList.isEmpty()) {
                         simplePut(datastore, path, rwTransaction, schemaContext, payload);
                     } else {
                         rwTransaction.delete(datastore, path.getParent());
@@ -1053,9 +1048,9 @@ public class BrokerFacade implements Closeable {
                         makePut(rwTransaction, datastore, path.getParent(), readList, schemaContext);
                     }
                 } else {
-                    final OrderedLeafSetNode<?> readLeafList =
-                            (OrderedLeafSetNode<?>) readConfigurationData(path.getParent());
-                    if (readLeafList == null || readLeafList.getValue().isEmpty()) {
+                    final UserLeafSetNode<?> readLeafList =
+                            (UserLeafSetNode<?>) readConfigurationData(path.getParent());
+                    if (readLeafList == null || readLeafList.isEmpty()) {
                         simplePut(datastore, path, rwTransaction, schemaContext, payload);
                     } else {
                         rwTransaction.delete(datastore, path.getParent());
@@ -1070,18 +1065,17 @@ public class BrokerFacade implements Closeable {
                 break;
             case "before":
                 if (schemaNode instanceof ListSchemaNode) {
-                    final OrderedMapNode readList =
-                            (OrderedMapNode) this.readConfigurationData(path.getParent());
-                    if (readList == null || readList.getValue().isEmpty()) {
+                    final UserMapNode readList = (UserMapNode) this.readConfigurationData(path.getParent());
+                    if (readList == null || readList.isEmpty()) {
                         simplePut(datastore, path, rwTransaction, schemaContext, payload);
                     } else {
                         insertWithPointListPut(rwTransaction, datastore, path, payload, schemaContext, point,
                             readList, true);
                     }
                 } else {
-                    final OrderedLeafSetNode<?> readLeafList =
-                            (OrderedLeafSetNode<?>) readConfigurationData(path.getParent());
-                    if (readLeafList == null || readLeafList.getValue().isEmpty()) {
+                    final UserLeafSetNode<?> readLeafList =
+                            (UserLeafSetNode<?>) readConfigurationData(path.getParent());
+                    if (readLeafList == null || readLeafList.isEmpty()) {
                         simplePut(datastore, path, rwTransaction, schemaContext, payload);
                     } else {
                         insertWithPointLeafListPut(rwTransaction, datastore, path, payload, schemaContext, point,
@@ -1091,18 +1085,17 @@ public class BrokerFacade implements Closeable {
                 break;
             case "after":
                 if (schemaNode instanceof ListSchemaNode) {
-                    final OrderedMapNode readList =
-                            (OrderedMapNode) this.readConfigurationData(path.getParent());
-                    if (readList == null || readList.getValue().isEmpty()) {
+                    final UserMapNode readList = (UserMapNode) this.readConfigurationData(path.getParent());
+                    if (readList == null || readList.isEmpty()) {
                         simplePut(datastore, path, rwTransaction, schemaContext, payload);
                     } else {
                         insertWithPointListPut(rwTransaction, datastore, path, payload, schemaContext, point,
                             readList, false);
                     }
                 } else {
-                    final OrderedLeafSetNode<?> readLeafList =
-                            (OrderedLeafSetNode<?>) readConfigurationData(path.getParent());
-                    if (readLeafList == null || readLeafList.getValue().isEmpty()) {
+                    final UserLeafSetNode<?> readLeafList =
+                            (UserLeafSetNode<?>) readConfigurationData(path.getParent());
+                    if (readLeafList == null || readLeafList.isEmpty()) {
                         simplePut(datastore, path, rwTransaction, schemaContext, payload);
                     } else {
                         insertWithPointLeafListPut(rwTransaction, datastore, path, payload, schemaContext, point,
@@ -1118,13 +1111,13 @@ public class BrokerFacade implements Closeable {
     }
 
     private void insertWithPointLeafListPut(final DOMDataTreeWriteTransaction tx,
-            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
-            final SchemaContext schemaContext, final String point, final OrderedLeafSetNode<?> readLeafList,
+            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode payload,
+            final SchemaContext schemaContext, final String point, final UserLeafSetNode<?> readLeafList,
             final boolean before) {
         tx.delete(datastore, path.getParent());
         final InstanceIdentifierContext<?> instanceIdentifier = controllerContext.toInstanceIdentifier(point);
         int index1 = 0;
-        for (final LeafSetEntryNode<?> nodeChild : readLeafList.getValue()) {
+        for (final LeafSetEntryNode<?> nodeChild : readLeafList.body()) {
             if (nodeChild.getIdentifier().equals(instanceIdentifier.getInstanceIdentifier().getLastPathArgument())) {
                 break;
             }
@@ -1134,10 +1127,9 @@ public class BrokerFacade implements Closeable {
             index1++;
         }
         int index2 = 0;
-        final NormalizedNode<?, ?> emptySubtree =
-                ImmutableNodes.fromInstanceId(schemaContext, path.getParent());
+        final NormalizedNode emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path.getParent());
         tx.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
-        for (final LeafSetEntryNode<?> nodeChild : readLeafList.getValue()) {
+        for (final LeafSetEntryNode<?> nodeChild : readLeafList.body()) {
             if (index2 == index1) {
                 simplePut(datastore, path, tx, schemaContext, payload);
             }
@@ -1148,12 +1140,12 @@ public class BrokerFacade implements Closeable {
     }
 
     private void insertWithPointListPut(final DOMDataTreeWriteTransaction tx, final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload, final SchemaContext schemaContext,
-            final String point, final OrderedMapNode readList, final boolean before) {
+            final YangInstanceIdentifier path, final NormalizedNode payload, final SchemaContext schemaContext,
+            final String point, final UserMapNode readList, final boolean before) {
         tx.delete(datastore, path.getParent());
         final InstanceIdentifierContext<?> instanceIdentifier = controllerContext.toInstanceIdentifier(point);
         int index1 = 0;
-        for (final MapEntryNode mapEntryNode : readList.getValue()) {
+        for (final MapEntryNode mapEntryNode : readList.body()) {
             if (mapEntryNode.getIdentifier().equals(instanceIdentifier.getInstanceIdentifier().getLastPathArgument())) {
                 break;
             }
@@ -1163,10 +1155,9 @@ public class BrokerFacade implements Closeable {
             index1++;
         }
         int index2 = 0;
-        final NormalizedNode<?, ?> emptySubtree =
-                ImmutableNodes.fromInstanceId(schemaContext, path.getParent());
+        final NormalizedNode emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path.getParent());
         tx.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
-        for (final MapEntryNode mapEntryNode : readList.getValue()) {
+        for (final MapEntryNode mapEntryNode : readList.body()) {
             if (index2 == index1) {
                 simplePut(datastore, path, tx, schemaContext, payload);
             }
@@ -1177,14 +1168,14 @@ public class BrokerFacade implements Closeable {
     }
 
     private void makePut(final DOMDataTreeWriteTransaction tx, final LogicalDatastoreType datastore,
-            final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload, final SchemaContext schemaContext) {
+            final YangInstanceIdentifier path, final NormalizedNode payload, final SchemaContext schemaContext) {
         if (payload instanceof MapNode) {
-            final NormalizedNode<?, ?> emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path);
+            final NormalizedNode emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path);
             if (isMounted != null && !isMounted.get()) {
                 tx.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
                 ensureParentsByMerge(datastore, path, tx, schemaContext);
             }
-            for (final MapEntryNode child : ((MapNode) payload).getValue()) {
+            for (final MapEntryNode child : ((MapNode) payload).body()) {
                 final YangInstanceIdentifier childPath = path.node(child.getIdentifier());
                 tx.put(datastore, childPath, child);
             }
@@ -1194,8 +1185,7 @@ public class BrokerFacade implements Closeable {
     }
 
     private void simplePut(final LogicalDatastoreType datastore, final YangInstanceIdentifier path,
-            final DOMDataTreeWriteTransaction tx, final SchemaContext schemaContext,
-            final NormalizedNode<?, ?> payload) {
+            final DOMDataTreeWriteTransaction tx, final SchemaContext schemaContext, final NormalizedNode payload) {
         if (isMounted != null && !isMounted.get()) {
             ensureParentsByMerge(datastore, path, tx, schemaContext);
         }
@@ -1218,7 +1208,7 @@ public class BrokerFacade implements Closeable {
     }
 
     private static void mergeDataWithinTransaction(final DOMDataTreeWriteTransaction tx,
-            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode<?, ?> payload,
+            final LogicalDatastoreType datastore, final YangInstanceIdentifier path, final NormalizedNode payload,
             final SchemaContext schemaContext) {
         LOG.trace("Merge {} within Restconf Patch: {} with payload {}", datastore.name(), path, payload);
         ensureParentsByMerge(datastore, path, tx, schemaContext);
@@ -1264,10 +1254,8 @@ public class BrokerFacade implements Closeable {
         }
 
         checkArgument(rootNormalizedPath != null, "Empty path received");
-
-        final NormalizedNode<?, ?> parentStructure = ImmutableNodes.fromInstanceId(schemaContext,
-                YangInstanceIdentifier.create(normalizedPathWithoutChildArgs));
-        tx.merge(store, rootNormalizedPath, parentStructure);
+        tx.merge(store, rootNormalizedPath, ImmutableNodes.fromInstanceId(schemaContext,
+            YangInstanceIdentifier.create(normalizedPathWithoutChildArgs)));
     }
 
     private static RestconfDocumentedException dataBrokerUnavailable(final YangInstanceIdentifier path) {