Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jul 13, 2015
2 parents 0fbf579 + 5bbf470 commit 3737462
Showing 1 changed file with 12 additions and 3 deletions.
Expand Up @@ -198,16 +198,21 @@ public <O extends ObjectType> TaskRunResult runInternal(Task task) {
}

SearchResultList<PrismObject<O>> objects;
do {
while (true) {

objects = modelService.searchObjects(objectType, query, searchOptions, task, opResult);

if (objects.isEmpty()) {
break;
}

int skipped = 0;
for(PrismObject<O> object: objects) {

if (!optionRaw && ShadowType.class.isAssignableFrom(objectType)
&& Boolean.TRUE == ((ShadowType)(object.asObjectable())).isProtectedObject()) {
LOGGER.debug("Skipping delete of protected object {}", object);
progress++;
skipped++;
continue;
}

Expand All @@ -222,7 +227,11 @@ public <O extends ObjectType> TaskRunResult runInternal(Task task) {
LOGGER.trace("Deleted {} objects, result:\n{}", progress, opResult.debugDump());
}

} while (!objects.isEmpty());
if (objects.size() == skipped) {
break;
}

}

} catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException
| ExpressionEvaluationException | ConfigurationException
Expand Down

0 comments on commit 3737462

Please sign in to comment.