2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.md.sal.dom.broker.impl;
10 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
11 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
12 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
13 import com.google.common.base.Optional;
14 import com.google.common.util.concurrent.CheckedFuture;
17 * Executor of Three Phase Commit coordination for
18 * {@link DOMDataWriteTransaction} transactions.
20 * Implementations are responsible for executing implementation of three-phase
21 * commit protocol on supplied {@link DOMStoreThreePhaseCommitCohort}s.
25 interface DOMDataCommitExecutor {
28 * Submits supplied transaction to be executed in context of provided
31 * Transaction is used only as a context, cohorts should be associated with
35 * Transaction to be used as context for reporting
37 * DOM Store cohorts representing provided transaction, its
40 * Error listener which should be notified if transaction failed.
41 * @return a CheckedFuture. if commit coordination on cohorts finished successfully,
42 * nothing is returned from the Future, On failure,
43 * the Future fails with a {@link TransactionCommitFailedException}.
46 CheckedFuture<Void,TransactionCommitFailedException> submit(DOMDataWriteTransaction tx,
47 Iterable<DOMStoreThreePhaseCommitCohort> cohort, Optional<DOMDataCommitErrorListener> listener);