Class MailReceiverServiceImpl
java.lang.Object
ch.tocco.nice2.optional.address.impl.action.mail.MailReceiverServiceImpl
- All Implemented Interfaces:
MailReceiverService
-
Constructor Summary
ConstructorDescriptionMailReceiverServiceImpl
(QueryBuilderFactory queryBuilderFactory, Context context, RecipientService recipientService) -
Method Summary
Modifier and TypeMethodDescriptiongetMailReceiver
(MailActionService.MailFormRequest request, EntityList list) This method invokes either one of the other two `#getMailReceiver()` based on which properties have been set in the `request` parameter.getMailReceiver
(Iterable<String> recipientPaths, Iterable<String> emails, Iterable<String> firstnames, Iterable<String> lastnames, EntityList list) Finds all receivers by resolving the `recipientPath` path list to possibly multiple entities and from there the `email`, `firstname` and `lastname` paths are resolved to collect all data necessary for a `MailReceiver`.getMailReceiver
(String emailPath, String firstnamePath, String lastnamePath, EntityList list) Collects the mail receviers from three unrelated pathes.getMailReceivers
(MailActionService.MailInfo mailinfo, Entity fakeSingleBase, EntityList selectionList, boolean isFirstBatch)
-
Constructor Details
-
MailReceiverServiceImpl
public MailReceiverServiceImpl(QueryBuilderFactory queryBuilderFactory, Context context, RecipientService recipientService)
-
-
Method Details
-
getMailReceivers
public List<MailReceiver> getMailReceivers(MailActionService.MailInfo mailinfo, Entity fakeSingleBase, EntityList selectionList, boolean isFirstBatch) throws NoEntityToLoadException - Specified by:
getMailReceivers
in interfaceMailReceiverService
- Parameters:
isFirstBatch
- if receivers are created in batches (for memory reasons), this value is true for the first batch. this allows to make sure to execute certain actions only once per mailing (for example single-copy receivers).- Throws:
NoEntityToLoadException
-
getMailReceiver
public List<MailReceiver> getMailReceiver(String emailPath, String firstnamePath, String lastnamePath, EntityList list) Description copied from interface:MailReceiverService
Collects the mail receviers from three unrelated pathes. Creates at most one receiver per element in `list`.- Specified by:
getMailReceiver
in interfaceMailReceiverService
-
getMailReceiver
public List<MailReceiver> getMailReceiver(MailActionService.MailFormRequest request, EntityList list) throws NoEntityToLoadException Description copied from interface:MailReceiverService
This method invokes either one of the other two `#getMailReceiver()` based on which properties have been set in the `request` parameter. If the request has valid `getRecipientXyz` configuration, thenMailReceiverService.getMailReceiver(Iterable, Iterable, Iterable, Iterable, EntityList)
is invoked, otherwiseMailReceiverService.getMailReceiver(String, String, String, EntityList)
.- Specified by:
getMailReceiver
in interfaceMailReceiverService
- Throws:
NoEntityToLoadException
-
getMailReceiver
public List<MailReceiver> getMailReceiver(Iterable<String> recipientPaths, Iterable<String> emails, Iterable<String> firstnames, Iterable<String> lastnames, EntityList list) Description copied from interface:MailReceiverService
Finds all receivers by resolving the `recipientPath` path list to possibly multiple entities and from there the `email`, `firstname` and `lastname` paths are resolved to collect all data necessary for a `MailReceiver`. The ´recipientPath` is a list of paths (separated by comma "`,`"), that resolve to an entity that is considered the "recipient-base". From there the other paths are resolved to obtain the mail address and the corresponding first- and lastname.- Specified by:
getMailReceiver
in interfaceMailReceiverService
-