Deprecate all MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / md / sal / dom / api / DOMRpcImplementation.java
index c246c762704ede47bc227ff91bb9038b8f1eb3df..46032a3182ef1c2de7e9c1f35b58101de3937962 100644 (file)
@@ -8,14 +8,17 @@
 package org.opendaylight.controller.md.sal.dom.api;
 
 import com.google.common.util.concurrent.CheckedFuture;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
  * Interface implemented by an individual RPC implementation. This API allows for dispatch
  * implementations, e.g. an individual object handling a multitude of RPCs.
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.dom.api.DOMRpcImplementation} instead.
  */
+@Deprecated
 public interface DOMRpcImplementation {
     /**
      * Initiate invocation of the RPC. Implementations of this method are
@@ -27,5 +30,15 @@ public interface DOMRpcImplementation {
      *         or report a subclass of {@link DOMRpcException} reporting a transport
      *         error.
      */
-    @Nonnull CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull DOMRpcIdentifier rpc, @Nullable NormalizedNode<?, ?> input);
+    @NonNull CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@NonNull DOMRpcIdentifier rpc,
+            @Nullable NormalizedNode<?, ?> input);
+
+    /**
+     * Return the relative invocation cost of this implementation. Default implementation return 0.
+     *
+     * @return Non-negative cost of invoking this implementation.
+     */
+    default long invocationCost() {
+        return 0;
+    }
 }