Interface NotificationManager
- All Known Implementing Classes:
DefaultNotificationManager
public interface NotificationManager
Management component for processing a state change on an object through one or more ordered
NotificationHandler
instances.- Author:
- Jeff Fischer
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(NotificationStateRepository repo, NotificationStateAware notifiable, String messageType) Notify the system in some way about the state change for the notifiable param.void
handleAsync
(NotificationStateRepository repo, NotificationStateAware notifiable, String messageType) Notify the system in some way about the state change for the notifiable param.void
handleAsync
(NotificationStateRepository repo, NotificationStateAware notifiable, String messageType, Runnable callback) Notify the system in some way about the state change for the notifiable param.
-
Method Details
-
handle
void handle(@NonNull NotificationStateRepository repo, @NonNull NotificationStateAware notifiable, @NonNull String messageType) Notify the system in some way about the state change for the notifiable param. Processing is handled through one or moreNotificationHandler
instances. This will update the given notifiable using repo. Subsequent checks of the latest notification state will require a re-read.- Parameters:
repo
- The service responsible for making the state change. Usually aRepository
instance.notifiable
- The object that experienced the state change. Usually a Spring Data entity instance.messageType
- The type of message correlating toDefaultNotificationHandler#messageType
.
-
handleAsync
void handleAsync(@NonNull NotificationStateRepository repo, @NonNull NotificationStateAware notifiable, @NonNull String messageType) Notify the system in some way about the state change for the notifiable param. Processing is handled through one or moreNotificationHandler
instances. This will update the given notifiable using repo. Subsequent checks of the latest notification state will require a re-read. Notably, this version will perform handling using a thread pool.- Parameters:
repo
- The service responsible for making the state change. Usually aRepository
instance.notifiable
- The object that experienced the state change. Usually a Spring Data entity instance.messageType
- The type of message correlating toDefaultNotificationHandler#messageType
.- See Also:
-
handleAsync
void handleAsync(@NonNull NotificationStateRepository repo, @NonNull NotificationStateAware notifiable, @NonNull String messageType, @Nullable Runnable callback) Notify the system in some way about the state change for the notifiable param. Processing is handled through one or moreNotificationHandler
instances. This will update the given notifiable using repo. Subsequent checks of the latest notification state will require a re-read. Notably, this version will perform handling using a thread pool.- Parameters:
repo
- The service responsible for making the state change. Usually aRepository
instance.notifiable
- The object that experienced the state change. Usually a Spring Data entity instance.messageType
- The type of message correlating toDefaultNotificationHandler#messageType
.callback
- Code snippet to execute after all notification handling operations are complete- See Also:
-