Skip to content

Commit 1ecc43e

Browse files
NIFI-14996 Added default implementation for clear Bulletin methods (#24)
1 parent 47a95ea commit 1ecc43e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,30 @@ public interface BulletinRepository {
112112
/**
113113
* Clears bulletins for the specified component that were created on or before the given timestamp.
114114
*
115+
* @since 2.4.0
116+
*
115117
* @param sourceId the ID of the source component whose bulletins should be cleared
116118
* @param fromTimestamp the timestamp from which bulletins should be cleared (inclusive)
117119
* @return the number of bulletins that were cleared
118120
* @throws IllegalArgumentException if the sourceId is null or empty or if fromTimestamp is null
121+
* @throws UnsupportedOperationException Thrown in the default implementation when clearing Bulletins is not implemented
119122
*/
120-
int clearBulletinsForComponent(String sourceId, Instant fromTimestamp) throws IllegalArgumentException;
123+
default int clearBulletinsForComponent(String sourceId, Instant fromTimestamp) throws IllegalArgumentException {
124+
throw new UnsupportedOperationException("Clear Bulletins for Component not supported");
125+
}
121126

122127
/**
123128
* Clears bulletins for the specified components that were created on or before the given timestamp.
124129
*
130+
* @since 2.4.0
131+
*
125132
* @param sourceIds the collection of source component IDs whose bulletins should be cleared
126133
* @param fromTimestamp the timestamp from which bulletins should be cleared (inclusive)
127134
* @return the total number of bulletins that were cleared across all specified components
128135
* @throws IllegalArgumentException if sourceIds is null or empty or if fromTimestamp is null
136+
* @throws UnsupportedOperationException Thrown in the default implementation when clearing Bulletins is not implemented
129137
*/
130-
int clearBulletinsForComponents(Collection<String> sourceIds, Instant fromTimestamp) throws IllegalArgumentException;
138+
default int clearBulletinsForComponents(Collection<String> sourceIds, Instant fromTimestamp) throws IllegalArgumentException {
139+
throw new UnsupportedOperationException("Clear Bulletins for Components not supported");
140+
}
131141
}

0 commit comments

Comments
 (0)