Interface NotificationStateRepository
- All Known Subinterfaces:
- NotificationStateRepositoryFragment
public interface NotificationStateRepository
Additional interface for repository instances that are capable of interacting with
 
NotificationState related information on NotificationStateAware domain.- Author:
- Jeff Fischer
- 
Method SummaryModifier and TypeMethodDescriptionfindNotificationReadyMembers(Object lastProcessedNativeId, int pageSize, String messageType, Duration faultThreshold, Class<?> entityType) Find any entity instances that are unacknowledged and qualified for retry for message sending.booleansetFailedNotificationAttempt(Object nativeId, String messageType, int attemptCount, Instant nextAttempt, Class<?> entityType, boolean stopped) Notate a failed message send attempt for a messageType on theNotificationStateof an entity of a particular type.booleansetNotificationAcknowledged(Object nativeId, String messageType, int attemptCount, Class<?> entityType) Establish acknowledged state for aNotificationStateof a particular messageType on an entity of a particular type.
- 
Method Details- 
setNotificationAcknowledgedboolean setNotificationAcknowledged(@NonNull Object nativeId, @NonNull String messageType, int attemptCount, @NonNull Class<?> entityType) Establish acknowledged state for aNotificationStateof a particular messageType on an entity of a particular type.- Parameters:
- nativeId- The primary key of the entity to update
- messageType- The type of message to ack
- attemptCount- The current attempt count being made
- entityType- The type of the entity containing the- NotificationState
- Returns:
- Whether or not the update was successful
 
- 
setFailedNotificationAttemptboolean setFailedNotificationAttempt(@NonNull Object nativeId, @NonNull String messageType, int attemptCount, @NonNull Instant nextAttempt, @NonNull Class<?> entityType, boolean stopped) Notate a failed message send attempt for a messageType on theNotificationStateof an entity of a particular type.- Parameters:
- nativeId- The primary key of the entity to update
- messageType- The type of the message that failed
- attemptCount- the current attempt count being made
- nextAttempt- The timestamp at which the next attempt should occur
- entityType- The type of the entity containing the- NotificationState
- stopped- Whether or not further attempts should be stopped - usually as a result of max attempts being reached.
- Returns:
- Whether or not the update was successful
 
- 
findNotificationReadyMembers@NonNull Stream<NotificationStateAware> findNotificationReadyMembers(@Nullable Object lastProcessedNativeId, int pageSize, @NonNull String messageType, @NonNull Duration faultThreshold, @NonNull Class<?> entityType) Find any entity instances that are unacknowledged and qualified for retry for message sending.- Parameters:
- lastProcessedNativeId- The last id that was processed (if any) in a previous batch run
- pageSize- The max number of records to request and process in this run
- messageType- The type of the message that is being targeted
- faultThreshold- The amount of time that must have elapsed since the- NotificationState.getChangeTimestamp()to be considered qualified
- entityType- The type of the entity containing the- NotificationState
- Returns:
- A stream of unacknowledged records to process for retry
 
 
-