public void updateUser(User user, String newPassword) { User find = userFacade.find(user.getId()); find.setUsername(user.getUsername()); find.setEmail(user.getEmail()); if (!newPassword.equals("")) { find.setPassword(newPassword); } }
public User getUser(String userName) { List<User> users = userFacade.findAll(); User user = null; for (User u : users) { if (u.getUsername().equals(userName)) user = u; } return user; }
public void deleteUser(long id) { User user = userFacade.find(id); if (user != null) { userFacade.remove(user); } }
public List<User> listUsers() { return userFacade.findAll(); }
public void registerUser(User user) { userFacade.create(user); }