Package org.mapache.business.user

Source Code of org.mapache.business.user.UserManager

package org.mapache.business.user;

import java.util.Collection;

import org.mapache.business.MapacheException;
import org.mapache.business.configuration.ConfigurationManager;
import org.mapache.data.DAOException;
import org.mapache.data.UserDAO;

public class UserManager {
    private UserDAO userDataAccess;
    private ConfigurationManager configurationManager;

    public UserManager() {
        userDataAccess =
                configurationManager.getInstance().getDAOFactory().getUserDAO();
    }

    public boolean authenticateUser(User unAuthorized) throws MapacheException {
       return userDataAccess.authenticateUser(unAuthorized);
    }

    public Collection<User> getUsers() throws MapacheException {
        Collection<User> users = null;
        try {
            users = userDataAccess.searchUsers();
        } catch (DAOException e) {
            throw new MapacheException("Unable to find users", e);
        }
        return users;
    }
}
TOP

Related Classes of org.mapache.business.user.UserManager

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.