Package org.exolab.jms.authentication

Examples of org.exolab.jms.authentication.User


     */
    public void importCollection(StoreIterator iterator) throws JMSException,
            PersistenceException {
        Connection connection = _database.getConnection();
        while (iterator.hasNext()) {
            User user = (User) iterator.next();
            _database.getAdapter().addUser(connection, user);
        }
        _database.commit();
    }
View Full Code Here


                                 User user)
        throws PersistenceException {

        PreparedStatement getUser = null;
        ResultSet set = null;
        User result = null;

        if (user != null) {
            try {
                getUser = connection.prepareStatement(
                    "select * from users where username=?");
                getUser.setString(1, user.getUsername());
                set = getUser.executeQuery();
                if (set.next()) {
                    result = new User(set.getString(1), set.getString(2));
                }
            } catch (Exception error) {
                throw new PersistenceException("Users.get failed "
                    + error.toString());
            } finally {
View Full Code Here

    public synchronized Vector getAllUsers(Connection connection)
        throws PersistenceException {

        PreparedStatement getUsers = null;
        ResultSet set = null;
        User user = null;
        Vector result = new Vector();

        try {
            getUsers = connection.prepareStatement(
                "select * from users");
            set = getUsers.executeQuery();
            while (set.next()) {
                user = new User(set.getString(1), set.getString(2));
                result.add(user);
            }
        } catch (Exception error) {
            throw new PersistenceException("Users.getAllUsers failed ",
                error);
View Full Code Here

     * @param password the users password
     * @return <code>true</code> if the user is added otherwise
     *         <code>false</code>
     */
    public boolean addUser(String username, String password) {
        return _authenticator.addUser(new User(username, password));
    }
View Full Code Here

     * @param password the users password
     * @return <code>true</code> if the password is changed otherwise
     *         <code>false</code>
     */
    public boolean changePassword(String username, String password) {
        return _authenticator.updateUser(new User(username, password));
    }
View Full Code Here

     * @param username the users name
     * @return <code>true</code> if the user is removed otherwise
     *         <code>false</code>
     */
    public boolean removeUser(String username) {
        return _authenticator.removeUser(new User(username, null));
    }
View Full Code Here

        try {
            _database.begin();
            Connection connection = _database.getConnection();

            _database.getAdapter().addUser(connection,
                    new User(username, password));
            _database.commit();
            success = true;
        } catch (PersistenceException exception) {
            error("Failed to add user=" + username, exception);
        }
View Full Code Here

        try {
            _database.begin();
            Connection connection = _database.getConnection();

            _database.getAdapter().updateUser(connection,
                    new User(username, password));
            _database.commit();
            success = true;
        } catch (PersistenceException exception) {
            error("Failed to change password for user=" + username, exception);
        }
View Full Code Here

        try {
            _database.begin();
            Connection connection = _database.getConnection();

            _database.getAdapter().removeUser(connection,
                    new User(username, null));
            _database.commit();
            result = true;
        } catch (PersistenceException exception) {
            error("Failed to remove user=" + username, exception);
        }
View Full Code Here

     * @param password the user's password
     * @throws PersistenceException for any error
     */
    private void addUser(String user, String password)
            throws PersistenceException {
        _adapter.addUser(_connection, new User(user, password));
    }
View Full Code Here

TOP

Related Classes of org.exolab.jms.authentication.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.