From 47e878f48e571f80a9ffd75d8b51b665d3ad8c12 Mon Sep 17 00:00:00 2001 From: Jie Han Date: Wed, 12 Dec 2018 09:09:37 +0800 Subject: [PATCH] Fixup (DOM)DataTreeChangeListener a bit According to comments of https://git.opendaylight.org/gerrit/#/c/77070/ - replace 'onInitialData' with 'onEmptyInitialData' in (DOM)DataTreeChangeListener - fixup javadoc description Change-Id: I50a1b903c365157265512eefce9811cbdd3d6350 Signed-off-by: Jie Han --- .../mdsal/binding/api/DataTreeChangeListener.java | 6 +++++- .../mdsal/dom/api/DOMDataTreeChangeListener.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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..4b2ea06eda 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 @@ -28,6 +28,9 @@ public interface DataTreeChangeListener extends EventListe * path. This initial event will contain all pre-existing data as created. * *

+ * 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 @@ -48,7 +51,8 @@ public interface DataTreeChangeListener extends EventListe * 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. */ default void onInitialData() { //no-op diff --git a/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeChangeListener.java b/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeChangeListener.java index 7068210858..d3d78a7954 100644 --- a/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeChangeListener.java +++ b/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeChangeListener.java @@ -25,6 +25,9 @@ public interface DOMDataTreeChangeListener extends EventListener { * 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 {@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 @@ -43,7 +46,8 @@ public interface DOMDataTreeChangeListener extends EventListener { * 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 stat. */ default void onInitialData() { //no-op -- 2.36.6