Package org.davinci.server.user

Examples of org.davinci.server.user.IPerson


     *
     * @see org.davinci.server.user.impl.UserManager#addUser(java.lang.String,
     * java.lang.String, java.lang.String)
     */
    public IPerson addPerson(String userName, String password, String email) throws UserException, IOException {
        IPerson person = (IPerson) persons.get(userName);
        if (person != null) {
            throw new UserException(UserException.ALREADY_EXISTS);
        }
        checkValidUserName(userName);
        person = new PersonImpl(userName, password, email);
View Full Code Here


        new UsersFile().save(userFile, this.persons.values());
    }

    public IPerson getPerson(String userName) {

        IPerson person = (IPerson) persons.get(userName);
        return person;

    }
View Full Code Here

        return person;

    }
   
    public IPerson getPersonByEmail(String email) {
      IPerson match = null;
        Iterator<IPerson> peopleIterator = persons.values().iterator();
        while (peopleIterator.hasNext() && match == null) {
          IPerson person = (IPerson)peopleIterator.next();
          if (person.getEmail().equals(email)) {
            match = person;
          }
        }
        return match;
    }
View Full Code Here

  public String getUserID() {
    if (name.equals("")) {
      //Try and look it up... this is necessary because reviewer doesn't necessarily have
      //a user name at the time they are invited to a review
      IPersonManager personManager = ServerManager.getServerManager().getPersonManager();
      IPerson person = personManager.getPersonByEmail(email);
      if (person != null) {
        name = person.getUserID();
      }
    }
    return name;
  }
View Full Code Here

  }

  public String getDisplayName() {
    String displayName = this.getEmail();
    IPersonManager personManager = ServerManager.getServerManager().getPersonManager();
    IPerson person = personManager.getPersonByEmail(this.getEmail());
    if (person != null) {
      displayName = person.getDisplayName();
    }
   

    return displayName;
  }
View Full Code Here

       // IUser user = (IUser) users.get(userName);
        if (ServerManager.LOCAL_INSTALL && IDavinciServerConstants.LOCAL_INSTALL_USER.equals(userName)) {
            return this.getSingleUser();
        }
        if (this.checkUserExists(userName)) {
            IPerson person = this.personManager.getPerson(userName);
            return newUser(person, this.baseDirectory.newInstance(this.baseDirectory, userName));
        }
        return null;
    }
View Full Code Here

        }

        if (this.maxUsers > 0 && this.usersCount >= this.maxUsers) {
            throw new UserException(UserException.MAX_USERS);
        }
        IPerson person = this.personManager.addPerson(userName, password, email);
        if (person != null) {
            IUser user = newUser(person, this.baseDirectory.newInstance(this.baseDirectory, userName));
          //  users.put(userName, user);
            //File userDir = user.getUserDirectory();
            //userDir.mkdir();
View Full Code Here

     */
    public IUser login(String userName, String password) throws UserException, IOException {
        if (!checkUserExists(userName)) {
            return null;
        }
        IPerson person = this.personManager.login(userName, password);
        if (person != null) {
      return newUser(person, this.baseDirectory.newInstance(this.baseDirectory, userName));
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.davinci.server.user.IPerson

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.