import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import javax.annotation.CheckReturnValue;
import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.controller.md.sal.common.api.MappingCheckedFuture;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
import org.opendaylight.yangtools.concepts.Path;
import org.opendaylight.yangtools.util.concurrent.ExceptionMapper;
* @param <D>
* Type of data (payload), which represents data payload
*/
+@Deprecated(forRemoval = true)
public interface AsyncWriteTransaction<P extends Path<P>, D> extends AsyncTransaction<P, D> {
/**
* Cancels the transaction.
* Invoking cancel() on a finished transaction (future returned by {@link #submit()} already completed will always
* fail (return false).
*
- * @return <tt>false</tt> if the task could not be cancelled, typically because it has already completed normally
- * <tt>true</tt> otherwise
+ * @return {@code false} if the task could not be cancelled, typically because it has already completed normally
+ * {@code true} otherwise
*
*/
boolean cancel();
* ({@link AsyncConfigurationCommitHandler}) if the transaction changes the data tree.
*
* <p>
- * The effects of a successful commit of data depends on data change listeners
- * ({@link AsyncDataChangeListener}) and commit participants
+ * The effects of a successful commit of data depends on data tree change listeners and commit participants
* ({@link AsyncConfigurationCommitHandler}) that are registered with the data broker.
*
* <h3>Example usage:</h3>
* which are based on same initial state, Tx 1 completes successfully
* before Tx 2 is submitted.
*
- * <table summary="">
+ * <table>
+ * <caption>Data store state changes</caption>
* <tr><th>Initial state</th><th>Tx 1</th><th>Tx 2</th><th>Result</th></tr>
* <tr><td>Empty</td><td>put(A,1)</td><td>put(A,2)</td><td>Tx 2 will fail, state is A=1</td></tr>
* <tr><td>Empty</td><td>put(A,1)</td><td>merge(A,2)</td><td>A=2</td></tr>
* which are based on same initial state, Tx 1 completes successfully
* before Tx 2 is submitted.
*
- * <table summary="">
+ * <table>
+ * <caption>Data store state changes</caption>
* <tr><th>Initial state</th><th>Tx 1</th><th>Tx 2</th><th>Result</th></tr>
*
* <tr><td>Empty</td><td>put(TOP,[])</td><td>put(TOP,[])</td><td>Tx 2 will fail, state is TOP=[]</td></tr>
* @deprecated Use {@link #commit()} instead.
*/
@Deprecated
- @CheckReturnValue
default CheckedFuture<Void, TransactionCommitFailedException> submit() {
return MappingCheckedFuture.create(commit().transform(ignored -> null, MoreExecutors.directExecutor()),
SUBMIT_EXCEPTION_MAPPER);
* {@link TransactionCommitFailedException} or an exception derived from TransactionCommitFailedException.
* @throws IllegalStateException if the transaction is already committed or was canceled.
*/
- @CheckReturnValue
@NonNull FluentFuture<? extends @NonNull CommitInfo> commit();
/**
ExceptionMapper<TransactionCommitFailedException> SUBMIT_EXCEPTION_MAPPER =
new ExceptionMapper<TransactionCommitFailedException>("submit", TransactionCommitFailedException.class) {
@Override
- protected TransactionCommitFailedException newWithCause(String message, Throwable cause) {
+ protected TransactionCommitFailedException newWithCause(final String message, final Throwable cause) {
return new TransactionCommitFailedException(message, cause);
}
};