Expose completion future from WriteOperations
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMDataTreeWriteOperations.java
index fe96b0bb1aa4f442a0dc3934b9908beb3caa66cc..7bb139665ad0a2901ecf18e091c538bdae9a1899 100644 (file)
@@ -7,7 +7,12 @@
  */
 package org.opendaylight.mdsal.dom.api;
 
+import com.google.common.annotations.Beta;
+import com.google.common.util.concurrent.FluentFuture;
+import edu.umd.cs.findbugs.annotations.CheckReturnValue;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionDatastoreMismatchException;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -23,9 +28,12 @@ public interface DOMDataTreeWriteOperations {
      * @param store the logical data store which should be modified
      * @param path the data object path
      * @param data the data object to be written to the specified path
+     * @throws IllegalArgumentException if {@code store} is not supported
      * @throws IllegalStateException if the transaction has already been submitted
+     * @throws NullPointerException if any argument is {@code null}
+     * @throws TransactionDatastoreMismatchException if this transaction is already bound to a different data store
      */
-    void put(LogicalDatastoreType store, YangInstanceIdentifier path, NormalizedNode<?, ?> data);
+    void put(LogicalDatastoreType store, YangInstanceIdentifier path, NormalizedNode data);
 
     /**
      * Merges a piece of data with the existing data at a specified path. Any pre-existing data which is not explicitly
@@ -37,16 +45,31 @@ public interface DOMDataTreeWriteOperations {
      * @param store the logical data store which should be modified
      * @param path the data object path
      * @param data the data object to be merged to the specified path
+     * @throws IllegalArgumentException if {@code store} is not supported
      * @throws IllegalStateException if the transaction has already been submitted
+     * @throws NullPointerException if any argument is {@code null}
+     * @throws TransactionDatastoreMismatchException if this transaction is already bound to a different data store
      */
-    void merge(LogicalDatastoreType store, YangInstanceIdentifier path, NormalizedNode<?, ?> data);
+    void merge(LogicalDatastoreType store, YangInstanceIdentifier path, NormalizedNode data);
 
     /**
      * Removes a piece of data from specified path. This operation does not fail if the specified path does not exist.
      *
      * @param store Logical data store which should be modified
      * @param path Data object path
+     * @throws IllegalArgumentException if {@code store} is not supported
      * @throws IllegalStateException if the transaction was committed or canceled.
+     * @throws NullPointerException if any argument is {@code null}
+     * @throws TransactionDatastoreMismatchException if this transaction is already bound to a different data store
      */
     void delete(LogicalDatastoreType store, YangInstanceIdentifier path);
+
+    /**
+     * Return a {@link FluentFuture} which completes.
+     *
+     * @return A future which completes when the requested operations complete.
+     */
+    @Beta
+    @CheckReturnValue
+    @NonNull FluentFuture<?> completionFuture();
 }