Merge "Cleanup RpcRoutingStrategy definition"
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMDataCommitExecutor.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.md.sal.dom.broker.impl;
9
10 import com.google.common.util.concurrent.CheckedFuture;
11 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
12 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
13 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
14
15 /**
16  * Executor of Three Phase Commit coordination for
17  * {@link DOMDataWriteTransaction} transactions.
18  *
19  * Implementations are responsible for executing implementation of three-phase
20  * commit protocol on supplied {@link DOMStoreThreePhaseCommitCohort}s.
21  *
22  *
23  */
24 public interface DOMDataCommitExecutor {
25
26     /**
27      * Submits supplied transaction to be executed in context of provided
28      * cohorts.
29      *
30      * Transaction is used only as a context, cohorts should be associated with
31      * this transaction.
32      *
33      * @param tx
34      *            Transaction to be used as context for reporting
35      * @param cohort
36      *            DOM Store cohorts representing provided transaction, its
37      *            subtransactions.
38      * @return a CheckedFuture. if commit coordination on cohorts finished successfully,
39      *         nothing is returned from the Future, On failure,
40      *         the Future fails with a {@link TransactionCommitFailedException}.
41      *
42      */
43     CheckedFuture<Void,TransactionCommitFailedException> submit(DOMDataWriteTransaction tx,
44             Iterable<DOMStoreThreePhaseCommitCohort> cohort);
45
46 }