@Override public MailingList findByUuid(String uuid) throws BusinessException { MailingList mailingList = listRepository.findByUuid(uuid); if (mailingList == null) { String msg = "The current mailing list do not exist : " + uuid; logger.error(msg); throw new BusinessException(BusinessErrorCode.LIST_DO_NOT_EXIST, msg); } return mailingList; }
/** Mailing list contacts management. */ @Override public MailingListContact findContactWithMail(String listUuid, String mail) throws BusinessException { MailingList list = listRepository.findByUuid(listUuid); MailingListContact contact = contactRepository.findByMail(list, mail); if (contact == null) { String msg = "The current contact you are trying to find do not exist : " + mail; logger.error(msg); throw new BusinessException(BusinessErrorCode.CONTACT_LIST_DO_NOT_EXIST, msg); } return contact; }