import javax.inject.Inject;
import javax.inject.Singleton;
import org.apache.aries.blueprint.annotation.service.Reference;
+import org.opendaylight.mdsal.dom.api.DOMActionService;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.nb.rfc8040.handlers.ActionServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
final DOMMountPointServiceHandler domMountPointServiceHandler,
final TransactionChainHandler transactionChainHandler,
final DOMDataBrokerHandler domDataBrokerHandler, final RpcServiceHandler rpcServiceHandler,
- final ActionServiceHandler actionServiceHandler,
+ @Reference final DOMActionService actionService,
final NotificationServiceHandler notificationServiceHandler,
final SSEInitializer sseInit,
final Configuration configuration,
@Reference final DOMSchemaService domSchemaService) {
servicesWrapper = ServicesWrapper.newInstance(schemaCtxHandler, domMountPointServiceHandler,
- transactionChainHandler, domDataBrokerHandler, rpcServiceHandler, actionServiceHandler,
+ transactionChainHandler, domDataBrokerHandler, rpcServiceHandler, actionService,
notificationServiceHandler, domSchemaService, configuration);
servicesNotifWrapper = ServicesNotifWrapper.newInstance(sseInit);
}
+++ /dev/null
-/*
- * Copyright (C) 2019 Ericsson Software Technology AB. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.nb.rfc8040.handlers;
-
-import static java.util.Objects.requireNonNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import org.apache.aries.blueprint.annotation.service.Reference;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.dom.api.DOMActionService;
-
-/**
- * Implementation of {@link ActionServiceHandler}.
- */
-// FIXME: remove this class
-@Singleton
-public class ActionServiceHandler {
- private final @NonNull DOMActionService actionService;
-
- /**
- * Set DOMActionService.
- *
- * @param actionService
- * DOMActionService
- */
- @Inject
- public ActionServiceHandler(final @Reference DOMActionService actionService) {
- this.actionService = requireNonNull(actionService);
- }
-
- public @NonNull DOMActionService get() {
- return this.actionService;
- }
-}
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.api.DOMActionResult;
+import org.opendaylight.mdsal.dom.api.DOMActionService;
import org.opendaylight.mdsal.dom.api.DOMMountPoint;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
import org.opendaylight.restconf.common.patch.PatchContext;
import org.opendaylight.restconf.common.patch.PatchStatusContext;
import org.opendaylight.restconf.nb.rfc8040.Rfc8040;
-import org.opendaylight.restconf.nb.rfc8040.handlers.ActionServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
private final SchemaContextHandler schemaContextHandler;
private final TransactionChainHandler transactionChainHandler;
private final DOMMountPointServiceHandler mountPointServiceHandler;
- private final ActionServiceHandler actionServiceHandler;
+ private final DOMActionService actionService;
public RestconfDataServiceImpl(final SchemaContextHandler schemaContextHandler,
final TransactionChainHandler transactionChainHandler,
final DOMMountPointServiceHandler mountPointServiceHandler,
final RestconfStreamsSubscriptionService delegRestconfSubscrService,
- final ActionServiceHandler actionServiceHandler,
+ final DOMActionService actionService,
final Configuration configuration) {
- this.actionServiceHandler = requireNonNull(actionServiceHandler);
+ this.actionService = requireNonNull(actionService);
this.schemaContextHandler = requireNonNull(schemaContextHandler);
this.transactionChainHandler = requireNonNull(transactionChainHandler);
this.mountPointServiceHandler = requireNonNull(mountPointServiceHandler);
schemaContextRef = modelContext(mountPoint);
} else {
response = RestconfInvokeOperationsUtil.invokeAction((ContainerNode) data, schemaPath,
- this.actionServiceHandler, yangIIdContext);
+ this.actionService, yangIIdContext);
schemaContextRef = this.schemaContextHandler.get();
}
final DOMActionResult result = RestconfInvokeOperationsUtil.checkActionResponse(response);
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
import org.opendaylight.restconf.common.errors.RestconfError.ErrorTag;
import org.opendaylight.restconf.common.errors.RestconfError.ErrorType;
-import org.opendaylight.restconf.nb.rfc8040.handlers.ActionServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.YangConstants;
* input data
* @param schemaPath
* schema path of data
- * @param actionServiceHandler
- * action service handler to invoke action
+ * @param actionService
+ * action service to invoke action
* @return {@link DOMActionResult}
*/
+ // FIXME: eliminate this method
public static DOMActionResult invokeAction(final ContainerNode data, final Absolute schemaPath,
- final ActionServiceHandler actionServiceHandler, final YangInstanceIdentifier yangIId) {
- return prepareActionResult(
- actionServiceHandler.get().invokeAction(schemaPath, prepareDataTreeId(yangIId), data));
+ final DOMActionService actionService, final YangInstanceIdentifier yangIId) {
+ return prepareActionResult(actionService.invokeAction(schemaPath, prepareDataTreeId(yangIId), data));
}
/**
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.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.ActionServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
public static ServicesWrapper newInstance(final SchemaContextHandler schemaCtxHandler,
final DOMMountPointServiceHandler domMountPointServiceHandler,
final TransactionChainHandler transactionChainHandler, final DOMDataBrokerHandler domDataBrokerHandler,
- final RpcServiceHandler rpcServiceHandler, final ActionServiceHandler actionServiceHandler,
+ final RpcServiceHandler rpcServiceHandler, final DOMActionService actionService,
final NotificationServiceHandler notificationServiceHandler, final DOMSchemaService domSchemaService,
final Configuration configuration) {
RestconfOperationsService restconfOpsService = new RestconfOperationsServiceImpl(schemaCtxHandler,
domDataBrokerHandler, notificationServiceHandler, schemaCtxHandler, transactionChainHandler,
configuration);
RestconfDataService restconfDataService = new RestconfDataServiceImpl(schemaCtxHandler, transactionChainHandler,
- domMountPointServiceHandler, restconfSubscrService, actionServiceHandler, configuration);
+ domMountPointServiceHandler, restconfSubscrService, actionService, configuration);
RestconfInvokeOperationsService restconfInvokeOpsService = new RestconfInvokeOperationsServiceImpl(
rpcServiceHandler, schemaCtxHandler);
RestconfService restconfService = new RestconfImpl(schemaCtxHandler);
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMActionService;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
import org.opendaylight.restconf.common.patch.PatchEntity;
import org.opendaylight.restconf.common.patch.PatchStatusContext;
import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
-import org.opendaylight.restconf.nb.rfc8040.handlers.ActionServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
@Mock
private NetconfDataTreeService netconfService;
@Mock
- private ActionServiceHandler actionServiceHandler;
+ private DOMActionService actionService;
@Mock
private DOMTransactionChain mountTransactionChain;
@Mock
schemaContextHandler.onModelContextUpdated(this.contextRef);
this.dataService = new RestconfDataServiceImpl(schemaContextHandler, this.transactionChainHandler,
new DOMMountPointServiceHandler(mountPointService), this.delegRestconfSubscrService,
- this.actionServiceHandler, configuration);
+ this.actionService, configuration);
doReturn(Optional.of(this.mountPoint)).when(this.mountPointService)
.getMountPoint(any(YangInstanceIdentifier.class));
doReturn(Optional.of(FixedDOMSchemaService.of(this.contextRef))).when(this.mountPoint)