public void updateUsers(IRequestCycle cycle)
{
Visit visit = getVisitState();
VirtualLibraryEngine vengine = (VirtualLibraryEngine) cycle.getEngine();
UserConverter converter = getUserConverter();
Person[] updates = (Person[]) converter.getValues().toArray(new Person[0]);
Integer[] deletedIds = extractIds(converter.getDeletedValues());
Integer[] resetPasswordIds = extractIds(converter.getResetPasswordValues());
String password = getPassword();
setPassword(null);
if (HiveMind.isBlank(password) && resetPasswordIds.length > 0)
{
getValidationDelegate().record(getPasswordField(), needPassword());
return;
}
Integer adminId = visit.getUserId();
int i = 0;
while (true)
{
try
{
IOperations operations = vengine.getOperations();
operations.updatePersons(updates, resetPasswordIds, password, deletedIds, adminId);
break;
}
catch (RemoteException ex)
{
vengine.rmiFailure(updateFailure(), ex, i++);
}
catch (RemoveException ex)
{
throw new ApplicationRuntimeException(ex);
}