Remove DOMDataTreeCommitCohortRegistration
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMRpcService.java
index 3f64416a49619b584236b0f55ab34ee706188f4d..6d7fffb3ba4219d1726d22f5c2c2e629838255a7 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.mdsal.dom.api;
 
-import com.google.common.util.concurrent.FluentFuture;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.concepts.Registration;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 
 /**
  * A {@link DOMService} which allows clients to invoke RPCs. The conceptual model of this service is that of a dynamic
@@ -20,33 +19,38 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
  * to track the process of RPCs becoming available.
  */
 // FIXME: once we have a DOMOperationService implementation, deprecate this interface
-public interface DOMRpcService extends DOMService {
+public interface DOMRpcService extends DOMService<DOMRpcService, DOMRpcService.Extension> {
+    /**
+     * Marker interface for an extension to {@link DOMRpcService}.
+     */
+    interface Extension extends DOMService.Extension<DOMRpcService, Extension> {
+        // Marker interface
+    }
+
     /**
      * Initiate invocation of an RPC. This method is guaranteed to not block on any external
      * resources.
      *
-     * @param type SchemaPath of the RPC to be invoked
+     * @param type QName of the RPC to be invoked
      * @param input Input arguments, null if the RPC does not take any.
-     * @return A {@link FluentFuture} which will return either a result structure,
-     *         or report a subclass of {@link DOMRpcException} reporting a transport
-     *         error.
+     * @return A {@link ListenableFuture} which will return either a result structure, or report a subclass
+     *         of {@link DOMRpcException} reporting a transport error.
      */
-    @Nonnull FluentFuture<DOMRpcResult> invokeRpc(@Nonnull SchemaPath type, @Nullable NormalizedNode<?, ?> input);
+    @NonNull ListenableFuture<? extends DOMRpcResult> invokeRpc(@NonNull QName type, @NonNull ContainerNode input);
 
     /**
      * Register a {@link DOMRpcAvailabilityListener} with this service to receive notifications
      * about RPC implementations becoming (un)available. The listener will be invoked with the
      * current implementations reported and will be kept uptodate as implementations come and go.
      * Users should note that using a listener does not necessarily mean that
-     * {@link #invokeRpc(SchemaPath, NormalizedNode)} will not report a failure due to
+     * {@link #invokeRpc(QName, ContainerNode)} will not report a failure due to
      * {@link DOMRpcImplementationNotAvailableException} and need to be ready to handle it.
      * Implementations are encouraged to take reasonable precautions to prevent this scenario from
      * occurring.
      *
      * @param listener {@link DOMRpcAvailabilityListener} instance to register
-     * @return A {@link ListenerRegistration} representing this registration. Performing a
-     *         {@link ListenerRegistration#close()} will cancel it. Returned object is guaranteed to
-     *         be non-null.
+     * @return A {@link Registration} representing this registration. Performing a {@link Registration#close()} will
+     *         cancel it. Returned object is guaranteed to be non-null.
      */
-    @Nonnull <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(@Nonnull T listener);
+    @NonNull Registration registerRpcListener(@NonNull DOMRpcAvailabilityListener listener);
 }