Extend Websocket streams for data-less notifications
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / streams / listeners / AbstractQueryParams.java
index 4327578d87db207b49eda14ad54662faa1d63cdb..469764628cfe452c39b4a6afd8959a9df3eea232 100644 (file)
@@ -54,6 +54,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() {
@@ -71,14 +72,17 @@ abstract class AbstractQueryParams extends AbstractNotificationsData {
      *            indicate which subset of all possible events are of interest
      * @param leafNodesOnly
      *            if true, notifications will contain changes to leaf nodes only
+     * @param skipNotificationData
+     *            if true, notification will not contain changed data
      */
     @SuppressWarnings("checkstyle:hiddenField")
     public void setQueryParams(final Instant start, final Optional<Instant> stop, final Optional<String> filter,
-                               final boolean leafNodesOnly) {
+                               final boolean leafNodesOnly, final boolean skipNotificationData) {
         this.start = requireNonNull(start);
         this.stop = stop.orElse(null);
         this.filter = filter.orElse(null);
         this.leafNodesOnly = leafNodesOnly;
+        this.skipNotificationData = skipNotificationData;
     }
 
     /**
@@ -90,6 +94,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) {