Merge "Added karaf branding."
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / sal / core / spi / data / DOMStore.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.core.spi.data;
9
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.InstanceIdentifier;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
15
16 /**
17  * DOM Data Store
18  *
19  * <p>
20  * DOM Data Store provides transactional tree-like storage for YANG-modeled
21  * entities described by YANG schema and represented by {@link NormalizedNode}.
22  *
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}.
27  *
28  */
29 public interface DOMStore extends DOMStoreTransactionFactory {
30
31     /**
32      * Registers {@link org.opendaylight.controller.md.sal.common.api.data.DataChangeListener} for Data Change callbacks which will
33      * be triggered on the change of provided subpath. What constitutes a change
34      * depends on the @scope parameter.
35      *
36      * Listener upon registration receives an initial callback
37      * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent)}
38      * which contains stable view of data tree at the time of registration.
39      *
40      *  @param path Path (subtree identifier) on which client listener will be
41      * invoked.
42      *
43      * @param listener
44      *            Instance of listener which should be invoked on
45      * @param scope
46      *            Scope of change which triggers callback.
47      * @return Listener Registration object, which client may use to close
48      *         registration / interest on receiving data changes.
49      *
50      */
51     <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
52             InstanceIdentifier path, L listener, DataChangeScope scope);
53
54     /**
55      *
56      * Creates new transaction chain.
57      *
58      * Transactions in a chain need to be committed in sequence and each
59      * transaction should see the effects of previous transactions as if they
60      * happened.
61      *
62      * See {@link DOMStoreTransactionChain} for more information.
63      *
64      * @return Newly created transaction chain.
65      */
66     DOMStoreTransactionChain createTransactionChain();
67
68 }