Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / sal / core / spi / data / DOMStoreTransactionChain.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.sal.core.spi.data;
9
10 /**
11  * A chain of transactions. Transactions in a chain need to be committed in
12  * sequence and each transaction must see the effects of previous transactions
13  * as if they happened. A chain makes no guarantees of atomicity, in fact
14  * transactions are committed as soon as possible.
15  *
16  * @deprecated Use {@link org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain} instead.
17  */
18 @Deprecated(forRemoval = true)
19 public interface DOMStoreTransactionChain extends DOMStoreTransactionFactory, AutoCloseable {
20
21     /**
22      * Create a new read only transaction which will continue the chain. The
23      * previous write transaction has to be either READY or CANCELLED.
24      *
25      * <p>
26      * If previous write transaction was already commited to data store, new
27      * read-only transaction is same as obtained via {@link DOMStore#newReadOnlyTransaction()}
28      * and contains merged result of previous one and current state of data store.
29      *
30      * <p>
31      * Otherwise read-only transaction presents isolated view as if previous read-write
32      * transaction was successful. State which was introduced by other transactions
33      * outside this transaction chain after creation of previous transaction is not visible.
34      *
35      * @return New transaction in the chain.
36      * @throws IllegalStateException
37      *             if the previous transaction was not READY or CANCELLED, or
38      *             if the chain has been closed.
39      */
40     @Override
41     DOMStoreReadTransaction newReadOnlyTransaction();
42
43     /**
44      * Create a new read write transaction which will continue the chain. The
45      * previous read-write transaction has to be either COMMITED or CANCELLED.
46      *
47      * <p>
48      * If previous write transaction was already commited to data store, new
49      * read-write transaction is same as obtained via {@link DOMStore#newReadWriteTransaction()}
50      * and contains merged result of previous one and current state of data store.
51      *
52      * <p>
53      * Otherwise read-write transaction presents isolated view as if previous read-write
54      * transaction was successful. State which was introduced by other transactions
55      * outside this transaction chain after creation of previous transaction is not visible.
56      *
57      * @return New transaction in the chain.
58      * @throws IllegalStateException
59      *             if the previous transaction was not READY or CANCELLED, or
60      *             if the chain has been closed.
61      */
62     @Override
63     DOMStoreReadWriteTransaction newReadWriteTransaction();
64
65     /**
66      * Create a new write-only transaction which will continue the chain. The
67      * previous read-write transaction has to be either READY or CANCELLED.
68      *
69      *
70      * @return New transaction in the chain.
71      * @throws IllegalStateException
72      *             if the previous transaction was not READY or CANCELLED, or
73      *             if the chain has been closed.
74      */
75     @Override
76     DOMStoreWriteTransaction newWriteOnlyTransaction();
77
78     /**
79      * Closes Transaction Chain.
80      *
81      * <p>
82      * Close method of transaction chain does not guarantee that
83      * last alocated transaction is ready or was submitted.
84      *
85      * @throws IllegalStateException If any of the outstanding created transactions was not canceled or ready.
86      */
87     @Override
88     void close();
89 }