From 9c6dcf96832c85198d32a2c3d255e1dde73b98b4 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 11 Jan 2023 01:05:37 +0100 Subject: [PATCH] Do not pass outer model context createDeviceNotificationListener() is not using this argument at all, do not pass it down. Change-Id: I177aa0dfa3fffa706f1e9194326ba261eb2f186d Signed-off-by: Robert Varga --- .../nb/rfc8040/rests/services/impl/CreateStreamUtil.java | 5 +---- .../services/impl/RestconfInvokeOperationsServiceImpl.java | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/CreateStreamUtil.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/CreateStreamUtil.java index 9ddce5fbae..c5e7757fcf 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/CreateStreamUtil.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/CreateStreamUtil.java @@ -145,14 +145,12 @@ final class CreateStreamUtil { * * @param baseUrl base Url * @param payload data - * @param refSchemaCtx Reference to {@link EffectiveModelContext}. * @param streamUtil stream utility * @param mountPointService dom mount point service * @return {@link DOMRpcResult} - Output of RPC - example in JSON */ static DOMRpcResult createDeviceNotificationListener(final String baseUrl, final NormalizedNodePayload payload, - final EffectiveModelContext refSchemaCtx, final SubscribeToStreamUtil streamUtil, - final DOMMountPointService mountPointService) { + final SubscribeToStreamUtil streamUtil, final DOMMountPointService mountPointService) { // parsing out of container with settings and path // FIXME: ugly cast final ContainerNode data = (ContainerNode) requireNonNull(payload).getData(); @@ -181,7 +179,6 @@ final class CreateStreamUtil { .orElseThrow(() -> new RestconfDocumentedException("Mount point does not support notifications", ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED)); - // FIXME: what is the relationship to the unused refSchemaCtx? final EffectiveModelContext mountModelContext = mountPoint.getService(DOMSchemaService.class) .orElseThrow(() -> new RestconfDocumentedException("Mount point schema not available", ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED)) diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfInvokeOperationsServiceImpl.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfInvokeOperationsServiceImpl.java index 24387b0f52..a25538794a 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfInvokeOperationsServiceImpl.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfInvokeOperationsServiceImpl.java @@ -98,9 +98,8 @@ public class RestconfInvokeOperationsServiceImpl implements RestconfInvokeOperat } else if (DEVICE_NOTIFICATION_NAMESPACE.equals(rpcName.getModule())) { // FIXME: this should be a match on RPC QName final String baseUrl = streamUtils.prepareUriByStreamName(uriInfo, "").toString(); - future = Futures.immediateFuture( - CreateStreamUtil.createDeviceNotificationListener(baseUrl, payload, schemaContext, streamUtils, - mountPointService)); + future = Futures.immediateFuture(CreateStreamUtil.createDeviceNotificationListener(baseUrl, payload, + streamUtils, mountPointService)); } else { future = invokeRpc((ContainerNode)payload.getData(), rpcName, rpcService); } -- 2.36.6