Package org.kie.internal.utils
Interface NotificationPublisher
-
public interface NotificationPublisher
Responsible for providing various types of publishers of notifications e.g. email, sms, message, etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isActive()
Indicates if given publisher is active and thus should be used to publish notificationsvoid
publish(String sender, String subject, Set<org.kie.api.task.model.OrganizationalEntity> recipients, String body)
Publishes given notification based on the actual implementation.void
publish(String sender, String subject, Set<org.kie.api.task.model.OrganizationalEntity> recipients, String template, Map<String,Object> parameters)
Renders body based on given template and parameters and then publishes given notification based on the actual implementation.
-
-
-
Method Detail
-
publish
void publish(String sender, String subject, Set<org.kie.api.task.model.OrganizationalEntity> recipients, String body)
Publishes given notification based on the actual implementation. This method should never thrown exceptions as they might be interfering with processing logic.- Parameters:
sender
- identifier of the sender to be attached to the message produced from the notificationsubject
- subject to be used when publishing the notificationrecipients
- list of users or groups the notification should be send tobody
- actual message body
-
publish
void publish(String sender, String subject, Set<org.kie.api.task.model.OrganizationalEntity> recipients, String template, Map<String,Object> parameters)
Renders body based on given template and parameters and then publishes given notification based on the actual implementation. This method can throw IllegalArgumentException in case given template was not found. This allows to fall back to send notification with not rendered body- Parameters:
sender
- identifier of the sender to be attached to the message produced from the notificationsubject
- subject to be used when publishing the notificationrecipients
- list of users or groups the notification should be send totemplate
- name of the template to be used to render bodyparameters
- map of parameters that can be used while rendering body from the template- Throws:
IllegalArgumentException
- when template was not found
-
isActive
boolean isActive()
Indicates if given publisher is active and thus should be used to publish notifications- Returns:
- true if active false otherwise
-
-