Package org.davinci.server.user

Examples of org.davinci.server.user.UserException


    public IUser newUser(IPerson person, IStorage baseDirectory) throws UserException {
       IUser user;
    try {
      user = new OrionUser(person);
    } catch (CoreException e) {
      throw new UserException(e);
    }
       if(init(person.getUserID())){
         try {
        user.createProject(IDavinciServerConstants.DEFAULT_PROJECT);
      } catch (IOException e) {
        throw new UserException(e);
      }
       }
       return user;
    }
View Full Code Here


    public IUser addUser(String userName, String password, String email) throws UserException, IOException {
    assertValidUserId(userName);

    if (checkUserExists(userName)) {
            throw new UserException(UserException.ALREADY_EXISTS);
        }

        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,null);
         
View Full Code Here

     * 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);
        persons.put(userName, person);
        savePersons();
View Full Code Here

        return null;
    }

    private void checkValidUserName(String userName) throws UserException {
        if (userName.indexOf(' ') >= 0) {
            throw new UserException(UserException.INVALID_USER_NAME);
        }
    }
View Full Code Here

     * java.lang.String, java.lang.String)
     */
    public IUser addUser(String userName, String password, String email) throws UserException, IOException {

        if (checkUserExists(userName)) {
            throw new UserException(UserException.ALREADY_EXISTS);
        }

        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();
            //File settingsDir = user.getSettingsDirectory();
           // settingsDir.mkdir();
            try {
        user.createProject(IDavinciServerConstants.DEFAULT_PROJECT);
      } catch (IOException e) {
        throw new UserException(e);
      }
           
            this.usersCount++;
            return user;
        }
View Full Code Here

TOP

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

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.