d2876c05f7d7c75b1e35603ae5ac7d45a01764f9
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMActionImplementation.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.util.concurrent.ListenableFuture;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
14 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
15
16 /**
17  * Interface implemented by an individual operation implementation. This API allows for dispatch implementations, e.g.
18  * an individual object handling a multitude of operations.
19  */
20 @FunctionalInterface
21 @NonNullByDefault
22 public non-sealed interface DOMActionImplementation extends DOMOperationImplementation {
23     /**
24      * Initiate invocation of the action. Implementations of this method are expected to not block.
25      *
26      * @param type absolute schema node identifier of the action to be invoked. This path refers to an effective action
27      *             instantiated on top of the conceptual {@link StoreTreeNode}.
28      * @param path {@link DOMDataTreeIdentifier} of parent data node which action attached to.
29      * @param input Input arguments
30      * @return A {@link ListenableFuture} which completes with the result of invocation
31      * @throws NullPointerException if any of the arguments is null
32      */
33     ListenableFuture<? extends DOMRpcResult> invokeAction(Absolute type, DOMDataTreeIdentifier path,
34         ContainerNode input);
35 }