Check time expiry before attempting to format notification
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / streams / listeners / NotificationListenerAdapter.java
index f3193e7993d9f81e4a69cc9bf9c6253ed93ca59a..c131237cb7e11d75ce3c988f89c110814f14fc5e 100644 (file)
@@ -80,9 +80,14 @@ public class NotificationListenerAdapter extends AbstractCommonSubscriber implem
 
     @Override
     public void onNotification(final DOMNotification notification) {
+        final Instant now = Instant.now();
+        if (!checkStartStop(now, this)) {
+            return;
+        }
+
         final SchemaContext schemaContext = controllerContext.getGlobalSchema();
         final String xml = prepareXml(schemaContext, notification);
-        if (checkQueryParams(xml, this)) {
+        if (checkFilter(xml)) {
             prepareAndPostData(outputType.equals("JSON") ? prepareJson(schemaContext, notification) : xml);
         }
     }