}
@Override
public void setPassword(String userName, String password) throws Exception {
try {
User user = usersRepository.getUserByName(userName);
if (user == null)
throw new UsersRepositoryException("user not found: " + userName);
if (!user.setPassword(password)) {
throw new UsersRepositoryException("Unable to update password for user " + user);
}
usersRepository.updateUser(user);
} catch (UsersRepositoryException e) {
throw new Exception(e.getMessage());