Binding v2 runtime - adapters - impl - operations invoker
[mdsal.git] / binding2 / mdsal-binding2-spec / src / main / java / org / opendaylight / mdsal / binding / javav2 / spec / base / ListAction.java
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  * ListAction provides support for YANG actions defined under List statement.
14  *
15  * The "action" statement is used to define an operation connected to a
16  * specific container or list data node. The "action" statement defines
17  * an action node in the schema tree. Under the action node, a schema node
18  * with the name "input" and a schema node with the name "output" are also
19  * defined. The nodes "input" and "output" are defined in the module’s namespace.
20  *
21  * The difference between an action and an rpc is that an action is tied
22  * to a node in the datastore, whereas an rpc is not.
23  *
24  * Action replaces concept of routed RPC and comes up with implicit InstanceIdentifier
25  * context, whereas routed RPC defines explicit leaf for this purpose.
26  *
27  */
28 @FunctionalInterface
29 public interface ListAction<P extends TreeNode, I extends Input<I> & Instantiable<I>,
30         O extends Output<O> & Instantiable<O>> extends Operation {
31
32     /**
33      * @param input Action input schema node
34      * @param kii implicit KeyedInstanceIdentifier connected to action, according to https://tools.ietf.org/html/rfc7950
35      * @param callback on success/failure callback
36      * @param <K> target key type
37      */
38     <K> void invoke(I input, KeyedInstanceIdentifier<P, K> kii, RpcCallback<O> callback);
39 }