Interface NotificationProducer


public interface NotificationProducer
Notification sending facility. Should be used internally, i.e. the users shouldn't have the possibility to invoke operations of this interface directly.
Author:
K. Benedyczak
  • Method Details

    • sendNotification

      Future<NotificationStatus> sendNotification(EntityParam recipient, String templateId, Map<String,String> params, String locale, String preferredAddress, boolean sendOnlyToConfirmed) throws EngineException
      Sends a message which is resolved from a given template with parameters.
      Parameters:
      recipient -
      channelName -
      templateId -
      params -
      locale - can be null. In such case the server's default locale will be used
      preferredAddress - can be null. If not null then this address will be used if can be found among all valid addresses of entity.
      sendOnlyToConfirmed - send notification only to confirmed recipient address
      Returns:
      Throws:
      EngineException
    • sendNotification

      Future<NotificationStatus> sendNotification(String recipientAddress, String templateId, Map<String,String> params, String locale) throws EngineException
      Sends a message which is resolved from a given template with parameters.
      Parameters:
      recipientAddress - actual address of the recipient, as email address.
      channelName -
      templateId -
      params -
      locale - can be null. In such case the server's default locale will be used
      Returns:
      Throws:
      EngineException
    • sendNotificationToGroup

      void sendNotificationToGroup(String group, String templateId, Map<String,String> params, String locale) throws EngineException
      Sends a message which is resolved from a given template with parameters. This version sends a message to all entities which are members of a given group and have channel's address defined in this group.
      Parameters:
      group -
      channelName -
      templateId -
      params -
      locale - can be null. In such case the server's default locale will be used
      Throws:
      EngineException
    • sendNotification

      Collection<String> sendNotification(Set<String> groups, List<Long> singleRecipients, String templateId, Map<String,String> params, String locale) throws EngineException
      Sends a message which is resolved from a given template with parameters. This version sends a message to given single entities and to all entities which are members of a given groups have channel's address defined in this group.
      Parameters:
      groups - groups of recipients
      singleRecipients - single recipients ids
      templateId - message template of message
      params - message parameters
      locale -
      Returns:
      all addresses to which the message was sent
      Throws:
      EngineException
    • getAddressForEntity

      String getAddressForEntity(EntityParam recipient, String templateId, boolean onlyConfirmed) throws EngineException
      Get address for entity. Address is relevant for channel configured in message template.
      Parameters:
      recipient -
      templateId - message template of message
      onlyConfirmed - get only confirmed address
      Returns:
      Throws:
      EngineException