2 * Copyright (c) 2015 Cisco Systems, Inc. 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.util.concurrent.ListenableFuture;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
15 * Interface implemented by an individual RPC implementation. This API allows for dispatch
16 * implementations, e.g. an individual object handling a multitude of RPCs.
18 public interface DOMRpcImplementation {
20 * Initiate invocation of the RPC. Implementations of this method are
21 * expected to not block on external resources.
23 * @param rpc RPC identifier which was invoked
24 * @param input Input arguments, null if the RPC does not take any.
25 * @return A {@link ListenableFuture} which will return either a result structure,
26 * or report a subclass of {@link DOMRpcException} reporting a transport
28 * @throws NullPointerException if any argument is null
30 @NonNull ListenableFuture<? extends DOMRpcResult> invokeRpc(@NonNull DOMRpcIdentifier rpc,
31 @NonNull ContainerNode input);
34 * Return the relative invocation cost of this implementation. Default implementation return 0.
36 * @return Non-negative cost of invoking this implementation.
38 default long invocationCost() {