Move streams support classes
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / RestconfApplication.java
index 883aef26115be28deac4638c2003bc0c425d86e5..a1ca028d31cbf979714d06fee0952f86eb3a83c8 100644 (file)
@@ -7,17 +7,54 @@
  */
 package org.opendaylight.restconf.nb.rfc8040;
 
+import java.util.List;
 import javax.inject.Inject;
 import javax.inject.Singleton;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
+import org.opendaylight.mdsal.dom.api.DOMActionService;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMNotificationService;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMYangTextSourceProvider;
 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
-import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapper;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSubscriptionService;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfImpl;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfInvokeOperationsServiceImpl;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfOperationsServiceImpl;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfSchemaServiceImpl;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfStreamsSubscriptionServiceImpl;
+import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
 
 @Singleton
-public class RestconfApplication extends AbstractRestconfApplication<ServicesWrapper> {
+public class RestconfApplication extends AbstractRestconfApplication {
+    private RestconfApplication(final SchemaContextHandler schemaContextHandler,
+            final DOMMountPointService mountPointService, final RestconfStreamsSubscriptionService streamSubscription,
+            final DOMDataBroker dataBroker, final DOMRpcService rpcService, final DOMActionService actionService,
+            final DOMNotificationService notificationService, final DOMSchemaService domSchemaService,
+            final Configuration configuration) {
+        super(schemaContextHandler, mountPointService, List.of(
+            streamSubscription,
+            new RestconfDataServiceImpl(schemaContextHandler, dataBroker, mountPointService, streamSubscription,
+                actionService, configuration),
+            new RestconfInvokeOperationsServiceImpl(rpcService, schemaContextHandler),
+            new RestconfOperationsServiceImpl(schemaContextHandler, mountPointService),
+            new RestconfSchemaServiceImpl(schemaContextHandler, mountPointService,
+                domSchemaService.getExtensions().getInstance(DOMYangTextSourceProvider.class)),
+            new RestconfImpl(schemaContextHandler)));
+
+    }
+
     @Inject
     public RestconfApplication(final SchemaContextHandler schemaContextHandler,
-            final DOMMountPointServiceHandler mountPointServiceHandler, final ServicesWrapper servicesNotifWrapper) {
-        super(schemaContextHandler, mountPointServiceHandler, servicesNotifWrapper);
+            final DOMMountPointService mountPointService, final DOMDataBroker dataBroker,
+            final DOMRpcService rpcService, final DOMActionService actionService,
+            final DOMNotificationService notificationService,
+            final DOMSchemaService domSchemaService, final Configuration configuration) {
+        this(schemaContextHandler, mountPointService,
+            new RestconfStreamsSubscriptionServiceImpl(dataBroker, notificationService, schemaContextHandler,
+                configuration),
+            dataBroker, rpcService, actionService, notificationService, domSchemaService, configuration);
     }
 }