public interface DataTreeChangeListener<T extends DataObject> extends EventListener
Modifier and Type | Method and Description |
---|---|
void |
onDataTreeChanged(@NonNull Collection<DataTreeModification<T>> changes)
Invoked when there was data change for the supplied path, which was used
to register this listener.
|
default void |
onInitialData()
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
onDataTreeChanged(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<T>>)
would always be invoked for data changes. |
void onDataTreeChanged(@NonNull Collection<DataTreeModification<T>> changes)
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.
Note: If there is no pre-existing data, the method 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 DataObjectModification
, while the state observed before and
after- data items compare as equal.
changes
- Collection of change events, may not be null or empty.default void onInitialData()
onDataTreeChanged(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<T>>)
would always be invoked for data changes.
Default implementation does nothing and is appropriate for users who do not care about ascertaining initial state.
Copyright © 2019 OpenDaylight. All rights reserved.