*/
package org.opendaylight.mdsal.binding.util;
+import com.google.common.annotations.Beta;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
+import edu.umd.cs.findbugs.annotations.CheckReturnValue;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Future;
-import javax.annotation.CheckReturnValue;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
/**
* Managed transaction factories provide managed transactions, <em>i.e.</em> transactions which are automatically
* submitted or cancelled (write) or closed (read).
+ *
* <p>
* This is a common interface for broker- and chain-based transaction managers, and should not be used directly.
*/
+@Beta
public interface ManagedTransactionFactory {
/**
* Invokes a function with a <b>NEW</b> {@link TypedReadTransaction}, and ensures that that transaction is closed.
* <p>The provided transaction is specific to the given logical datastore type and cannot be used for any
* other.
*
+ * @param <D> datastore type
+ * @param <E> thrown exception type
+ * @param <R> result type
* @param datastoreType the {@link Datastore} type that will be accessed
* @param txFunction the {@link InterruptibleCheckedFunction} that needs a new read transaction
* @return the result of the function.
* <p>The provided transaction is specific to the given logical datastore type and cannot be used for any
* other.
*
+ * @param <D> datastore type
+ * @param <E> thrown exception type
+ * @param <R> result type
* @param datastoreType the {@link Datastore} type that will be accessed
* @param txFunction the {@link InterruptibleCheckedFunction} that needs a new read transaction
* @return the result of the function.
* {@link CompletionStage}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
+ * @param <D> datastore type
+ * @param <E> thrown exception type
+ * @param <R> result type
* @param datastoreType the {@link Datastore} type that will be accessed
* @param txFunction the {@link InterruptibleCheckedFunction} that needs a new read-write transaction
* @return the {@link FluentFuture} returned by {@link ReadWriteTransaction#commit()}, or a failed future with an
- * application specific exception (not from submit())
+ * application specific exception (not from submit())
*/
@CheckReturnValue
<D extends Datastore, E extends Exception, R>
* <p>The provided transaction is specific to the given logical datastore type and cannot be used for any
* other.
*
+ * @param <D> datastore type
+ * @param <E> thrown exception type
* @param datastoreType the {@link Datastore} type that will be accessed
* @param txConsumer the {@link InterruptibleCheckedFunction} that needs a new read transaction
* @throws E if an error occurs.
* <p>The provided transaction is specific to the given logical datastore type and cannot be used for any
* other.
*
+ * @param <D> datastore type
+ * @param <E> thrown exception type
* @param datastoreType the {@link Datastore} type that will be accessed
* @param txConsumer the {@link InterruptibleCheckedFunction} that needs a new read transaction
* @throws E if an error occurs.
* {@link CompletionStage}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
+ * @param <D> datastore type
+ * @param <E> thrown exception type
* @param datastoreType the {@link Datastore} type that will be accessed
* @param txConsumer the {@link InterruptibleCheckedConsumer} that needs a new read-write transaction
* @return the {@link FluentFuture} returned by {@link ReadWriteTransaction#commit()}, or a failed future with an
- * application specific exception (not from submit())
+ * application specific exception (not from submit())
*/
@CheckReturnValue
<D extends Datastore, E extends Exception>
* {@link CompletionStage}
* (but better NOT by using the blocking {@link Future#get()} on it).
*
+ * @param <D> datastore type
+ * @param <E> thrown exception type
* @param datastoreType the {@link Datastore} type that will be accessed
* @param txConsumer the {@link InterruptibleCheckedConsumer} that needs a new write only transaction
* @return the {@link FluentFuture} returned by {@link WriteTransaction#commit()}, or a failed future with an
- * application specific exception (not from submit())
+ * application specific exception (not from submit())
*/
@CheckReturnValue
<D extends Datastore, E extends Exception>