X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FTransactionChain.java;h=e7e0eb0ff87e424973de4b9c9d6fdf9111ccae4c;hp=d542935dd6dbf0fdb91ce72b273d6bc9c87b2668;hb=9fda938ef6dc037ef1c5a9fbed25469d4a532150;hpb=9b07bd85d10b509d29b70b1e43b1919c5b4bcbb2 diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java index d542935dd6..e7e0eb0ff8 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java @@ -13,17 +13,34 @@ import org.opendaylight.yangtools.concepts.Path; * A chain of transactions. Transactions in a chain need to be committed in sequence and each * transaction should see the effects of previous transactions as if they happened. A chain * makes no guarantees of atomicity, in fact transactions are committed as soon as possible. + * */ -public interface TransactionChain

, D> extends AutoCloseable { +public interface TransactionChain

, D> extends AutoCloseable, AsyncDataTransactionFactory { + /** - * Create a new transaction which will continue the chain. The previous transaction - * has to be either COMMITTED or CANCELLED. + * Create a new read only transaction which will continue the chain. + * The previous read-write transaction has to be either COMMITED or CANCELLED. * * @return New transaction in the chain. - * @throws IllegalStateException if the previous transaction was not COMMITTED or CANCELLED. + * @throws IllegalStateException if the previous transaction was not COMMITED + * or CANCELLED. * @throws TransactionChainClosedException if the chain has been closed. */ - DataModification newTransaction(); + @Override + public AsyncReadTransaction newReadOnlyTransaction(); + + + /** + * Create a new read write transaction which will continue the chain. + * The previous read-write transaction has to be either COMMITED or CANCELLED. + * + * @return New transaction in the chain. + * @throws IllegalStateException if the previous transaction was not COMMITTED + * or CANCELLED. + * @throws TransactionChainClosedException if the chain has been closed. + */ + @Override + public AsyncReadWriteTransaction newReadWriteTransaction(); @Override void close();