log.info("Found user AcctId: " + acctId + " (" + p.getDisplayName() + ") to be unlocked.");
}
// Queue action to refresh user info from AD - even if we're going to unlock the person, we should still
// update the database from LDAP
inActionContext.getUserActionRequests().add(new UserActionRequest(refreshPersonActionKey, null, p));
if (queueLockAccounts)
{
inActionContext.getUserActionRequests().add(
new UserActionRequest(lockPersonActionKey, null, new SetPersonLockedStatusRequest(acctId,
false)));
}
toUnlock++;
}
else if (unLockedUserAccountIds.contains(acctId))
{
log.debug("Queuing up a refresh of person: " + acctId);
// Queue action to refresh user info from AD
inActionContext.getUserActionRequests().add(new UserActionRequest(refreshPersonActionKey, null, p));
// remove from unlocked list, when done looping remaining ids will be locked.
unLockedUserAccountIds.remove(acctId);
}
else
{
if (log.isInfoEnabled())
{
log.info("Found user id: " + acctId + " (" + p.getDisplayName() + ") to be created.");
}
if (queueCreatePerson)
{
inActionContext.getUserActionRequests().add(
new UserActionRequest(createPersonActionKey, null, new CreatePersonRequest(p,
shouldSendEmail)));
}
toCreate++;
}
}
// Everyone that hasn't been removed from the unLockedUserAccountIds collection by this point needs to be
// locked.
toLock = unLockedUserAccountIds.size();
log.info("Determined there are " + unLockedUserAccountIds.size() + " user accounts to lock.");
for (String id : unLockedUserAccountIds)
{
if (log.isInfoEnabled())
{
log.info("Found user AcctId: " + id + " to be locked.");
}
if (queueLockAccounts)
{
inActionContext.getUserActionRequests().add(
new UserActionRequest(lockPersonActionKey, null, new SetPersonLockedStatusRequest(id, true)));
}
}
log.info("Summary: Lock: " + toLock + " unlock: " + toUnlock + " Create: " + toCreate
+ ". LOCK-UNLOCK ENABLED: " + queueLockAccounts + " CREATE ENABLED: " + queueCreatePerson);