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;
10 import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
11 import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
13 import org.opendaylight.yangtools.concepts.ListenerRegistration;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
21 * DOM Data Store provides transactional tree-like storage for YANG-modeled
22 * entities described by YANG schema and represented by {@link NormalizedNode}.
24 * Read and write access to stored data is provided only via transactions
25 * created using {@link #newReadOnlyTransaction()},
26 * {@link #newWriteOnlyTransaction()} and {@link #newReadWriteTransaction()}, or
27 * by creating {@link org.opendaylight.mdsal.common.api.TransactionChain}.
30 public interface DOMStore extends DOMStoreTransactionFactory {
33 * Registers {@link AsyncDataChangeListener} for Data Change callbacks which will be triggered
34 * on the change of provided subpath. What constitutes a change depends on the @scope parameter.
36 * Listener upon registration receives an initial callback
37 * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.mdsal.common.api.AsyncDataChangeEvent)}
38 * which contains stable view of data tree at the time of registration.
40 * @param path Path (subtree identifier) on which client listener will be invoked.
42 * @param listener Instance of listener which should be invoked on
43 * @param scope Scope of change which triggers callback.
44 * @return Listener Registration object, which client may use to close registration / interest
45 * on receiving data changes.
48 <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
49 YangInstanceIdentifier path, L listener, DataChangeScope scope);
53 * Creates new transaction chain.
55 * Transactions in a chain need to be committed in sequence and each
56 * transaction should see the effects of previous transactions as if they
59 * See {@link DOMStoreTransactionChain} for more information.
61 * @return Newly created transaction chain.
63 DOMStoreTransactionChain createTransactionChain();