Extend Websocket streams for data-less notifications
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / streams / listeners / AbstractQueryParams.java
index 15b217da1b6714b917974f769a99c9849d344987..9df8cb8e0c4d926a2c16134f44f621786bcd7281 100644 (file)
@@ -52,6 +52,7 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
     private Instant stop = null;
     private String filter = null;
     private boolean leafNodesOnly = false;
+    private boolean skipNotificationData = false;
 
     @VisibleForTesting
     public final Instant getStart() {
@@ -68,11 +69,12 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
      */
     @SuppressWarnings("checkstyle:hiddenField")
     public void setQueryParams(final Instant start, final Instant stop, final String filter,
-            final boolean leafNodesOnly) {
+            final boolean leafNodesOnly, final boolean skipNotificationData) {
         this.start = requireNonNull(start);
         this.stop = stop;
         this.filter = filter;
         this.leafNodesOnly = leafNodesOnly;
+        this.skipNotificationData = skipNotificationData;
     }
 
     /**
@@ -84,6 +86,15 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
         return leafNodesOnly;
     }
 
+    /**
+     * Check whether this query should notify changes without data.
+     *
+     * @return true if this query should notify about changes with  data
+     */
+    public boolean isSkipNotificationData() {
+        return skipNotificationData;
+    }
+
     @SuppressWarnings("checkstyle:IllegalCatch")
     <T extends BaseListenerInterface> boolean checkStartStop(final Instant now, final T listener) {
         if (this.stop != null) {
@@ -137,4 +148,4 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
         // FIXME: BUG-7956: xPath.setNamespaceContext(nsContext);
         return (boolean) xPath.compile(this.filter).evaluate(docOfXml, XPathConstants.BOOLEAN);
     }
-}
\ No newline at end of file
+}