use of io.datarouter.web.user.databean.DatarouterUser.DatarouterUserByUserTokenLookup in project datarouter by hotpads.
the class DatarouterUserService method assertUserDoesNotExist.
public void assertUserDoesNotExist(Long id, String userToken, String username) {
DatarouterUser userWithId = getUserById(id);
if (userWithId != null) {
throw new IllegalArgumentException("DatarouterUser already exists with id=" + id);
}
DatarouterUser userWithUserToken = nodes.getByUserToken(new DatarouterUserByUserTokenLookup(userToken));
if (userWithUserToken != null) {
throw new IllegalArgumentException("DatarouterUser already exists with userToken=" + userToken);
}
DatarouterUser userWithEmail = nodes.getByUsername(new DatarouterUserByUsernameLookup(username));
if (userWithEmail != null) {
throw new IllegalArgumentException("DatarouterUser already exists with username=" + username);
}
}
Aggregations