2 * Copyright (c) 2015 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.mdsal.binding.api;
10 import java.util.Collection;
11 import java.util.EventListener;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
17 * Interface implemented by data consumers, e.g. processes wanting to act on data after it has been
18 * introduced to the conceptual data tree.
20 public interface DataTreeListener extends EventListener {
22 * Invoked whenever one or more registered subtrees change. The logical changes are reported, as
23 * well as the roll up of new state for all subscribed subtrees.
25 * @param changes The set of changes being reported. Each subscribed subtree may be present at
27 * @param subtrees Per-subtree state as visible after the reported changes have been applied.
28 * This includes all the subtrees this listener is subscribed to, even those which have
31 void onDataTreeChanged(@NonNull Collection<DataTreeModification<?>> changes,
32 @NonNull Map<DataTreeIdentifier<?>, DataObject> subtrees);
35 * Invoked when a subtree listening failure occurs. This can be triggered, for example, when a
36 * connection to external subtree source is broken. The listener will not receive any other
37 * callbacks, but its registration still needs to be closed to prevent resource leak.
39 * @param causes Collection of failure causes, may not be null or empty.
41 void onDataTreeFailed(@NonNull Collection<DataTreeListeningException> causes);