Unmask NotificationListenerAdapter
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / services / wrapper / ServicesWrapper.java
index 02e69b589f51d75a51e999693fc0b7bdcd9db8e3..89ccec598dd5eb1a99fc03ba25af83e76b4c2ab6 100644 (file)
@@ -10,43 +10,39 @@ package org.opendaylight.restconf.nb.rfc8040.services.wrapper;
 import javax.ws.rs.Path;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
+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.common.context.NormalizedNodeContext;
 import org.opendaylight.restconf.common.patch.PatchContext;
 import org.opendaylight.restconf.common.patch.PatchStatusContext;
 import org.opendaylight.restconf.common.schema.SchemaExportContext;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler;
 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
 import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfDataService;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfInvokeOperationsService;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfOperationsService;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfSchemaService;
+import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfService;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSubscriptionService;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.TransactionServicesWrapper;
 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.services.simple.api.BaseServicesWrapper;
-import org.opendaylight.restconf.nb.rfc8040.services.simple.api.RestconfOperationsService;
-import org.opendaylight.restconf.nb.rfc8040.services.simple.api.RestconfSchemaService;
-import org.opendaylight.restconf.nb.rfc8040.services.simple.api.RestconfService;
-import org.opendaylight.restconf.nb.rfc8040.services.simple.impl.RestconfImpl;
-import org.opendaylight.restconf.nb.rfc8040.services.simple.impl.RestconfOperationsServiceImpl;
-import org.opendaylight.restconf.nb.rfc8040.services.simple.impl.RestconfSchemaServiceImpl;
+import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
 
 /**
  * Wrapper for services.
- * <ul>
- * <li>{@link BaseServicesWrapper}
- * <li>{@link TransactionServicesWrapper}
- * </ul>
- *
  */
 @Path("/")
-public final class ServicesWrapper implements BaseServicesWrapper, TransactionServicesWrapper {
+public final class ServicesWrapper implements RestconfOperationsService, RestconfSchemaService, RestconfService,
+        RestconfDataService, RestconfInvokeOperationsService, RestconfStreamsSubscriptionService {
 
     private final RestconfDataService delegRestconfDataService;
     private final RestconfInvokeOperationsService delegRestconfInvokeOpsService;
@@ -55,11 +51,11 @@ public final class ServicesWrapper implements BaseServicesWrapper, TransactionSe
     private final RestconfSchemaService delegRestSchService;
     private final RestconfService delegRestService;
 
-    private ServicesWrapper(RestconfDataService delegRestconfDataService,
-            RestconfInvokeOperationsService delegRestconfInvokeOpsService,
-            RestconfStreamsSubscriptionService delegRestconfSubscrService,
-            RestconfOperationsService delegRestOpsService, RestconfSchemaService delegRestSchService,
-            RestconfService delegRestService) {
+    private ServicesWrapper(final RestconfDataService delegRestconfDataService,
+            final RestconfInvokeOperationsService delegRestconfInvokeOpsService,
+            final RestconfStreamsSubscriptionService delegRestconfSubscrService,
+            final RestconfOperationsService delegRestOpsService, final RestconfSchemaService delegRestSchService,
+            final RestconfService delegRestService) {
         this.delegRestconfDataService = delegRestconfDataService;
         this.delegRestconfInvokeOpsService = delegRestconfInvokeOpsService;
         this.delegRestconfSubscrService = delegRestconfSubscrService;
@@ -69,28 +65,26 @@ public final class ServicesWrapper implements BaseServicesWrapper, TransactionSe
     }
 
     public static ServicesWrapper newInstance(final SchemaContextHandler schemaCtxHandler,
-            final DOMMountPointServiceHandler domMountPointServiceHandler,
-            final TransactionChainHandler transactionChainHandler, final DOMDataBrokerHandler domDataBrokerHandler,
-            final RpcServiceHandler rpcServiceHandler, final NotificationServiceHandler notificationServiceHandler,
-            final DOMSchemaService domSchemaService) {
-        RestconfOperationsService restconfOpsService =
-                new RestconfOperationsServiceImpl(schemaCtxHandler, domMountPointServiceHandler);
+            final DOMMountPointService mountPointService,
+            final TransactionChainHandler transactionChainHandler, final DOMDataBroker dataBroker,
+            final DOMRpcService rpcService, final DOMActionService actionService,
+            final DOMNotificationService notificationService, final DOMSchemaService domSchemaService,
+            final Configuration configuration) {
+        RestconfOperationsService restconfOpsService = new RestconfOperationsServiceImpl(schemaCtxHandler,
+            mountPointService);
         final DOMYangTextSourceProvider yangTextSourceProvider = domSchemaService.getExtensions()
-                .getInstance(DOMYangTextSourceProvider.class);
-        RestconfSchemaService restconfSchemaService =
-                new RestconfSchemaServiceImpl(schemaCtxHandler, domMountPointServiceHandler,
-                yangTextSourceProvider);
-        RestconfStreamsSubscriptionService restconfSubscrService =
-                new RestconfStreamsSubscriptionServiceImpl(domDataBrokerHandler,
-                notificationServiceHandler, schemaCtxHandler, transactionChainHandler);
-        RestconfDataService restconfDataService =
-                new RestconfDataServiceImpl(schemaCtxHandler, transactionChainHandler, domMountPointServiceHandler,
-                        restconfSubscrService);
-        RestconfInvokeOperationsService restconfInvokeOpsService =
-                new RestconfInvokeOperationsServiceImpl(rpcServiceHandler, schemaCtxHandler);
+            .getInstance(DOMYangTextSourceProvider.class);
+        RestconfSchemaService restconfSchemaService = new RestconfSchemaServiceImpl(schemaCtxHandler, mountPointService,
+            yangTextSourceProvider);
+        RestconfStreamsSubscriptionService restconfSubscrService = new RestconfStreamsSubscriptionServiceImpl(
+            dataBroker, notificationService, schemaCtxHandler, transactionChainHandler, configuration);
+        RestconfDataService restconfDataService = new RestconfDataServiceImpl(schemaCtxHandler, dataBroker,
+            mountPointService, restconfSubscrService, actionService, configuration);
+        RestconfInvokeOperationsService restconfInvokeOpsService = new RestconfInvokeOperationsServiceImpl(rpcService,
+            schemaCtxHandler);
         RestconfService restconfService = new RestconfImpl(schemaCtxHandler);
-        return new ServicesWrapper(restconfDataService, restconfInvokeOpsService,
-                restconfSubscrService, restconfOpsService, restconfSchemaService, restconfService);
+        return new ServicesWrapper(restconfDataService, restconfInvokeOpsService, restconfSubscrService,
+            restconfOpsService, restconfSchemaService, restconfService);
     }
 
     @Override
@@ -148,6 +142,11 @@ public final class ServicesWrapper implements BaseServicesWrapper, TransactionSe
         return this.delegRestconfDataService.patchData(context, uriInfo);
     }
 
+    @Override
+    public Response patchData(final String identifier, final NormalizedNodeContext payload, final UriInfo uriInfo) {
+        return this.delegRestconfDataService.patchData(identifier, payload, uriInfo);
+    }
+
     @Override
     public NormalizedNodeContext invokeRpc(final String identifier, final NormalizedNodeContext payload,
             final UriInfo uriInfo) {