2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.api;
10 import org.opendaylight.mdsal.common.api.AsyncDataTransactionFactory;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
15 * A factory which allocates new transactions to operate on the data tree.
18 * <b>Note:</b> This interface is not intended to be used directly, but rather via subinterfaces
19 * which introduces additional semantics to allocated transactions.
21 * <li> {@link DOMDataBroker}
22 * <li> {@link DOMTransactionChain}
26 * All operations on the data tree are performed via one of the transactions:
28 * <li>Read-Only - allocated using {@link #newReadOnlyTransaction()}
29 * <li>Write-Only - allocated using {@link #newWriteOnlyTransaction()}
33 * These transactions provides a stable isolated view of the data tree, which is guaranteed to be
34 * not affected by other concurrent transactions, until transaction is committed.
37 * For a detailed explanation of how transaction are isolated and how transaction-local changes are
38 * committed to global data tree, see {@link DOMDataTreeReadTransaction}, {@link DOMDataTreeWriteTransaction}
39 * and {@link DOMDataTreeWriteTransaction#commit()}.
42 * It is strongly recommended to use the type of transaction, which provides only the minimal
43 * capabilities you need. This allows for optimizations at the data broker / data store level. For
44 * example, implementations may optimize the transaction for reading if they know ahead of time that
45 * you only need to read data - such as not keeping additional meta-data, which may be required for
49 * <b>Implementation Note:</b> This interface is not intended to be implemented by users of MD-SAL,
50 * but only to be consumed by them.
53 * @see DOMTransactionChain
55 public interface DOMTransactionFactory
56 extends AsyncDataTransactionFactory<YangInstanceIdentifier, NormalizedNode<?, ?>> {
59 DOMDataTreeReadTransaction newReadOnlyTransaction();
62 DOMDataTreeWriteTransaction newWriteOnlyTransaction();
65 DOMDataTreeReadWriteTransaction newReadWriteTransaction();