Пример #1
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#addUser(org.openiam
   * .idm.srvc.user.dto.User, boolean)
   */
  @Transactional
  public User addUserWithDependent(User user, boolean dependency) {
    if (user == null) throw new NullPointerException("user object is null");

    if (user.getCreateDate() == null) {
      user.setCreateDate(new Date(System.currentTimeMillis()));
    }
    if (user.getLastUpdate() == null) {
      user.setLastUpdate(new Date(System.currentTimeMillis()));
    }

    // if there are dependants, then make user that the parentId has been
    // set

    validateEmailAddress(user, user.getEmailAddresses());

    log.debug("User Object before addUser: "******"ADD");

    return userDozerConverter.convertToDTO(entity, true);
  }
Пример #2
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#addUser(org.openiam
   * .idm.srvc.user.dto.User)
   */
  @Transactional
  public User addUser(User user) {
    if (user == null) throw new NullPointerException("user object is null");

    if (user.getCreateDate() == null) {
      user.setCreateDate(new Date(System.currentTimeMillis()));
    }
    if (user.getLastUpdate() == null) {
      user.setLastUpdate(new Date(System.currentTimeMillis()));
    }

    validateEmailAddress(user, user.getEmailAddresses());
    UserEntity userEntity = userDozerConverter.convertToEntity(user, true);
    userDao.add(userEntity);

    return userDozerConverter.convertToDTO(userEntity, true);
  }
Пример #3
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#updateUser(org.openiam
   * .idm.srvc.user.dto.User, boolean)
   */
  @Transactional
  public void updateUserWithDependent(User user, boolean dependency) {
    if (user == null) throw new NullPointerException("user object is null");
    if (user.getUserId() == null) throw new NullPointerException("user id is null");

    user.setLastUpdate(new Date(System.currentTimeMillis()));

    validateEmailAddress(user, user.getEmailAddresses());

    userDao.update(userDozerConverter.convertToEntity(user, true));

    if (!dependency) return;

    // address
    /*
     * Map<Address> adrMap = user.getAddresses(); if (adrMap != null &&
     * adrMap.size() > 0 ) {
     * this.addressDao.saveAddressMap(user.getUserId(),
     * ContactConstants.PARENT_TYPE_USER , adrMap); }
     */
    // email
    /*
     * Map<String, EmailAddress> emailMap = user.getEmailAddresses(); if
     * (emailMap != null && emailMap.size() > 0 ) {
     * this.emailAddressDao.saveEmailAddressMap(user.getUserId(),
     * ContactConstants.PARENT_TYPE_USER , emailMap); }
     */
    // phone
    /*
     * Map<String, Phone> phoneMap = user.getPhones(); if (phoneMap != null
     * && phoneMap.size() > 0 ) {
     * this.phoneDao.savePhoneMap(user.getUserId(),
     * ContactConstants.PARENT_TYPE_USER , phoneMap); }
     */
    // this.userMsgProducer.sendMessage(user,"UPDATE");

  }