Example #1
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#updateAddress(org.openiam
   * .idm.srvc.continfo.dto.Address)
   */
  @Transactional
  public void updateAddress(Address val) {
    if (val == null) throw new NullPointerException("val is null");
    if (val.getAddressId() == null) throw new NullPointerException("AddressId is null");
    if (StringUtils.isEmpty(val.getParentId()))
      throw new NullPointerException("userId for the address is not defined.");
    if (val.getParentType() == null) {
      throw new NullPointerException("parentType for the address is not defined.");
    }

    addressDao.update(addressDozerConverter.convertToEntity(val, true));
  }
Example #2
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#addAddress(org.openiam
   * .idm.srvc.continfo.dto.Address)
   */
  @Transactional
  public Address addAddress(Address val) {
    if (val == null) throw new NullPointerException("val is null");

    if (StringUtils.isEmpty(val.getParentId()))
      throw new NullPointerException("userId for the address is not defined.");

    val.setParentType(ContactConstants.PARENT_TYPE_USER);

    AddressEntity addressEntity = addressDao.add(addressDozerConverter.convertToEntity(val, true));
    return addressDozerConverter.convertToDTO(addressEntity, true);
  }
Example #3
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.openiam.idm.srvc.user.service.UserDataService#removeAddress(org.openiam
  * .idm.srvc.continfo.dto.Address)
  */
 @Transactional
 public void removeAddress(Address val) {
   if (val == null) throw new NullPointerException("val is null");
   if (val.getAddressId() == null) throw new NullPointerException("AddressId is null");
   addressDao.remove(addressDozerConverter.convertToEntity(val, true));
 }