Exemplo n.º 1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.openiam.idm.srvc.user.service.UserDataService#removePhone(org.openiam
  * .idm.srvc.continfo.dto.Phone)
  */
 @Transactional
 public void removePhone(Phone val) {
   if (val == null) throw new NullPointerException("val is null");
   if (val.getPhoneId() == null) throw new NullPointerException("PhoneId is null");
   UserEntity parent = userDao.findById(val.getParentId());
   phoneDao.remove(phoneDozerConverter.convertToEntity(val, true));
 }
Exemplo n.º 2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.openiam.idm.srvc.user.service.UserDataService#updatePhone(org.openiam
  * .idm.srvc.continfo.dto.Phone)
  */
 @Transactional
 public void updatePhone(Phone val) {
   if (val == null) throw new NullPointerException("val is null");
   if (val.getPhoneId() == null) throw new NullPointerException("PhoneId 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.");
   }
   phoneDao.update(phoneDozerConverter.convertToEntity(val, true));
 }
Exemplo n.º 3
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#addPhone(org.openiam
   * .idm.srvc.continfo.dto.Phone)
   */
  @Transactional
  public Phone addPhone(Phone 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);
    PhoneEntity phoneEntity = phoneDao.add(phoneDozerConverter.convertToEntity(val, true));
    return phoneDozerConverter.convertToDTO(phoneEntity, true);
  }