Eliminate SubscribeToStreamUtil
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / impl / RestconfInvokeOperationsServiceImpl.java
index 4df6c98d8d52973d80b2010cee3d94c781c9c2aa..f8d420953c174c70e3209da8c666a8c55f0af7f6 100644 (file)
@@ -35,6 +35,7 @@ import org.opendaylight.restconf.nb.rfc8040.databind.OperationInputBody;
 import org.opendaylight.restconf.nb.rfc8040.databind.XmlOperationInputBody;
 import org.opendaylight.restconf.nb.rfc8040.legacy.InstanceIdentifierContext;
 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
+import org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenersBroker;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateDataChangeEventSubscription;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateNotificationStream;
@@ -56,15 +57,15 @@ public final class RestconfInvokeOperationsServiceImpl {
     private final MdsalRestconfServer server;
     @Deprecated(forRemoval = true)
     private final DOMMountPointService mountPointService;
-    private final SubscribeToStreamUtil streamUtils;
+    private final ListenersBroker listenersBroker;
 
     public RestconfInvokeOperationsServiceImpl(final DatabindProvider databindProvider,
             final MdsalRestconfServer server, final DOMMountPointService mountPointService,
-            final SubscribeToStreamUtil streamUtils) {
+            final ListenersBroker listenersBroker) {
         this.databindProvider = requireNonNull(databindProvider);
         this.server = requireNonNull(server);
         this.mountPointService = requireNonNull(mountPointService);
-        this.streamUtils = requireNonNull(streamUtils);
+        this.listenersBroker = requireNonNull(listenersBroker);
     }
 
     /**
@@ -159,14 +160,14 @@ public final class RestconfInvokeOperationsServiceImpl {
         if (mountPoint == null) {
             // Hacked-up integration of streams
             if (CreateDataChangeEventSubscription.QNAME.equals(type)) {
-                return CreateStreamUtil.createDataChangeNotifiStream(streamUtils.listenersBroker(), input,
+                return CreateStreamUtil.createDataChangeNotifiStream(listenersBroker, input,
                     localDatabind.modelContext());
             } else if (CreateNotificationStream.QNAME.equals(type)) {
-                return CreateStreamUtil.createNotificationStream(streamUtils.listenersBroker(), input,
+                return CreateStreamUtil.createNotificationStream(listenersBroker, input,
                     localDatabind.modelContext());
             } else if (SubscribeDeviceNotification.QNAME.equals(type)) {
-                return CreateStreamUtil.createDeviceNotificationListener(streamUtils.listenersBroker(), input,
-                    streamUtils.prepareUriByStreamName(uriInfo, "").toString(), mountPointService);
+                return CreateStreamUtil.createDeviceNotificationListener(listenersBroker, input,
+                    listenersBroker.prepareUriByStreamName(uriInfo, "").toString(), mountPointService);
             }
         }