Interface NotificationManager
-
- All Known Implementing Classes:
DefaultNotificationManager
public interface NotificationManager
Create notification tasks that will be executed by NotificationJob.- See Also:
NotificationTask
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
countExecutionsWithStatus(String taskKey, String status)
Count the number of task executions of a given task with a given status.List<NotificationTask>
createTasks(String who, AuditElements.EventCategoryType type, String category, String subcategory, String event, AuditElements.Result condition, Object before, Object output, Object... input)
Create notification tasks for each notification matching provided conditions.void
createTasks(AfterHandlingEvent event)
Create notification tasks according to the provided event.long
getMaxRetries()
boolean
notificationsAvailable(AuditElements.EventCategoryType type, String category, String subcategory, String event)
Checks if notifications are available matching the provided conditions.void
setTaskExecuted(String taskKey, boolean executed)
Set execution state of NotificationTask with provided id.TaskExec<NotificationTask>
storeExec(TaskExec<NotificationTask> execution)
Store execution of a NotificationTask.
-
-
-
Method Detail
-
countExecutionsWithStatus
long countExecutionsWithStatus(String taskKey, String status)
Count the number of task executions of a given task with a given status.- Parameters:
taskKey
- taskstatus
- status- Returns:
- number of task executions
-
notificationsAvailable
boolean notificationsAvailable(AuditElements.EventCategoryType type, String category, String subcategory, String event)
Checks if notifications are available matching the provided conditions.- Parameters:
type
- event category typecategory
- event categorysubcategory
- event subcategoryevent
- event- Returns:
- created notification tasks
-
createTasks
void createTasks(AfterHandlingEvent event)
Create notification tasks according to the provided event.- Parameters:
event
- Spring event raised during Logic processing
-
createTasks
List<NotificationTask> createTasks(String who, AuditElements.EventCategoryType type, String category, String subcategory, String event, AuditElements.Result condition, Object before, Object output, Object... input)
Create notification tasks for each notification matching provided conditions.- Parameters:
who
- user triggering the eventtype
- event category typecategory
- event categorysubcategory
- event subcategoryevent
- eventcondition
- result value condition.before
- object(s) availabile before the eventoutput
- object(s) produced by the eventinput
- object(s) provided to the event- Returns:
- created notification tasks
-
getMaxRetries
long getMaxRetries()
-
setTaskExecuted
void setTaskExecuted(String taskKey, boolean executed)
Set execution state of NotificationTask with provided id.- Parameters:
taskKey
- task to be updatedexecuted
- execution state
-
storeExec
TaskExec<NotificationTask> storeExec(TaskExec<NotificationTask> execution)
Store execution of a NotificationTask.- Parameters:
execution
- task execution.- Returns:
- merged task execution.
-
-