X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDOMDataCommitExecutor.java;fp=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDOMDataCommitExecutor.java;h=f233912ea457a1c7780b15f9b870f98176e865ea;hb=2cf314976a3f81c7115f94c44fb37e967f8a4426;hp=0000000000000000000000000000000000000000;hpb=9d7a3392097e4c4a648327f77d7ca1a6aaf1b410;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataCommitExecutor.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataCommitExecutor.java new file mode 100644 index 0000000000..f233912ea4 --- /dev/null +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataCommitExecutor.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.md.sal.dom.broker.impl; + +import org.opendaylight.controller.md.sal.common.api.TransactionStatus; +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 { + + /** + * 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. + * + */ + ListenableFuture> submit(DOMDataWriteTransaction tx, + Iterable cohort, Optional listener); + +}