*/
public void registerByPlugin(UserDto userDto, boolean dryRun, BindingResult bindingResult)
throws UnexpectedErrorException, NoConnectionException {
Map<Long, RegistrationPlugin> registrationPlugins = pluginService.getRegistrationPlugins();
for (Map.Entry<Long, RegistrationPlugin> entry : registrationPlugins.entrySet()) {
RegistrationPlugin registrationPlugin = entry.getValue();
if (registrationPlugin != null && registrationPlugin.getState() == Plugin.State.ENABLED) {
Map<String, String> errors = dryRun
? registrationPlugin.validateUser(userDto, entry.getKey())
: registrationPlugin.registerUser(userDto, entry.getKey());
for (Map.Entry<String, String> error : errors.entrySet()) {
bindingResult.rejectValue(error.getKey(), null, error.getValue());
}
}
}