Package org.apache.james.user.api.model

Examples of org.apache.james.user.api.model.User


     * @see org.apache.james.user.api.UsersRepository#getUserByName(String)
     */
    @Override
    public User getUserByName(String name) throws UsersRepositoryException {
        KeyValue keyValue = getKeyValue(name);
        User user = null;
        if (keyValue != null) {
            user = new DefaultUser(Bytes.toString(keyValue.getRow()), Bytes.toString(keyValue.getValue()), algo);
        }
        return user;
    }
View Full Code Here


            throw new UsersRepositoryException("Please provide a non null user");
        }
        if (!(user instanceof DefaultUser)) {
            throw new UsersRepositoryException("Please provide a user instanceof DefaultUser");
        }
        User existingUser = getUserByName(user.getUserName());
        if (existingUser == null) {
            throw new UsersRepositoryException("Please provide an existing user to update");
        }
        putUser((DefaultUser) user, false);
    }
View Full Code Here

    public void addUser(String username, String password) throws UsersRepositoryException {
        if (contains(username)) {
            throw new UsersRepositoryException("User " + username + " already exist");
        }
        isValidUsername(username);
        User newbie = new DefaultUser(username, "SHA");
        newbie.setPassword(password);
        doAddUser(newbie);
    }
View Full Code Here

     *            the name to case-correct
     * @return the case-correct name of the user, null if the user doesn't exist
     * @throws UsersRepositoryException
     */
    public String getRealName(String name) throws UsersRepositoryException {
        User u = getUserByName(name);
        if (u != null) {
            u.getUserName();
        }
        return null;
    }
View Full Code Here

     *         or if the password is incorrect
     *
     * @since James 1.2.2
     */
    public boolean test(String name, String password) throws UsersRepositoryException {
        final User user = getUserByName(name);
        final boolean result;
        result = user != null && user.verifyPassword(password);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.james.user.api.model.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.