Skip to content

Commit 47a95ea

Browse files
authored
NIFI-14996 Added Clear Component methods to Bulletin Repository (#23)
Signed-off-by: David Handermann <[email protected]>
1 parent 672cbb5 commit 47a95ea

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/main/java/org/apache/nifi/reporting/BulletinRepository.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package org.apache.nifi.reporting;
1818

19+
import java.time.Instant;
20+
import java.util.Collection;
1921
import java.util.List;
2022

2123
/**
@@ -106,4 +108,24 @@ public interface BulletinRepository {
106108
* @return the max ID of any bulletin that has been added, or -1 if no bulletins have been added
107109
*/
108110
long getMaxBulletinId();
111+
112+
/**
113+
* Clears bulletins for the specified component that were created on or before the given timestamp.
114+
*
115+
* @param sourceId the ID of the source component whose bulletins should be cleared
116+
* @param fromTimestamp the timestamp from which bulletins should be cleared (inclusive)
117+
* @return the number of bulletins that were cleared
118+
* @throws IllegalArgumentException if the sourceId is null or empty or if fromTimestamp is null
119+
*/
120+
int clearBulletinsForComponent(String sourceId, Instant fromTimestamp) throws IllegalArgumentException;
121+
122+
/**
123+
* Clears bulletins for the specified components that were created on or before the given timestamp.
124+
*
125+
* @param sourceIds the collection of source component IDs whose bulletins should be cleared
126+
* @param fromTimestamp the timestamp from which bulletins should be cleared (inclusive)
127+
* @return the total number of bulletins that were cleared across all specified components
128+
* @throws IllegalArgumentException if sourceIds is null or empty or if fromTimestamp is null
129+
*/
130+
int clearBulletinsForComponents(Collection<String> sourceIds, Instant fromTimestamp) throws IllegalArgumentException;
109131
}

0 commit comments

Comments
 (0)