use of eu.bcvsolutions.idm.core.model.event.IdentityRoleValidRequestEvent in project CzechIdMng by bcvsolutions.
the class IdentityRoleValidRequestTaskExecutor method process.
@Override
public Boolean process() {
boolean canContinue = true;
counter = 0L;
List<IdmIdentityRoleValidRequestDto> list = validRequestService.findAllValid();
// init count
if (count == null) {
count = Long.valueOf(list.size());
}
LOG.info("Account management starts for all newly valid roles from now. Count [{}]", count);
for (IdmIdentityRoleValidRequestDto request : list) {
try {
// after success provisioning is request removed from db
entityEventManager.process(new IdentityRoleValidRequestEvent(IdentityRoleValidRequestEventType.IDENTITY_ROLE_VALID, request));
} catch (RuntimeException e) {
// log failed operation
request.increaseAttempt();
request.setResult(new OperationResult.Builder(OperationState.NOT_EXECUTED).setCause(e).build());
this.validRequestService.save(request);
}
counter++;
canContinue = updateState();
if (!canContinue) {
break;
}
}
return Boolean.TRUE;
}
Aggregations