You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/08/03 16:01:31 UTC
[15/50] [abbrv] airavata git commit: AIRAVATA-2405 getUsersWithRole
debug logging
AIRAVATA-2405 getUsersWithRole debug logging
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/226cd3fb
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/226cd3fb
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/226cd3fb
Branch: refs/heads/master
Commit: 226cd3fb734c9bdbd8fcb616fd0636c9be409697
Parents: 45bbc25
Author: Marcus Christie <ma...@apache.org>
Authored: Sat Jul 8 23:28:51 2017 -0500
Committer: Marcus Christie <ma...@apache.org>
Committed: Sat Jul 8 23:28:51 2017 -0500
----------------------------------------------------------------------
.../admin/services/core/impl/TenantManagementKeycloakImpl.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/226cd3fb/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java b/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
index 91c0f4e..fc6af61 100644
--- a/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
+++ b/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
@@ -535,14 +535,17 @@ public class TenantManagementKeycloakImpl implements TenantManagementInterface {
try{
client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, realmAdminCreds);
// FIXME: this only searches through the most recent 100 users for the given role (assuming there are no more than 10,000 users in the gateway)
+ logger.debug("getUsersWithRole: fetching all users...");
List<UserRepresentation> allUsers = client.realm(tenantId).users().search(null,
null,
null,
null,
0, 10000);
+ logger.debug("getUsersWithRole: all users count=" + allUsers.size());
allUsers.sort((a, b) -> a.getCreatedTimestamp() - b.getCreatedTimestamp() > 0 ? -1 : 1);
// The 100 most recently created users
List<UserRepresentation> mostRecentUsers = allUsers.subList(0, Math.min(allUsers.size(), 100));
+ logger.debug("getUsersWithRole: most recent users count=" + mostRecentUsers.size());
List<UserProfile> usersWithRole = new ArrayList<>();
for (UserRepresentation user: mostRecentUsers) {
@@ -556,6 +559,7 @@ public class TenantManagementKeycloakImpl implements TenantManagementInterface {
}
}
}
+ logger.debug("getUsersWithRole: most recent users with role count=" + usersWithRole.size());
return usersWithRole;
} catch (ApplicationSettingsException ex) {
logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);