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
Modifier and TypeMethodDescriptiongetAddressForEntity
(EntityParam recipient, String templateId, boolean onlyConfirmed) Get address for entity.sendNotification
(String recipientAddress, String templateId, Map<String, String> params, String locale) Sends a message which is resolved from a given template with parameters.sendNotification
(Set<String> groups, List<Long> singleRecipients, String templateId, Map<String, String> params, String locale) Sends a message which is resolved from a given template with parameters.sendNotification
(EntityParam recipient, String templateId, Map<String, String> params, String locale, String preferredAddress, boolean sendOnlyToConfirmed) Sends a message which is resolved from a given template with parameters.void
Sends a message which is resolved from a given template with parameters.
-
Method Details
-
sendNotification
Future<NotificationStatus> sendNotification(EntityParam recipient, String templateId, Map<String, String> params, String locale, String preferredAddress, boolean sendOnlyToConfirmed) throws EngineExceptionSends 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 usedpreferredAddress
- 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 EngineExceptionSends 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 EngineExceptionSends 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 EngineExceptionSends 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 recipientssingleRecipients
- single recipients idstemplateId
- message template of messageparams
- message parameterslocale
-- 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 messageonlyConfirmed
- get only confirmed address- Returns:
- Throws:
EngineException
-