Bump MRI upstreams
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / impl / RestconfDataServiceImpl.java
index 5b12419e517580c033aced06f96d2cd295be0d57..f22e12e4c49c663eb59583c437a9e438591802ee 100644 (file)
@@ -136,7 +136,7 @@ public class RestconfDataServiceImpl implements RestconfDataService {
 
         final DOMMountPoint mountPoint = instanceIdentifier.getMountPoint();
         final RestconfStrategy strategy = getRestconfStrategy(mountPoint);
-        final NormalizedNode<?, ?> node;
+        final NormalizedNode node;
         if (parameters.getFieldPaths() != null && !parameters.getFieldPaths().isEmpty()) {
             node = ReadDataTransactionUtil.readData(parameters.getContent(), instanceIdentifier.getInstanceIdentifier(),
                     strategy, parameters.getWithDefault(), schemaContextRef, parameters.getFieldPaths());
@@ -146,7 +146,7 @@ public class RestconfDataServiceImpl implements RestconfDataService {
         }
         if (identifier != null && identifier.contains(STREAM_PATH) && identifier.contains(STREAM_ACCESS_PATH_PART)
                 && identifier.contains(STREAM_LOCATION_PATH_PART)) {
-            final String value = (String) node.getValue();
+            final String value = (String) node.body();
             final String streamName = value.substring(value.indexOf(NOTIFICATION_STREAM + '/'));
             this.delegRestconfSubscrService.subscribeToStream(streamName, uriInfo);
         }
@@ -159,7 +159,7 @@ public class RestconfDataServiceImpl implements RestconfDataService {
 
         if (parameters.getContent().equals(RestconfDataServiceConstant.ReadData.ALL)
                     || parameters.getContent().equals(RestconfDataServiceConstant.ReadData.CONFIG)) {
-            final QName type = node.getNodeType();
+            final QName type = node.getIdentifier().getNodeType();
             return Response.status(200)
                     .entity(new NormalizedNodeContext(instanceIdentifier, node, parameters))
                     .header("ETag", '"' + type.getModule().getRevision().map(Revision::toString).orElse(null)
@@ -183,7 +183,7 @@ public class RestconfDataServiceImpl implements RestconfDataService {
      * @param uriInfo       uri info
      * @return {@link NormalizedNode}
      */
-    private NormalizedNode<?, ?> readData(final String identifier, final String content,
+    private NormalizedNode readData(final String identifier, final String content,
             final YangInstanceIdentifier path, final RestconfStrategy strategy, final String withDefa,
             final EffectiveModelContext schemaContext, final UriInfo uriInfo) {
         if (identifier != null && identifier.contains(STREAMS_PATH) && !identifier.contains(STREAM_PATH_PART)) {
@@ -389,9 +389,10 @@ public class RestconfDataServiceImpl implements RestconfDataService {
         final Absolute schemaPath = Absolute.of(ImmutableList.copyOf(context.getSchemaNode().getPath()
             .getPathFromRoot()));
         final YangInstanceIdentifier yangIIdContext = context.getInstanceIdentifier();
-        final NormalizedNode<?, ?> data = payload.getData();
+        final NormalizedNode data = payload.getData();
 
-        if (yangIIdContext.isEmpty() && !RestconfDataServiceConstant.NETCONF_BASE_QNAME.equals(data.getNodeType())) {
+        if (yangIIdContext.isEmpty()
+            && !RestconfDataServiceConstant.NETCONF_BASE_QNAME.equals(data.getIdentifier().getNodeType())) {
             throw new RestconfDocumentedException("Instance identifier need to contain at least one path argument",
                 ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE);
         }
@@ -419,7 +420,7 @@ public class RestconfDataServiceImpl implements RestconfDataService {
             }
         }
 
-        if (resultData != null && resultData.getValue().isEmpty()) {
+        if (resultData != null && resultData.isEmpty()) {
             throw new WebApplicationException(Response.Status.NO_CONTENT);
         }