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;
}
}