2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.dom.api;
10 import com.google.common.annotations.Beta;
11 import java.util.concurrent.Executor;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
19 * Interface implemented by an individual operation implementation. This API allows for dispatch implementations, e.g.
20 * an individual object handling a multitude of operations.
22 * @author Robert Varga
26 public interface DOMOperationImplementation {
28 * An implementation of an {@code action}.
33 * Initiate invocation of the RPC. Implementations of this method are expected to not block.
35 * @param type SchemaPath of the action to be invoked. This path refers to an effective action instantiated on
36 * top of the conceptual {@link StoreTreeNode}.
37 * @param path {@link DOMDataTreeIdentifier} of parent data node which action attached to.
38 * @param input Input arguments
39 * @param callback Callback to invoke with the invocation result
40 * @param callbackExecutor Executor to use for executing the callback
41 * @throws NullPointerException if any of the arguments is null
43 void invokeAction(SchemaPath type, DOMDataTreeIdentifier path, NormalizedNode<?, ?> input,
44 DOMOperationCallback callback, Executor callbackExecutor);
48 * An implementation of an {@code rpc}.
53 * Initiate invocation of the RPC. Implementations of this method are expected to not block.
55 * @param type QName of the RPC to be invoked
56 * @param input Input arguments
57 * @param callback Callback to invoke with the invocation result
58 * @param callbackExecutor Executor to use for executing the callback
59 * @throws NullPointerException if any of the arguments is null
61 void invokeRpc(QName type, NormalizedNode<?, ?> input, DOMOperationCallback callback,
62 Executor callbackExecutor);
66 * Return the relative invocation cost of this implementation. Default implementation returns 0.
68 * @return Non-negative cost of invoking this implementation.
70 default long invocationCost() {