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 Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getAddressForEntity​(pl.edu.icm.unity.types.basic.EntityParam recipient, java.lang.String templateId, boolean onlyConfirmed)
      Get address for entity.
      java.util.concurrent.Future<NotificationStatus> sendNotification​(java.lang.String recipientAddress, java.lang.String templateId, java.util.Map<java.lang.String,​java.lang.String> params, java.lang.String locale)
      Sends a message which is resolved from a given template with parameters.
      java.util.concurrent.Future<NotificationStatus> sendNotification​(pl.edu.icm.unity.types.basic.EntityParam recipient, java.lang.String templateId, java.util.Map<java.lang.String,​java.lang.String> params, java.lang.String locale, java.lang.String preferredAddress, boolean sendOnlyToConfirmed)
      Sends a message which is resolved from a given template with parameters.
      void sendNotificationToGroup​(java.lang.String group, java.lang.String templateId, java.util.Map<java.lang.String,​java.lang.String> params, java.lang.String locale)
      Sends a message which is resolved from a given template with parameters.
    • Method Detail

      • sendNotification

        java.util.concurrent.Future<NotificationStatus> sendNotification​(pl.edu.icm.unity.types.basic.EntityParam recipient,
                                                                         java.lang.String templateId,
                                                                         java.util.Map<java.lang.String,​java.lang.String> params,
                                                                         java.lang.String locale,
                                                                         java.lang.String preferredAddress,
                                                                         boolean sendOnlyToConfirmed)
                                                                  throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException
      • sendNotification

        java.util.concurrent.Future<NotificationStatus> sendNotification​(java.lang.String recipientAddress,
                                                                         java.lang.String templateId,
                                                                         java.util.Map<java.lang.String,​java.lang.String> params,
                                                                         java.lang.String locale)
                                                                  throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException
      • sendNotificationToGroup

        void sendNotificationToGroup​(java.lang.String group,
                                     java.lang.String templateId,
                                     java.util.Map<java.lang.String,​java.lang.String> params,
                                     java.lang.String locale)
                              throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException
      • getAddressForEntity

        java.lang.String getAddressForEntity​(pl.edu.icm.unity.types.basic.EntityParam recipient,
                                             java.lang.String templateId,
                                             boolean onlyConfirmed)
                                      throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException