Deprecate old MD-SAL APIs for removal
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / md / sal / dom / api / DOMRpcImplementation.java
1 /*
2  * Copyright (c) 2015 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 package org.opendaylight.controller.md.sal.dom.api;
9
10 import com.google.common.util.concurrent.CheckedFuture;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14
15 /**
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.
18  *
19  * @deprecated Use {@link org.opendaylight.mdsal.dom.api.DOMRpcImplementation} instead.
20  */
21 @Deprecated(forRemoval = true)
22 public interface DOMRpcImplementation {
23     /**
24      * Initiate invocation of the RPC. Implementations of this method are
25      * expected to not block on external resources.
26      *
27      * @param rpc RPC identifier which was invoked
28      * @param input Input arguments, null if the RPC does not take any.
29      * @return A {@link CheckedFuture} which will return either a result structure,
30      *         or report a subclass of {@link DOMRpcException} reporting a transport
31      *         error.
32      */
33     @NonNull CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@NonNull DOMRpcIdentifier rpc,
34             @Nullable NormalizedNode<?, ?> input);
35
36     /**
37      * Return the relative invocation cost of this implementation. Default implementation return 0.
38      *
39      * @return Non-negative cost of invoking this implementation.
40      */
41     default long invocationCost() {
42         return 0;
43     }
44 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.