809a34f7d75181b37c1667e1ff215a3def168a1a
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMDataTreeListener.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.mdsal.dom.api;
9
10 import java.util.Collection;
11 import java.util.EventListener;
12 import java.util.Map;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
16
17 /**
18  * Interface implemented by data consumers, e.g. processes wanting to act on data
19  * after it has been introduced to the conceptual data tree.
20  *
21  * @deprecated This interface is scheduled for removal in the next major release.
22  */
23 @Deprecated(forRemoval = true)
24 public interface DOMDataTreeListener extends EventListener {
25     /**
26      * Invoked whenever one or more registered subtrees change. The logical changes are reported,
27      * as well as the roll up of new state for all subscribed subtrees.
28      *
29      * @param changes The set of changes being reported. Each subscribed subtree may be present
30      *                at most once.
31      * @param subtrees Per-subtree state as visible after the reported changes have been applied.
32      *                 This includes all the subtrees this listener is subscribed to, even those
33      *                 which have not changed.
34      */
35     void onDataTreeChanged(@NonNull Collection<DataTreeCandidate> changes,
36             @NonNull Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>> subtrees);
37
38     /**
39      * Invoked when a subtree listening failure occurs. This can be triggered, for example, when a
40      * connection to external subtree source is broken. The listener will not receive any other
41      * callbacks, but its registration still needs to be closed to prevent resource leak.
42      *
43      * @param causes Collection of failure causes, may not be null or empty.
44      */
45     void onDataTreeFailed(@NonNull Collection<DOMDataTreeListeningException> causes);
46 }