Examples of DuplicateUserException


Examples of com.brienwheeler.svc.users.DuplicateUserException

  {
    username = ValidationUtils.assertNotEmpty(username, "username cannot be empty");
    hashedPassword = ValidationUtils.assertNotEmpty(hashedPassword, "hashedPassword cannot be empty");
 
    if (findByUsername(username) != null)
      throw new DuplicateUserException("username already exists: " + username);

    User user = userDao.save(new User(username, hashedPassword));
   
    if (callbacks != null)
    {
View Full Code Here

Examples of com.ecyrd.jspwiki.auth.user.DuplicateUserException

        try
        {
            otherProfile = getUserDatabase().findByLoginName( profile.getLoginName() );
            if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
            {
                throw new DuplicateUserException( "The login name '" + profile.getLoginName() + "' is already taken." );
            }
        }
        catch( NoSuchPrincipalException e )
        {
        }
        try
        {
            otherProfile = getUserDatabase().findByFullName( profile.getFullname() );
            if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
            {
                throw new DuplicateUserException( "The full name '" + profile.getFullname() + "' is already taken." );
            }
        }
        catch( NoSuchPrincipalException e )
        {
        }
View Full Code Here

Examples of com.jappstart.exception.DuplicateUserException

    public final void addUser(final UserAccount user, final Locale locale) {
        final UserAccount cachedUser = (UserAccount) memcacheService.get(
            user.getUsername());

        if (cachedUser != null) {
            throw new DuplicateUserException();
        }

        final Query query = entityManager.createQuery(
            "SELECT u FROM UserAccount u WHERE username = :username");
        query.setParameter(USERNAME, user.getUsername());

        @SuppressWarnings("unchecked")
        final List results = query.getResultList();
        if (results != null && !results.isEmpty()) {
            throw new DuplicateUserException();
        }

        entityManager.persist(user);

        memcacheService.put(user.getUsername(), user,
View Full Code Here

Examples of com.porterhead.rest.user.exception.DuplicateUserException

    @Transactional
    public AuthenticatedUserToken createUser(CreateUserRequest request, Role role) {
        validate(request);
        User searchedForUser = userRepository.findByEmailAddress(request.getUser().getEmailAddress());
        if (searchedForUser != null) {
            throw new DuplicateUserException();
        }

        User newUser = createNewUser(request, role);
        AuthenticatedUserToken token = new AuthenticatedUserToken(newUser.getUuid().toString(), createAuthorizationToken(newUser).getToken());
        userRepository.save(newUser);
View Full Code Here

Examples of com.porterhead.rest.user.exception.DuplicateUserException

        assertThat(response.getStatus(), is(400));
    }

    @Test
    public void duplicateUserOnCreateUser() {
        when(userService.createUser(any(CreateUserRequest.class), any(Role.class))).thenThrow(new DuplicateUserException());
        CreateUserRequest request = createSignupRequest();
        ClientResponse response = super.resource().path("user").entity(request, APPLICATION_JSON).accept(APPLICATION_JSON).post(ClientResponse.class);
        assertThat(response.getStatus(), is(409));
    }
View Full Code Here

Examples of io.conducive.server.db.exception.DuplicateUserException

        checkNotNull(user.getUsername(), "Username should not be null");
        checkNotNull(user.getHash(), "Password should not be null");
        checkNotNull(user.getSalt(), "Salt should not be null");

        if (users().containsKey(user.getUsername())) {
            throw new DuplicateUserException();
        }

        // hash from client is already stretched. stretch some more. distance from what is stored vs password is
        // 2^(LoginView.EXP + UserDAOImpl.EXP), i.e. 2^29
        logger.info("Stretching");
View Full Code Here

Examples of org.apache.james.managesieve.api.DuplicateUserException

                getUserDirectory(user);
            } catch (UserNotFoundException ex) {
                userExists = false;
            }
            if (userExists) {
                throw new DuplicateUserException("User: " + user);
            }
            File dir = getUserDirectoryFile(user);
            try {
                FileUtils.forceMkdir(dir);
            } catch (IOException ex) {
View Full Code Here

Examples of org.apache.james.managesieve.api.DuplicateUserException

     * @see org.apache.james.managesieve.api.SieveRepository#addUser(java.lang.String)
     */
    public void addUser(String user) throws DuplicateUserException, StorageException {
        if (_repository.containsKey(user))
        {
            throw new DuplicateUserException(user);
        }
        _repository.put(user, new HashMap<String, SieveScript>());              
    }
View Full Code Here

Examples of org.apache.wiki.auth.user.DuplicateUserException

        try
        {
            otherProfile = getUserDatabase().findByLoginName( profile.getLoginName() );
            if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
            {
                throw new DuplicateUserException( "security.error.login.taken", profile.getLoginName() );
            }
        }
        catch( NoSuchPrincipalException e )
        {
        }
        try
        {
            otherProfile = getUserDatabase().findByFullName( profile.getFullname() );
            if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
            {
                throw new DuplicateUserException( "security.error.fullname.taken", profile.getFullname() );
            }
        }
        catch( NoSuchPrincipalException e )
        {
        }
View Full Code Here

Examples of org.apache.wiki.auth.user.DuplicateUserException

        try
        {
            otherProfile = getUserDatabase().findByLoginName( profile.getLoginName() );
            if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
            {
                throw new DuplicateUserException( "security.error.login.taken", profile.getLoginName() );
            }
        }
        catch( NoSuchPrincipalException e )
        {
        }
        try
        {
            otherProfile = getUserDatabase().findByFullName( profile.getFullname() );
            if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
            {
                throw new DuplicateUserException( "security.error.fullname.taken", profile.getFullname() );
            }
        }
        catch( NoSuchPrincipalException e )
        {
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.