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.md.sal.common.api.data;
10 import org.opendaylight.yangtools.concepts.Path;
13 * Base interface that provides access to a conceptual data tree store and also provides the ability to
14 * subscribe for changes to data under a given branch of the tree.
17 * All operations on the data tree are performed via one of the transactions:
19 * <li>Read-Only - allocated using {@link #newReadOnlyTransaction()}
20 * <li>Write-Only - allocated using {@link #newWriteOnlyTransaction()}
21 * <li>Read-Write - allocated using {@link #newReadWriteTransaction()}
25 * These transactions provide a stable isolated view of data tree, which is
26 * guaranteed to be not affected by other concurrent transactions, until
27 * transaction is committed.
30 * For a detailed explanation of how transaction are isolated and how transaction-local
31 * changes are committed to global data tree, see
32 * {@link AsyncReadTransaction}, {@link AsyncWriteTransaction},
33 * {@link AsyncReadWriteTransaction} and {@link AsyncWriteTransaction#submit()}.
37 * It is strongly recommended to use the type of transaction, which
38 * provides only the minimal capabilities you need. This allows for
39 * optimizations at the data broker / data store level. For example,
40 * implementations may optimize the transaction for reading if they know ahead
41 * of time that you only need to read data - such as not keeping additional meta-data,
42 * which may be required for write transactions.
45 * <b>Implementation Note:</b> This interface is not intended to be implemented
46 * by users of MD-SAL, but only to be consumed by them.
49 * Type of path (subtree identifier), which represents location in
52 * Type of data (payload), which represents data payload
54 public interface AsyncDataBroker<P extends Path<P>, D> extends AsyncDataTransactionFactory<P, D> {
57 AsyncReadOnlyTransaction<P, D> newReadOnlyTransaction();
60 AsyncReadWriteTransaction<P, D> newReadWriteTransaction();
63 AsyncWriteTransaction<P, D> newWriteOnlyTransaction();