Merge "Bug 2021 - Continuous WARN log nodeConnector creation failed at node: OF|00...
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMDataCommitExecutor.java
index f233912ea457a1c7780b15f9b870f98176e865ea..dae14b5128f7794d86c50039818b664b6b186276 100644 (file)
@@ -7,45 +7,40 @@
  */
 package org.opendaylight.controller.md.sal.dom.broker.impl;
 
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+import com.google.common.util.concurrent.CheckedFuture;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.ListenableFuture;
 
 /**
  * Executor of Three Phase Commit coordination for
  * {@link DOMDataWriteTransaction} transactions.
- * 
+ *
  * Implementations are responsible for executing implementation of three-phase
  * commit protocol on supplied {@link DOMStoreThreePhaseCommitCohort}s.
- * 
- * 
+ *
+ *
  */
-interface DOMDataCommitExecutor {
+public interface DOMDataCommitExecutor {
 
     /**
      * Submits supplied transaction to be executed in context of provided
      * cohorts.
-     * 
+     *
      * Transaction is used only as a context, cohorts should be associated with
      * this transaction.
-     * 
+     *
      * @param tx
      *            Transaction to be used as context for reporting
      * @param cohort
      *            DOM Store cohorts representing provided transaction, its
-     *            subtransactoins.
-     * @param listener
-     *            Error listener which should be notified if transaction failed.
-     * @return ListenableFuture which contains RpcResult with
-     *         {@link TransactionStatus#COMMITED} if commit coordination on
-     *         cohorts finished successfully.
-     * 
+     *            subtransactions.
+     * @return a CheckedFuture. if commit coordination on cohorts finished successfully,
+     *         nothing is returned from the Future, On failure,
+     *         the Future fails with a {@link TransactionCommitFailedException}.
+     *
      */
-    ListenableFuture<RpcResult<TransactionStatus>> submit(DOMDataWriteTransaction tx,
-            Iterable<DOMStoreThreePhaseCommitCohort> cohort, Optional<DOMDataCommitErrorListener> listener);
+    CheckedFuture<Void,TransactionCommitFailedException> submit(DOMDataWriteTransaction tx,
+            Iterable<DOMStoreThreePhaseCommitCohort> cohort);
 
 }