/* * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.mdsal.binding.api; import java.util.Collection; import java.util.EventListener; import java.util.Map; import javax.annotation.Nonnull; import org.opendaylight.yangtools.yang.binding.DataObject; /** * Interface implemented by data consumers, e.g. processes wanting to act on data after it has been * introduced to the conceptual data tree. */ public interface DataTreeListener extends EventListener { /** * Invoked whenever one or more registered subtrees change. The logical changes are reported, as * well as the roll up of new state for all subscribed subtrees. * * @param changes The set of changes being reported. Each subscribed subtree may be present at * most once. * @param subtrees Per-subtree state as visible after the reported changes have been applied. * This includes all the subtrees this listener is subscribed to, even those which have * not changed. */ void onDataTreeChanged(@Nonnull Collection> changes, @Nonnull Map, DataObject> subtrees); /** * Invoked when a subtree listening failure occurs. This can be triggered, for example, when a * connection to external subtree source is broken. The listener will not receive any other * callbacks, but its registration still needs to be closed to prevent resource leak. * * @param causes Collection of failure causes, may not be null or empty. */ void onDataTreeFailed(@Nonnull Collection causes); }