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.controller.md.sal.common.api.data.DataChangeListener;
13 import org.opendaylight.yangtools.concepts.ListenerRegistration;
14 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 public interface DOMStore {
21 * Creates a read only transaction
25 DOMStoreReadTransaction newReadOnlyTransaction();
28 * Creates write only transaction
32 DOMStoreWriteTransaction newWriteOnlyTransaction();
35 * Creates Read-Write transaction
39 DOMStoreReadWriteTransaction newReadWriteTransaction();
42 * Registers {@link DataChangeListener} for Data Change callbacks
43 * which will be triggered on the change of provided subpath. What
44 * constitutes a change depends on the @scope parameter.
46 * Listener upon registration receives an initial callback
47 * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent)}
48 * which contains stable view of data tree at the time of registration.
50 * @param path Path (subtree identifier) on which client listener will be invoked.
51 * @param listener Instance of listener which should be invoked on
52 * @param scope Scope of change which triggers callback.
53 * @return Listener Registration object, which client may use to close registration
54 * / interest on receiving data changes.
57 <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
58 InstanceIdentifier path, L listener, DataChangeScope scope);