@Override public void addUsers(User user) throws UserAlreadyExistsException, PasswordIsTooWeakException { try { hasUser(user.getUsername()); } catch (UserUnknownException e) { super.addUsers(user); return; } throw new UserAlreadyExistsException(user.getUsername()); }
protected void remove() { getSlash(); for (User user : super.getUsersSet()) { this.removeUsers(user.getUsername()); user.remove(); } deleteDomainObject(); }
public User getUserByUsername(String username) throws UserUnknownException { for (User user : super.getUsersSet()) { if (user.getUsername().equals(username)) return user; } throw new UserUnknownException(username); }