/* * (non-Javadoc) * * @see * org.openiam.idm.srvc.user.service.UserDataService#removeEmailAddress( * org.openiam.idm.srvc.continfo.dto.EmailAddress) */ @Transactional public void removeEmailAddress(EmailAddress val) { if (val == null) throw new NullPointerException("val is null"); if (val.getEmailId() == null) throw new NullPointerException("EmailAddressId is null"); emailAddressDao.remove(emailAddressDozerConverter.convertToEntity(val, true)); }
/* * (non-Javadoc) * * @see * org.openiam.idm.srvc.user.service.UserDataService#addEmailAddress(org * .openiam.idm.srvc.continfo.dto.EmailAddress) */ @Transactional public EmailAddress addEmailAddress(EmailAddress val) { if (val == null) throw new NullPointerException("val is null"); if (StringUtils.isEmpty(val.getParentId())) throw new NullPointerException("parentId for the address is not defined."); val.setParentType(ContactConstants.PARENT_TYPE_USER); EmailAddressEntity emailAddressEntity = emailAddressDozerConverter.convertToEntity(val, true); emailAddressEntity = emailAddressDao.add(emailAddressEntity); return emailAddressDozerConverter.convertToDTO(emailAddressEntity, true); }
/* * (non-Javadoc) * * @see * org.openiam.idm.srvc.user.service.UserDataService#updateEmailAddress( * org.openiam.idm.srvc.continfo.dto.EmailAddress) */ @Transactional public void updateEmailAddress(EmailAddress val) { if (val == null) throw new NullPointerException("val is null"); if (val.getEmailId() == null) throw new NullPointerException("EmailAddressId is null"); if (StringUtils.isEmpty(val.getParentId())) throw new NullPointerException("parentId for the address is not defined."); if (val.getParentType() == null) { throw new NullPointerException("parentType for the address is not defined."); } emailAddressDao.update(emailAddressDozerConverter.convertToEntity(val, true)); }