2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.dom.spi.store;
11 * Factory for DOM Store Transactions
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}.
19 * See {@link DOMStore} or {@link DOMStoreTransactionChain} for concrete
20 * variations of this factory.
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.
28 public interface DOMStoreTransactionFactory {
32 * Creates a read only transaction
35 * Creates a new read-only transaction, which provides read access to
36 * snapshot of current state.
38 * See {@link DOMStoreReadTransaction} for more information.
40 * @return new {@link DOMStoreReadTransaction}
41 * @throws IllegalStateException
42 * If state of factory prevents allocating new transaction.
45 DOMStoreReadTransaction newReadOnlyTransaction();
48 * Creates write only transaction
51 * See {@link DOMStoreWriteTransaction} for more information.
53 * @return new {@link DOMStoreWriteTransaction}
54 * @throws IllegalStateException If state of factory prevents allocating new transaction.
56 DOMStoreWriteTransaction newWriteOnlyTransaction();
59 * Creates Read-Write transaction
62 * See {@link DOMStoreReadWriteTransaction} for more information.
64 * @return new {@link DOMStoreWriteTransaction}
65 * @throws IllegalStateException If state of factory prevents allocating new transaction.
67 DOMStoreReadWriteTransaction newReadWriteTransaction();