Bug 1073: Introduced Transaction Chain to DOMStore APIs.
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / sal / core / spi / data / DOMStoreTransactionFactory.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  * Factory for DOM Store Transactions
12  *
13  * <p>
14  * Factory provides method to construct read-only, read-write and write-only
15  * transactions, which may be used to retrieve and modify stored information in
16  * Underlying {@link DOMStore} or {@link DOMStoreTransactionChain}.
17  *
18  * <p>
19  * See {@link DOMStore} or {@link DOMStoreTransactionChain} for concrete
20  * variations of this factory.
21  *
22  * <p>
23  * <b>Note:</b> This interface is used only to define common functionality
24  * between {@link DOMStore} and {@link DOMStoreTransactionChain}, which
25  * further specify behaviour of returned transactions.
26  *
27  */
28 public interface DOMStoreTransactionFactory {
29
30     /**
31      *
32      * Creates a read only transaction
33      *
34      * <p>
35      * Creates a new read-only transaction, which provides read access to
36      * snapshot of current state.
37      *
38      * See {@link DOMStoreReadTransaction} for more information.
39      *
40      * @return new {@link DOMStoreReadTransaction}
41      * @throws IllegalStateException
42      *             If state of factory prevents allocating new transaction.
43      *
44      */
45     DOMStoreReadTransaction newReadOnlyTransaction();
46
47     /**
48      * Creates write only transaction
49      *
50      * <p>
51      * See {@link DOMStoreWriteTransaction} for more information.
52      *
53      * @return new {@link DOMStoreWriteTransaction}
54      * @throws IllegalStateException If state of factory prevents allocating new transaction.
55      */
56     DOMStoreWriteTransaction newWriteOnlyTransaction();
57
58     /**
59      * Creates Read-Write transaction
60      *
61      * <p>
62      * See {@link DOMStoreReadWriteTransaction} for more information.
63      *
64      * @return  new {@link DOMStoreWriteTransaction}
65      * @throws IllegalStateException If state of factory prevents allocating new transaction.
66      */
67     DOMStoreReadWriteTransaction newReadWriteTransaction();
68
69 }