use of org.wso2.carbon.user.core.listener.UserOperationEventListener in project carbon-identity-framework by wso2.
the class IdentityUserNameResolverListener method doPostGetUserListWithID.
@Override
public boolean doPostGetUserListWithID(Condition condition, String domain, String profileName, int limit, int offset, String sortBy, String sortOrder, List<User> users, UserStoreManager userStoreManager) throws UserStoreException {
if (!isEnable()) {
return true;
}
List<String> userNamesList = users.stream().map(User::getUsername).collect(Collectors.toList());
String[] userNames = userNamesList.toArray(new String[0]);
for (UserOperationEventListener listener : getUserStoreManagerListeners()) {
if (isNotAResolverListener(listener)) {
return listener.doPostGetUserList(condition, domain, profileName, limit, offset, sortBy, sortOrder, userNames, userStoreManager);
}
}
return true;
}
use of org.wso2.carbon.user.core.listener.UserOperationEventListener in project carbon-identity-framework by wso2.
the class IdentityUserIdResolverListener method doPreUpdateUserListOfInternalRole.
@Override
public boolean doPreUpdateUserListOfInternalRole(String roleName, String[] deletedUsers, String[] newUsers, UserStoreManager userStoreManager) throws UserStoreException {
if (!isEnable()) {
return true;
}
String[] deletedUserIDs;
try {
deletedUserIDs = getUserIdsFromUserNames(deletedUsers, (AbstractUserStoreManager) userStoreManager);
} catch (UserStoreException e) {
// supported user store.
if (log.isDebugEnabled()) {
log.debug(e.getMessage(), e);
}
return true;
}
String[] newUserIDs;
try {
newUserIDs = getUserIdsFromUserNames(newUsers, (AbstractUserStoreManager) userStoreManager);
} catch (UserStoreException e) {
// supported user store.
if (log.isDebugEnabled()) {
log.debug(e.getMessage(), e);
}
return true;
}
for (UserOperationEventListener listener : getUserStoreManagerListeners()) {
if (isNotAResolverListener(listener)) {
if (!((UniqueIDUserOperationEventListener) listener).doPreUpdateUserListOfInternalRoleWithID(roleName, deletedUserIDs, newUserIDs, userStoreManager)) {
return false;
}
}
}
return true;
}
Aggregations