Change CreateStreamUtil return types
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / impl / RestconfInvokeOperationsServiceImpl.java
index d02b994f208d60a2acaba6acc91ef5ba7e565f5c..8d2464103fcbb56dfbe51d520805aa129f6ae173 100644 (file)
@@ -154,7 +154,6 @@ public final class RestconfInvokeOperationsServiceImpl {
                     .orElseGet(() -> Response.noContent().build());
             }
         });
-
     }
 
     private RestconfFuture<Optional<ContainerNode>> hackInvokeRpc(final DatabindContext localDatabind,
@@ -165,15 +164,14 @@ public final class RestconfInvokeOperationsServiceImpl {
         if (mountPoint == null) {
             // Hacked-up integration of streams
             if (CreateDataChangeEventSubscription.QNAME.equals(type)) {
-                return RestconfFuture.of(Optional.of(CreateStreamUtil.createDataChangeNotifiStream(
-                    streamUtils.listenersBroker(), input, localDatabind.modelContext())));
+                return CreateStreamUtil.createDataChangeNotifiStream(streamUtils.listenersBroker(), input,
+                    localDatabind.modelContext());
             } else if (CreateNotificationStream.QNAME.equals(type)) {
-                return RestconfFuture.of(Optional.of(CreateStreamUtil.createNotificationStream(
-                    streamUtils.listenersBroker(), input, localDatabind.modelContext())));
+                return CreateStreamUtil.createNotificationStream(streamUtils.listenersBroker(), input,
+                    localDatabind.modelContext());
             } else if (SubscribeDeviceNotification.QNAME.equals(type)) {
-                final var baseUrl = streamUtils.prepareUriByStreamName(uriInfo, "").toString();
-                return RestconfFuture.of(Optional.of(CreateStreamUtil.createDeviceNotificationListener(baseUrl, input,
-                    streamUtils, mountPointService, listenersBroker)));
+                return CreateStreamUtil.createDeviceNotificationListener(listenersBroker, input,
+                    streamUtils.prepareUriByStreamName(uriInfo, "").toString(), mountPointService);
             }
         }