Package org.apache.james.user.jcr.model

Examples of org.apache.james.user.jcr.model.JCRUser


                final String path = USERS_PATH + "/" + name;
                final Node rootNode = session.getRootNode();
               
                try {
                    final Node node = rootNode.getNode(path);
                    user = new JCRUser(node.getProperty(USERNAME_PROPERTY).getString(),
                            node.getProperty(PASSWD_PROPERTY).getString());
                } catch (PathNotFoundException e) {
                    // user not found
                    user = null;
                }
View Full Code Here


     * @return true if successful.
     */
    public boolean updateUser(final User user) {
        if (user != null && user instanceof JCRUser)
        {
            final JCRUser jcrUser = (JCRUser) user;
            final String userName = jcrUser.getUserName();
            try {
                final Session session = login();
                try {
                    final String name = toSafeName(userName);
                    final String path = USERS_PATH + "/" + name;
                    final Node rootNode = session.getRootNode();
                   
                    try {
                        final String hashedSaltedPassword = jcrUser.getHashedSaltedPassword();
                        rootNode.getNode(path).setProperty(PASSWD_PROPERTY, hashedSaltedPassword);
                        session.save();
                        return true;
                    } catch (PathNotFoundException e) {
                        // user not found
View Full Code Here

                final String path = USERS_PATH + "/" + name;
                final Node rootNode = session.getRootNode();

                try {
                    final Node node = rootNode.getNode(path);
                    user = new JCRUser(node.getProperty(USERNAME_PROPERTY).getString(), node.getProperty(PASSWD_PROPERTY).getString());
                } catch (PathNotFoundException e) {
                    // user not found
                    user = null;
                }
            } finally {
View Full Code Here

     * @throws UsersRepositoryException
     *            If an error occurred
     */
    public void updateUser(final User user) throws UsersRepositoryException {
        if (user != null && user instanceof JCRUser) {
            final JCRUser jcrUser = (JCRUser) user;
            final String userName = jcrUser.getUserName();
            try {
                final Session session = login();
                try {
                    final String name = toSafeName(userName);
                    final String path = USERS_PATH + "/" + name;
                    final Node rootNode = session.getRootNode();

                    try {
                        final String hashedSaltedPassword = jcrUser.getHashedSaltedPassword();
                        rootNode.getNode(path).setProperty(PASSWD_PROPERTY, hashedSaltedPassword);
                        session.save();
                    } catch (PathNotFoundException e) {
                        // user not found
                        getLogger().debug("User not found");
View Full Code Here

TOP

Related Classes of org.apache.james.user.jcr.model.JCRUser

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.