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