Add changed-leaf-nodes-only subscription extension
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / streams / listeners / AbstractCommonSubscriber.java
index d83e15e63bb67206f020db6ba81ad5a634da7b79..82e7a6219dd32bf4196d0f8c5d91787a0110ae51 100644 (file)
@@ -66,6 +66,7 @@ abstract class AbstractCommonSubscriber<P, T> extends AbstractNotificationsData
     private Instant stop = null;
     private boolean leafNodesOnly = false;
     private boolean skipNotificationData = false;
+    private boolean changedLeafNodesOnly = false;
     private EventFormatter<T> formatter;
 
     AbstractCommonSubscriber(final QName lastQName, final String streamName, final P path,
@@ -151,6 +152,9 @@ abstract class AbstractCommonSubscriber<P, T> extends AbstractNotificationsData
         final var skipData = params.skipNotificationData();
         skipNotificationData = skipData == null ? false : skipData.value();
 
+        final var changedLeafNodes = params.changedLeafNodesOnly();
+        changedLeafNodesOnly = changedLeafNodes == null ? false : changedLeafNodes.value();
+
         final var filter = params.filter();
         final String filterValue = filter == null ? null : filter.paramValue();
         if (filterValue != null && !filterValue.isEmpty()) {
@@ -177,6 +181,15 @@ abstract class AbstractCommonSubscriber<P, T> extends AbstractNotificationsData
         return leafNodesOnly;
     }
 
+    /**
+     * Check whether this query should only notify about leaf node changes and report only changed nodes.
+     *
+     * @return true if this query should only notify about leaf node changes and report only changed nodes
+     */
+    final boolean getChangedLeafNodesOnly() {
+        return changedLeafNodesOnly;
+    }
+
     /**
      * Check whether this query should notify changes without data.
      *