Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.User


     
    // execute the commands 
    Set<CommandEntry> commandEntries = invocation.getCommandEntries();
    // table-driven action evaluation
    UserManager userManager = new UserManager(locale,session);
    User user = userManager.registerUserByMsisdn(Long.parseLong(msisdn), null, invocation.getGroup());
   
    InteractionLogManager interactionLogManager = new InteractionLogManager(locale, session);   
    EventParameters eventParameters = null;
   
    ReceivedSms receivedSms = new ReceivedSms();
View Full Code Here


    setMessage(entry.getTextBody());
    // destination selection
    String destinationEmail = entry.getDestinationEmail();
    String destinationPersonalName = entry.getDestinationPersonalName();
    UserSet destinationUserSet = entry.getDestinationUserSet();
    User destinationUser = entry.getDestinationUser();
    if (destinationUser != null){
      destinationUserSet = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(2);
    } else if (destinationUserSet != null){
      destinationUser = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(1);
    } else if (destinationEmail != null){
      destinationUserSet = null;
      destinationUser = null;
      setDestinationSelection(3);
    } else { // default: nothing selected
      destinationUserSet = null;
      destinationUser = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(-1);
    }
    setToEmail(destinationEmail);
    setToPersonalName(destinationPersonalName);
    setUserId(destinationUser == null ? -1 : destinationUser.getId());
    setUserSetId(destinationUserSet == null ? -1 : destinationUserSet.getId());
    setGroupId(entry.getGroup().getId());
  }
View Full Code Here

   */
  public User registerUser(User userToRegistrate, Group group) {
    if (userToRegistrate == null) {
      return null;
    }
    User user = null;
    if (userToRegistrate.getCustomerNumber() != null && group != null) {
      user = getUserDetailsByCustomerNumber(userToRegistrate.getCustomerNumber(), group);
    }   
    if (user == null && userToRegistrate.getMsisdn() != null && group != null) {
      user = getUserDetails(userToRegistrate.getMsisdn(), group);
    }
    if (user == null && userToRegistrate.getUsername() != null) {
      user = getUserDetails(userToRegistrate.getUsername());
    }
    if (user == null && userToRegistrate.getPersonalNumber() != null && group != null) {
      user = getUserDetailsByPersonalNumber(userToRegistrate.getPersonalNumber(), group);
    }
    if (user != null) {
      user = mergeUser(userToRegistrate, user);
      user.setEditedAt(new Date());
    } else {
      user = userToRegistrate;
      user.setGroup(group);
      user.setCreationdate(new Date());     
    }
    if(userToRegistrate.getPassword() != null){
      user.setPassword(RealmBase.Digest(userToRegistrate.getPassword(),"MD5",null));
    }
    session.saveOrUpdate(user);
    return user;
  }
View Full Code Here

   *
   * Test fails if the user detail data cannot be fetched
   */
  public void testGetUserDetailsById() {
    UserManager usrMng = new UserManager(Locale.GERMAN,session);
    User user = usrMng.getUserDetails("Administrator");

    if (user != null){
      User user2 = usrMng.getUserDetails(user.getId());
      assertTrue(user2.getUsername().equals(user.getUsername()));
    } else {
      assertTrue(false);
    }
  }
View Full Code Here

   * Test method for 'evolaris.um.business.UserManager.isUserInRole(Object,String)'
   *
   */
  public void testIsUserinRole(){
    UserManagerBase usrMng = new UserManager(Locale.GERMAN,session);
    User user = usrMng.getUserDetails("Administrator");
    assertTrue(UserManager.isUserInRole(user,UserManagerBase.ADMINISTRATOR));
  }
View Full Code Here

    assertTrue(UserManager.isUserInRole(user,UserManagerBase.ADMINISTRATOR));
  }

  public void testIsUserInSet(){
    UserManagerBase usrMng = new UserManager(Locale.GERMAN,session);
    User user = usrMng.getUserDetails("mysqltestuser");
    assertEquals(user.getUserSets().size(),1);
    Set<UserSet> userSets = user.getUserSets();
    assertEquals(userSets.iterator().next().getName(),"unit test");

  }
View Full Code Here

    Calendar calendar = Calendar.getInstance();
    calendar.setTime(timerEvent.getScheduledTime());
    initializeSendDate(calendar);

    // requesting user / user set / owning user
    User requestingUser = timerEvent.getRequestingUser();
    UserSet requestingUserSet = timerEvent.getRequestingUserSet();
    f.setRequestingUserId(requestingUser != null ? requestingUser.getId() : -1);
    f.setRequestingUserSetId(requestingUserSet != null ? requestingUserSet.getId() : -1);
    f.setApplyToSelection(requestingUserSet == null ? 1 : 2);
    f.setOwningUserId(timerEvent.getOwningUser().getId());
   
    // repetition interval
View Full Code Here

    Group group = groupMgr.getGroup(f.getGroupId());
    timerEvent.setGroup(group);
   
    // owning user
    UserManager userManager = new UserManager(locale, session);
    User owningUser = userManager.getUserDetails(f.getOwningUserId());
    if (owningUser == null){
      throw new InputException(resources.getMessage(locale,"smssvc.AnEntryNotAvailable"));
    }
    timerEvent.setOwningUser(owningUser);

    // apply to
    if (f.getApplyToSelection() == 1) { // user
      User requestingUser = userManager.getUserDetails(f.getRequestingUserId());
      if (requestingUser == null){
        throw new InputException(resources.getMessage(locale,"smssvc.AnEntryNotAvailable"));
      }
      timerEvent.setRequestingUser(requestingUser);
      timerEvent.setRequestingUserSet(null);
View Full Code Here

    // new user
    setMgr.assignUserToSet(msisdn,"AT_MOBILKOM","Nokia",group,"Java-Entwickler");

    userMgr = new UserManager(Locale.GERMAN,session);
    setMgr = new UserSetManager(Locale.GERMAN,session);
    User user = userMgr.getUserDetails(msisdn,group);
    assertTrue(userMgr.isUserInUserSet(user,"Java-Entwickler"));

    UserSet set = setMgr.getUserSet("Java-Entwickler",group);
    setMgr.removeUserFromUserSet(user,set);
    userMgr.deleteUser(user);
View Full Code Here

    userMgr.deleteUser(user);
  }

  public void testDoesUserShareMoreThanOneUserSetWithAnotherUser(){
    UserManagerBase userMgr = new UserManager(Locale.GERMAN,session);
    User user = userMgr.getUserDetails("tom");
    UserSetManager setMgr = new UserSetManager(Locale.GERMAN,session);
    UserSet userset = setMgr.getUserSet("test", user.getGroup());
    setMgr.add(userset, user);
    setMgr.doesUserShareMoreThanOneUserSetWithAnotherUser(user);
  }
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.