Check time expiry before attempting to format notification
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / streams / listeners / AbstractQueryParams.java
index 93dfc8030990af082e91f00a9204773165d41b85..1854a1dfc549a03a45c6a6f1890c647564f1177e 100644 (file)
@@ -89,20 +89,11 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
         return leafNodesOnly;
     }
 
-    /**
-     * Checking query parameters on specific notification.
-     *
-     * @param xml       data of notification
-     * @param listener  listener of notification
-     * @return true if notification meets the requirements of query parameters,
-     *         false otherwise
-     */
     @SuppressWarnings("checkstyle:IllegalCatch")
-    protected <T extends BaseListenerInterface> boolean checkQueryParams(final String xml, final T listener) {
-        final Instant now = Instant.now();
+    <T extends BaseListenerInterface> boolean checkStartStop(final Instant now, final T listener) {
         if (this.stop != null) {
-            if ((this.start.compareTo(now) < 0) && (this.stop.compareTo(now) > 0)) {
-                return checkFilter(xml);
+            if (this.start.compareTo(now) < 0 && this.stop.compareTo(now) > 0) {
+                return true;
             }
             if (this.stop.compareTo(now) < 0) {
                 try {
@@ -114,10 +105,10 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
         } else if (this.start != null) {
             if (this.start.compareTo(now) < 0) {
                 this.start = null;
-                return checkFilter(xml);
+                return true;
             }
         } else {
-            return checkFilter(xml);
+            return true;
         }
         return false;
     }
@@ -128,7 +119,7 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
      * @param xml   data of notification
      */
     @SuppressWarnings("checkstyle:IllegalCatch")
-    private boolean checkFilter(final String xml) {
+    boolean checkFilter(final String xml) {
         if (this.filter == null) {
             return true;
         }