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.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 * Interface implemented by an individual RPC implementation. This API allows for dispatch
17 * implementations, e.g. an individual object handling a multitude of RPCs.
19 public interface DOMRpcImplementation {
21 * Initiate invocation of the RPC. Implementations of this method are
22 * expected to not block on external resources.
24 * @param rpc RPC identifier which was invoked
25 * @param input Input arguments, null if the RPC does not take any.
26 * @return A {@link ListenableFuture} which will return either a result structure,
27 * or report a subclass of {@link DOMRpcException} reporting a transport
30 // FIXME: 4.0.0: do not allow null input
31 @NonNull ListenableFuture<DOMRpcResult> invokeRpc(@NonNull DOMRpcIdentifier rpc,
32 @Nullable NormalizedNode<?, ?> input);
35 * Return the relative invocation cost of this implementation. Default implementation return 0.
37 * @return Non-negative cost of invoking this implementation.
39 default long invocationCost() {