Add forwarding transactions to binding v1
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMOperationService.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.dom.api;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.util.concurrent.FluentFuture;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
17
18 /**
19  * A {@link DOMService} which allows clients to invoke Actions and RPCs. The conceptual model of this service is that
20  * of a dynamic router, where the set of available Operation services can change dynamically. The service allows users
21  * to add a listener to track the process of Actions and RPCs becoming available.
22  *
23  * @author Robert Varga
24  */
25 @Beta
26 @NonNullByDefault
27 public interface DOMOperationService extends DOMExtensibleService<DOMOperationService, DOMOperationServiceExtension> {
28     /**
29      * Initiate invocation of an RPC. This method is guaranteed to not block on any external resources.
30      *
31      * @param type QName of the RPC to be invoked
32      * @param input Input arguments
33      * @return A FluentFuture which completes with the result of invocation
34      * @throws NullPointerException if any of the arguments is null
35      */
36     FluentFuture<DOMOperationResult> invokeRpc(QName type, ContainerNode input);
37
38     /**
39      * Initiate invocation of an Action. This method is guaranteed to not block on any external resources.
40      *
41      * @param type SchemaPath of the action to be invoked. This path refers to an effective action instantiated on top
42      *             of the conceptual {@link StoreTreeNode}.
43      * @param path {@link DOMDataTreeIdentifier} of parent data node which action attached to.
44      * @param input Input argument
45      * @return A FluentFuture which completes with the result of invocation
46      * @throws NullPointerException if any of the arguments is null
47      */
48     FluentFuture<DOMOperationResult> invokeAction(SchemaPath type, DOMDataTreeIdentifier path, ContainerNode input);
49 }