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.controller.sal.core.spi.data;
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 DOMStore, DOMStoreTransactionChain for concrete variations of this factory.
22 * <b>Note:</b> This interface is used only to define common functionality
23 * between {@link DOMStore} and {@link DOMStoreTransactionChain}, which
24 * further specify behaviour of returned transactions.
27 public interface DOMStoreTransactionFactory {
30 * Creates a read only transaction.
33 * Creates a new read-only transaction, which provides read access to
34 * snapshot of current state.
36 * @see DOMStoreReadTransaction for more information.
37 * @return new {@link DOMStoreReadTransaction}
38 * @throws IllegalStateException
39 * If state of factory prevents allocating new transaction.
42 DOMStoreReadTransaction newReadOnlyTransaction();
45 * Creates write only transaction.
47 * @see DOMStoreWriteTransaction for more information.
48 * @return new {@link DOMStoreWriteTransaction}
49 * @throws IllegalStateException If state of factory prevents allocating new transaction.
51 DOMStoreWriteTransaction newWriteOnlyTransaction();
54 * Creates Read-Write transaction.
56 * @see DOMStoreReadWriteTransaction for more information.
57 * @return new {@link DOMStoreWriteTransaction}
58 * @throws IllegalStateException If state of factory prevents allocating new transaction.
60 DOMStoreReadWriteTransaction newReadWriteTransaction();