Log data after in IdIntsDOMDataTreeLIstener
[controller.git] / opendaylight / md-sal / samples / clustering-test-app / provider / src / main / java / org / opendaylight / controller / clustering / it / provider / impl / IdIntsDOMDataTreeLIstener.java
index be46a0ee31de218821f04672fd695be799a3b8c2..1fa3f1b61b24367a377202e1dddf635cb727ea02 100644 (file)
@@ -38,13 +38,16 @@ public class IdIntsDOMDataTreeLIstener implements DOMDataTreeListener {
 
         changes.forEach(change -> {
             if (change.getRootNode().getDataAfter().isPresent()) {
-                LOG.trace("Received change, data before: {}, data after: ", change.getRootNode().getDataBefore().get(),
+                LOG.trace("Received change, data before: {}, data after: {}",
+                        change.getRootNode().getDataBefore().isPresent()
+                                ? change.getRootNode().getDataBefore().get() : "",
                         change.getRootNode().getDataAfter().get());
 
                 if (localCopy == null || checkEqual(change.getRootNode().getDataBefore().get())) {
                     localCopy = change.getRootNode().getDataAfter().get();
                 } else {
-                    LOG.debug("Ignoring notification: {}", change);
+                    LOG.warn("Ignoring notification.");
+                    LOG.trace("Ignored notification content: {}", change);
                 }
             } else {
                 LOG.warn("getDataAfter() is missing from notification. change: {}", change);
@@ -57,6 +60,10 @@ public class IdIntsDOMDataTreeLIstener implements DOMDataTreeListener {
 
     }
 
+    public boolean hasTriggered() {
+        return localCopy != null;
+    }
+
     public boolean checkEqual(final NormalizedNode<?, ?> expected) {
         return localCopy.equals(expected);
     }