X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fapi%2FDataTreeChangeListener.java;h=c9d4a351be1ab0ef119b00e530823638bf2cf11c;hb=d2c0f28aef06857cbe7fcfb96a7745055b290db4;hp=3e066757d6a27353a35b597a42ab9cd7243f9612;hpb=fa49cff3709ce3bb64f0d4c473af477431d10cf0;p=mdsal.git diff --git a/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/DataTreeChangeListener.java b/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/DataTreeChangeListener.java index 3e066757d6..c9d4a351be 100644 --- a/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/DataTreeChangeListener.java +++ b/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/DataTreeChangeListener.java @@ -7,49 +7,49 @@ */ package org.opendaylight.mdsal.binding.api; -import java.util.Collection; -import java.util.EventListener; +import java.util.List; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.binding.DataObject; /** - * Interface implemented by classes interested in receiving notifications about - * data tree changes. It provides a cursor-based view of the change, which has potentially - * lower overhead and allow more flexible consumption of change event. + * Interface implemented by classes interested in receiving notifications about changes to a data tree. It provides + * a cursor-based view of the change, which has potentially lower overhead and allow more flexible consumption of change + * events. */ -public interface DataTreeChangeListener extends EventListener { +public interface DataTreeChangeListener { /** - * Invoked when there was data change for the supplied path, which was used - * to register this listener. + * Invoked when there was data change for the supplied path, which was used to register this listener. * *

- * This method may be also invoked during registration of the listener if - * there is any pre-existing data in the conceptual data tree for supplied - * path. This initial event will contain all pre-existing data as created. + * This method may be also invoked during registration of the listener if there is any pre-existing data in the + * conceptual data tree for supplied path. This initial event will contain all pre-existing data as created. * *

- * A data change event may be triggered spuriously, e.g. such that data before - * and after compare as equal. Implementations of this interface are expected - * to recover from such events. Event producers are expected to exert reasonable - * effort to suppress such events. + * Note: If there is no pre-existing data, the method {@link #onInitialData} will be invoked. + * + *

+ * A data change event may be triggered spuriously, e.g. such that data before and after compare as equal. + * Implementations of this interface are expected to recover from such events. Event producers are expected to exert + * reasonable effort to suppress such events. * *

- * In other words, it is completely acceptable to observe - * a {@link DataObjectModification}, while the state observed before and - * after- data items compare as equal. + * In other words, it is completely acceptable to observe a {@link DataObjectModification}, while the state observed + * before and after- data items compare as equal. * - * @param changes Collection of change events, may not be null or empty. + * @param changes List of change events, may not be null or empty. */ - void onDataTreeChanged(@NonNull Collection> changes); + void onDataTreeChanged(@NonNull List> changes); /** - * Invoked only once during registration of the listener if there was no data in the conceptual data tree - * for the supplied path, which was used to register this listener, and after this {@link #onDataTreeChanged} - * would always be invoked for data changes. + * Invoked only once during registration of the listener if there was no data in the conceptual data tree for the + * supplied path, which was used to register this listener, and after this {@link #onDataTreeChanged(List)} would + * always be invoked for data changes. * *

- * Users not care about this event could leave it as default with no-op. + * Default implementation does nothing and is appropriate for users who do not care about ascertaining initial + * state. */ + // FIXME: 14.0.0: this method should be non-default default void onInitialData() { //no-op }