import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.controller.md.sal.common.api.data.DataChangeListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-public interface DOMStore {
+/**
+ * DOM Data Store
+ *
+ * <p>
+ * DOM Data Store provides transactional tree-like storage for YANG-modeled
+ * entities described by YANG schema and represented by {@link NormalizedNode}.
+ *
+ * Read and write access to stored data is provided only via transactions
+ * created using {@link #newReadOnlyTransaction()},
+ * {@link #newWriteOnlyTransaction()} and {@link #newReadWriteTransaction()}, or
+ * by creating {@link org.opendaylight.controller.md.sal.common.api.data.TransactionChain}.
+ *
+ */
+public interface DOMStore extends DOMStoreTransactionFactory {
/**
+ * Registers {@link org.opendaylight.controller.md.sal.common.api.data.DataChangeListener} for Data Change callbacks which will
+ * be triggered on the change of provided subpath. What constitutes a change
+ * depends on the @scope parameter.
*
- * Creates a read only transaction
+ * Listener upon registration receives an initial callback
+ * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent)}
+ * which contains stable view of data tree at the time of registration.
*
- * @return
- */
- DOMStoreReadTransaction newReadOnlyTransaction();
-
- /**
- * Creates write only transaction
+ * @param path Path (subtree identifier) on which client listener will be
+ * invoked.
*
- * @return
- */
- DOMStoreWriteTransaction newWriteOnlyTransaction();
-
- /**
- * Creates Read-Write transaction
+ * @param listener
+ * Instance of listener which should be invoked on
+ * @param scope
+ * Scope of change which triggers callback.
+ * @return Listener Registration object, which client may use to close
+ * registration / interest on receiving data changes.
*
- * @return
*/
- DOMStoreReadWriteTransaction newReadWriteTransaction();
+ <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
+ YangInstanceIdentifier path, L listener, DataChangeScope scope);
/**
- * Registers {@link DataChangeListener} for Data Change callbacks
- * which will be triggered on the change of provided subpath. What
- * constitutes a change depends on the @scope parameter.
*
- * Listener upon registration receives an initial callback
- * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent)}
- * which contains stable view of data tree at the time of registration.
+ * Creates new transaction chain.
+ *
+ * Transactions in a chain need to be committed in sequence and each
+ * transaction should see the effects of previous transactions as if they
+ * happened.
*
- * @param path Path (subtree identifier) on which client listener will be invoked.
- * @param listener Instance of listener which should be invoked on
- * @param scope Scope of change which triggers callback.
- * @return Listener Registration object, which client may use to close registration
- * / interest on receiving data changes.
+ * See {@link DOMStoreTransactionChain} for more information.
*
+ * @return Newly created transaction chain.
*/
- <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
- InstanceIdentifier path, L listener, DataChangeScope scope);
+ DOMStoreTransactionChain createTransactionChain();
}