This is an automated email from the ASF dual-hosted git repository.

mcgilman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-api.git


The following commit(s) were added to refs/heads/main by this push:
     new 1ecc43e  NIFI-14996 Added default implementation for clear Bulletin 
methods (#24)
1ecc43e is described below

commit 1ecc43ecb186802c375a5488518fbb9814625421
Author: David Handermann <[email protected]>
AuthorDate: Mon Oct 13 07:54:47 2025 -0500

    NIFI-14996 Added default implementation for clear Bulletin methods (#24)
---
 .../java/org/apache/nifi/reporting/BulletinRepository.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/nifi/reporting/BulletinRepository.java 
b/src/main/java/org/apache/nifi/reporting/BulletinRepository.java
index f41c1cf..816fb8d 100644
--- a/src/main/java/org/apache/nifi/reporting/BulletinRepository.java
+++ b/src/main/java/org/apache/nifi/reporting/BulletinRepository.java
@@ -112,20 +112,30 @@ public interface BulletinRepository {
     /**
      * Clears bulletins for the specified component that were created on or 
before the given timestamp.
      *
+     * @since 2.4.0
+     *
      * @param sourceId the ID of the source component whose bulletins should 
be cleared
      * @param fromTimestamp the timestamp from which bulletins should be 
cleared (inclusive)
      * @return the number of bulletins that were cleared
      * @throws IllegalArgumentException if the sourceId is null or empty or if 
fromTimestamp is null
+     * @throws UnsupportedOperationException Thrown in the default 
implementation when clearing Bulletins is not implemented
      */
-    int clearBulletinsForComponent(String sourceId, Instant fromTimestamp) 
throws IllegalArgumentException;
+    default int clearBulletinsForComponent(String sourceId, Instant 
fromTimestamp) throws IllegalArgumentException {
+        throw new UnsupportedOperationException("Clear Bulletins for Component 
not supported");
+    }
 
     /**
      * Clears bulletins for the specified components that were created on or 
before the given timestamp.
      *
+     * @since 2.4.0
+     *
      * @param sourceIds the collection of source component IDs whose bulletins 
should be cleared
      * @param fromTimestamp the timestamp from which bulletins should be 
cleared (inclusive)
      * @return the total number of bulletins that were cleared across all 
specified components
      * @throws IllegalArgumentException if sourceIds is null or empty or if 
fromTimestamp is null
+     * @throws UnsupportedOperationException Thrown in the default 
implementation when clearing Bulletins is not implemented
      */
-    int clearBulletinsForComponents(Collection<String> sourceIds, Instant 
fromTimestamp) throws IllegalArgumentException;
+    default int clearBulletinsForComponents(Collection<String> sourceIds, 
Instant fromTimestamp) throws IllegalArgumentException {
+        throw new UnsupportedOperationException("Clear Bulletins for 
Components not supported");
+    }
 }

Reply via email to