Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.User


   * @param group  the group within which to search and create
   * @param disposeryKey the disposery key will be stored as personal number
   * @return  existing or newly created user
   */
  public User registerUserByMsisdn(final long msisdn, final String mobilePhoneProducer, final Date birthdate, final Group group,final String disposeryKey){
    User user = getUserDetails(msisdn,group);
    if (user == null){
      LOGGER.info("the user with the msisdn: " + msisdn + " is not registered for group: " + group.getGroupname() + " and will therefore be created.");
      user = new User();
      user.setGroup(group);
      user.setMsisdn(msisdn);
      user.setBirthdate(birthdate);
      user.setMobilePhoneProducer(mobilePhoneProducer);
      user.setCreationdate(new Date(System.currentTimeMillis()));
      user.setPersonalNumber(disposeryKey);
      session.save(user);
    } else {
      LOGGER.info("the user with the msisdn: " + msisdn + " is registered for group: " + group.getGroupname() + " and will be updated. birthdate: " + birthdate + " mobile phone producer: " + mobilePhoneProducer);
      user.setBirthdate(birthdate);
      user.setMobilePhoneProducer(mobilePhoneProducer);
      user.setPersonalNumber(disposeryKey);
      user.setEditedAt(new Date(System.currentTimeMillis()));
      session.save(user);
    }
    return user;
  }
View Full Code Here


   * @param birthdate the birthdate
   * @param group the Group
   * @return if match found the updated user object otherwise null
   */
  public User updateUserByDisposeryKey(final String disposeryKey,final long msisdn, final String mobilePhoneProducer, final Date birthdate, final Group group){
    User user = getUserDetailsByPersonalNumber(disposeryKey,group);
   
    if(user != null){
      LOGGER.info("the user with the id: " + user.getId()+ " and with the disposeryKey: " + disposeryKey + " is registered for group: " + group.getGroupname() + " and will be updated. birthdate: " + birthdate + " mobile phone producer: " + mobilePhoneProducer);
      user.setBirthdate(birthdate);
      user.setMobilePhoneProducer(mobilePhoneProducer);
      user.setMsisdn(msisdn);
      user.setEditedAt(new Date(System.currentTimeMillis()));
      session.save(user);
    }
    return user;
  }
View Full Code Here

   * @param birthdate the birthdate of the user
   * @param group  the group within which to search and create
   * @return  existing or newly created user
   */
  public User registerUserByDisposeryKey(final String disposeryKey, final long msisdn, final String mobilePhoneProducer, final Date birthdate, final Group group){
    User user = getUserDetailsByPersonalNumber(disposeryKey,group);
    if (user == null){
      LOGGER.info("the user with the disposeryKey: " + disposeryKey + " is not registered for group: " + group.getGroupname() + " and will therefore be created.");
      user = new User();
      user.setGroup(group);
      user.setPersonalNumber(disposeryKey);
      user.setMsisdn(msisdn);
      user.setBirthdate(birthdate);
      user.setMobilePhoneProducer(mobilePhoneProducer);
      user.setCreationdate(new Date(System.currentTimeMillis()));
      session.save(user);
    } else {
      LOGGER.info("the user with the disposeryKey: " + disposeryKey + " is registered for group: " + group.getGroupname() + " and will be updated. birthdate: " + birthdate + " mobile phone producer: " + mobilePhoneProducer);
      user.setBirthdate(birthdate);
      user.setMobilePhoneProducer(mobilePhoneProducer);
      user.setMsisdn(msisdn);
      user.setEditedAt(new Date(System.currentTimeMillis()));
      session.save(user);
    }
    return user;
  }
View Full Code Here

   * @param email email address of the user
   * @param group  the group within which to search and create
   * @return  existing or newly created user
   */
  public User registerUserByEmail(String email,  Group group){
    User user = getUserDetailsByEmail(email,group);
    if (user == null){
      LOGGER.info("the user with the email address: " + email + " is not registered for group: " + group.getGroupname() + " and will therefore be created.");
      user = new User();
      user.setGroup(group);
      user.setEmail(email);
      user.setCreationdate(new Date(System.currentTimeMillis()));
      session.save(user);
    }
    return user;
  }
View Full Code Here

          method.invoke(csvUser, arguments);
          i++;
        }

        User userToImport = csvUser.getUser(errorMessages);
        if(userToImport == null){
          // error during parsing the user
          importResult.incUsersIgnored();
          continue;
        }
       
        // users with too less data will be ignored
        if((userToImport.getUsername() == null || userToImport.getUsername().trim().equals("")) &&
            (userToImport.getFirstName() == null || userToImport.getFirstName().trim().equals("")) &&
            (userToImport.getLastName() == null || userToImport.getLastName().trim().equals("")) &&
            (userToImport.getMsisdn() == null) &&
            (userToImport.getEmail() == null || userToImport.getEmail().trim().equals("")) &&
            (userToImport.getPersonalNumber() == null || userToImport.getPersonalNumber().equals(""))){
         
            importResult.incUsersIgnored();
            continue;
        }
       
        User alreadyExistingUser = null;

        if(mergeAccordingToUsername){
          if(userToImport.getUsername() != null && userToImport.getUsername().length() > 0){
            alreadyExistingUser = getUserDetails(userToImport.getUsername(),userSet.getGroup());
          }
        } else if(mergeAccordingToMsisdn){
          if(userToImport.getMsisdn() != null){
            alreadyExistingUser = getUserDetails(userToImport.getMsisdn(),userSet.getGroup());
          }
        } else if(mergeAccordingToPersonelNumber){
          if(userToImport.getPersonalNumber() != null && userToImport.getPersonalNumber().length() > 0){
            alreadyExistingUser = getUserDetailsByPersonalNumber(userToImport.getPersonalNumber(),userSet.getGroup());

          }
        }

        User userInDb = null;
        if(alreadyExistingUser == null){
          LOGGER.debug("create new User data objet");

          if(userToImport.getUsername() != null && !userToImport.getUsername().equals("")){ // a default role will be assigned
            Role role = getRole(USER);
            Set<Role> roles = new  HashSet<Role>(1);
            roles.add(role);
            userToImport.setRoles(roles);
          }
          userToImport.setGroup(userSet.getGroup());
          userInDb = createUser(userToImport, userToImport.getPassword());
          importResult.incUsersCreated();

        } else{
          LOGGER.debug("merge existing user data object");
          User user = mergeUser(userToImport,alreadyExistingUser);
          modifyUser(user);
          importResult.incUsersUpdated();
          userInDb = user;
        }
View Full Code Here

        if (userId.longValue() == -1){
          String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
          throw new InputException(noUserSelectedString);
        }
        UserManager userManager = new UserManager(locale,session);
        User user = userManager.getUserDetails(userId);
        if (user == null){
          throw new ConfigurationException("illegal user id: " + user);
        }
        smsCommandEntry.setDestinationContact(0);
        smsCommandEntry.setDestinationUser(user);
View Full Code Here

        if (userId.longValue() == -1){
          String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
          throw new InputException(noUserSelectedString);
        }
        UserManager userManager = new UserManager(locale,session);
        User user = userManager.getUserDetails(userId);
        if (user == null){
          throw new ConfigurationException("illegal user id: " + user);
        }
        smsCommandEntry.setDestinationUser(user);
        smsCommandEntry.setDestinationUserSet(null);
View Full Code Here

      for (GameScoreHiber gameScore : gs) {
        GameScore toAdd=GameScore.asGameScoreObject(gameScore);
        //construct player name
 
        try {
          User usr=UserDao.findUser(gameScore.getPlayer(),session);
          String name=usr.getLastName()+" "+usr.getFirstName();
          if ((usr.getLastName()==null) && (usr.getFirstName()==null)) name=usr.getMsisdn()+"";
          toAdd.setPlayerString(name);
        } catch (Exception eee){
          //leave as is
        }
       
View Full Code Here

        String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
        req.setAttribute("generalError",noUserSelectedString);
        return mapping.findForward("notSent");
      }
      UserManager userManager = new UserManager(locale,session);
      User user = userManager.getUserDetails(userId);
      if (user == null){
        throw new ConfigurationException("illegal user id: " + user);
      }
      Set<User> oneManSet = new HashSet<User>();
      oneManSet.add(user);
View Full Code Here

    Group groupToDisplay = getCurrentGroup(req);
    if (Boolean.TRUE.equals(timerEventListForm.getAllGroups()) && UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)) {
      groupToDisplay = null;
    }
    User userToDisplay = null;
    Long selectedUserId = timerEventListForm.getUserId() == null ? ALL_ID : timerEventListForm.getUserId();

    if (UserManager.isUserInRole(webUser, UserManagerBase.GROUP_ADMINISTRATOR)) {
      User[] users;
      if (groupToDisplay == null) {
View Full Code Here

TOP

Related Classes of evolaris.framework.um.datamodel.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.