use of com.tomasio.projects.trainning.dao.NetworkUserDAO in project trainning by fernandotomasio.
the class UserServiceSimpleImpl method findAllUsers.
@Override
public NetworkUserDTO[] findAllUsers() {
NetworkUserDAO dao = factory.getNetworkUserDAO();
NetworkUserDTO[] usersArray = null;
try {
List<NetworkUserDTO> users = dao.findAll();
if (users != null) {
usersArray = new NetworkUserDTO[users.size()];
users.toArray(usersArray);
}
} catch (DAOException ex) {
throw new CoreException("Erro de acesso ao serviço de diretórios: " + ex.getMessage());
}
return usersArray;
}
use of com.tomasio.projects.trainning.dao.NetworkUserDAO in project trainning by fernandotomasio.
the class Ldap method main.
public static void main(String[] args) throws DAOException {
@SuppressWarnings("resource") ApplicationContext context = new ClassPathXmlApplicationContext("spring-context.xml");
NetworkUserDAO dao = (NetworkUserDAO) context.getBean("networkUserDAO");
dao.authenticate("fernandofot", "fernandofot");
System.out.println("");
}
use of com.tomasio.projects.trainning.dao.NetworkUserDAO in project trainning by fernandotomasio.
the class UserServiceSimpleImpl method searchUsers.
@Override
public NetworkUserDTO[] searchUsers(String term) {
NetworkUserDAO dao = factory.getNetworkUserDAO();
NetworkUserDTO[] usersArray = null;
try {
List<NetworkUserDTO> users = dao.search(term);
if (users != null) {
usersArray = new NetworkUserDTO[users.size()];
users.toArray(usersArray);
}
} catch (DAOException ex) {
throw new CoreException("Erro de acesso ao serviço de diretórios: " + ex.getMessage());
}
return usersArray;
}
use of com.tomasio.projects.trainning.dao.NetworkUserDAO in project trainning by fernandotomasio.
the class UserServiceSimpleImpl method updateUserPassword.
@Override
public void updateUserPassword(String password, String uid) {
NetworkUserDAO dao = factory.getNetworkUserDAO();
try {
NetworkUserDTO user = dao.find(uid);
user.setPassword(password);
dao.update(user);
} catch (DAOException ex) {
throw new CoreException("Erro de acesso ao serviço de diretórios: " + ex.getMessage());
}
}
use of com.tomasio.projects.trainning.dao.NetworkUserDAO in project trainning by fernandotomasio.
the class UserServiceSimpleImpl method findUser.
@Override
public NetworkUserDTO findUser(String uid) {
NetworkUserDAO dao = factory.getNetworkUserDAO();
NetworkUserDTO user = null;
try {
user = dao.find(uid);
} catch (DAOException ex) {
throw new CoreException("Erro de acesso ao serviço de diretórios: " + ex.getMessage());
}
return user;
}
Aggregations