Check time expiry before attempting to format notification
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / streams / listeners / NotificationListenerAdapter.java
index 14a345a209e36dbf6352303d5bc800a6ad66222d..1814f07113dca03db5ff617736684868bc29e2ed 100644 (file)
@@ -78,9 +78,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 = schemaHandler.get();
         final String xml = prepareXml(schemaContext, notification);
-        if (checkQueryParams(xml, this)) {
+        if (checkFilter(xml)) {
             prepareAndPostData(outputType.equals("JSON") ? prepareJson(schemaContext, notification) : xml);
         }
     }