bbda46ed2b93d2a500138fc1f0037d4251a825dd
[mdsal.git] /
1 /*
2  * Copyright (c) 2017 Cisco Systems, Inc. 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
9 package org.opendaylight.mdsal.binding.javav2.spec.base;
10
11 /**
12  *
13  * The "action" statement is used to define an operation connected to a
14  * specific container or list data node. The "action" statement defines
15  * an action node in the schema tree. Under the action node, a schema node
16  * with the name "input" and a schema node with the name "output" are also
17  * defined. The nodes "input" and "output" are defined in the module’s namespace.
18  *
19  * The difference between an action and an rpc is that an action is tied
20  * to a node in the datastore, whereas an rpc is not.
21  *
22  * Action replaces concept of routed RPC and comes up with implicit InstanceIdentifier
23  * context, whereas routed RPC defines explicit leaf for this purpose.
24  *
25  */
26 @FunctionalInterface
27 public interface Action<P extends TreeNode, I extends Input<I> & Instantiable<I>, O extends Output<O> & Instantiable<O>> {
28
29     /**
30      * @param input Action input schema node
31      * @param ii implicit InstanceIdentifier connected to action, according to https://tools.ietf.org/html/rfc7950
32      * @param callback on success/failure callback
33      */
34     void invoke(I input, InstanceIdentifier<P> ii, RpcCallback<O> callback);
35 }