Check time expiry before attempting to format notification
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / streams / listeners / ListenerAdapter.java
index b014859f927dca6f9ea66e2a449706153acfb892..5a13a0211c6ffe9a566a87cfccb91bd301e41302 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.netconf.sal.streams.listeners;
 
 import com.google.common.base.Preconditions;
 import java.io.IOException;
+import java.time.Instant;
 import java.util.Collection;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -76,8 +77,13 @@ public class ListenerAdapter extends AbstractCommonSubscriber implements Cluster
 
     @Override
     public void onDataTreeChanged(@Nonnull final Collection<DataTreeCandidate> dataTreeCandidates) {
+        final Instant now = Instant.now();
+        if (!checkStartStop(now, this)) {
+            return;
+        }
+
         final String xml = prepareXml(dataTreeCandidates);
-        if (checkQueryParams(xml, this)) {
+        if (checkFilter(xml)) {
             prepareAndPostData(xml);
         }
     }