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 notifications
    `void` | `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 notification
        `subject` - subject to be used when publishing the notification
        `recipients` - list of users or groups the notification should be send to
        `body` - 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 notification
        `subject` - subject to be used when publishing the notification
        `recipients` - list of users or groups the notification should be send to
        `template` - name of the template to be used to render body
        `parameters` - 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