ca2d711032882ba8130360563f5d81d7d77684a5
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMDataCommitImplementation.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 org.opendaylight.controller.md.sal.common.api.TransactionStatus;
11 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
12 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
13 import org.opendaylight.yangtools.yang.common.RpcResult;
14
15 import com.google.common.util.concurrent.ListenableFuture;
16
17 /**
18  * 
19  * Implementation prototype of commit method for
20  * {@link DOMForwardedWriteTransaction}.
21  * 
22  */
23 public interface DOMDataCommitImplementation {
24
25     /**
26      * User-supplied implementation of {@link DOMDataWriteTransaction#commit()}
27      * for transaction.
28      * 
29      * Callback invoked when {@link DOMDataWriteTransaction#commit()} is invoked
30      * on transaction created by this factory.
31      * 
32      * @param transaction
33      *            Transaction on which {@link DOMDataWriteTransaction#commit()}
34      *            was invoked.
35      * @param cohorts
36      *            Iteration of cohorts for subtransactions associated with
37      *            commited transaction.
38      * 
39      */
40     ListenableFuture<RpcResult<TransactionStatus>> commit(final DOMDataWriteTransaction transaction,
41             final Iterable<DOMStoreThreePhaseCommitCohort> cohorts);
42 }