Deprecate old MD-SAL APIs for removal
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / md / sal / dom / api / DOMDataTreeChangeListener.java
1 /*
2  * Copyright (c) 2015 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.md.sal.dom.api;
9
10 import java.util.Collection;
11 import java.util.EventListener;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
14
15 /**
16  * Interface implemented by classes interested in receiving notifications about
17  * data tree changes. This interface provides a cursor-based view of the change, which has potentially
18  * lower overhead.
19  *
20  * <p>
21  * Note: this interface enables notifications only at the leader of the data store, if clustered. If you want
22  * notifications on all instances in a cluster, use the {@link ClusteredDOMDataTreeChangeListener}.
23  *
24  * @deprecated Use {@link org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener} instead.
25  */
26 @Deprecated(forRemoval = true)
27 public interface DOMDataTreeChangeListener extends EventListener {
28     /**
29      * Invoked when there was data change for the supplied path, which was used
30      * to register this listener.
31      *
32      * <p>
33      * This method may be also invoked during registration of the listener if
34      * there is any pre-existing data in the conceptual data tree for supplied
35      * path. This initial event will contain all pre-existing data as created.
36      *
37      * <p>
38      * A data change event may be triggered spuriously, e.g. such that data before
39      * and after compare as equal. Implementations of this interface are expected
40      * to recover from such events. Event producers are expected to exert reasonable
41      * effort to suppress such events.
42      *
43      * <p>
44      * In other words, it is completely acceptable to observe
45      * a {@link org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode},
46      * which reports a {@link org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType}
47      * other than UNMODIFIED, while the before- and after- data items compare as
48      * equal.
49      *
50      * @param changes Collection of change events, may not be null or empty.
51      */
52     void onDataTreeChanged(@NonNull Collection<DataTreeCandidate> changes);
53 }