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​(java.lang.String sender, java.lang.String subject, java.util.Set<org.kie.api.task.model.OrganizationalEntity> recipients, java.lang.String body)` | Publishes given notification based on the actual implementation.
    `void` | `publish​(java.lang.String sender, java.lang.String subject, java.util.Set<org.kie.api.task.model.OrganizationalEntity> recipients, java.lang.String template, java.util.Map<java.lang.String,​java.lang.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​(java.lang.String sender,
                       java.lang.String subject,
                       java.util.Set<org.kie.api.task.model.OrganizationalEntity> recipients,
                       java.lang.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​(java.lang.String sender,
                       java.lang.String subject,
                       java.util.Set<org.kie.api.task.model.OrganizationalEntity> recipients,
                       java.lang.String template,
                       java.util.Map<java.lang.String,​java.lang.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:
        `java.lang.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