X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb-rfc8040%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2Frests%2Fservices%2Fimpl%2FRestconfDataServiceImpl.java;h=f22e12e4c49c663eb59583c437a9e438591802ee;hb=4f8fe6ca68115fecdb9ce43573af5a2e26c50b50;hp=5b12419e517580c033aced06f96d2cd295be0d57;hpb=69b321b4b4180b4f7f03f30590ce36c78365b04f;p=netconf.git diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java index 5b12419e51..f22e12e4c4 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java @@ -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); }