From 2b6882e3676510604ff45886a1420d3b58843a7d Mon Sep 17 00:00:00 2001 From: user Date: Wed, 9 Aug 2023 00:13:43 +0530 Subject: [PATCH 1/3] Improve the performance by having equal operator instead of LIKE operator when counting total users --- .../scim2/common/impl/SCIMUserManager.java | 24 ++++++++++++++++++- pom.xml | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java index 12502e222..38382de53 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java @@ -719,6 +719,28 @@ private long getTotalUsers(String domainName) throws CharonException { return totalUsers; } + private long getTotalUsers(ExpressionNode node, String domainName) throws CharonException { + + long totalUsers = 0; + AbstractUserStoreManager secondaryUserStoreManager = null; + if (StringUtils.isNotBlank(domainName)) { + secondaryUserStoreManager = (AbstractUserStoreManager) carbonUM + .getSecondaryUserStoreManager(domainName); + } + try { + if (secondaryUserStoreManager instanceof JDBCUserStoreManager) { + if (node != null && node.getOperation() != null && SCIMCommonConstants.EQ.equals(node.getOperation())) { + totalUsers = secondaryUserStoreManager.countUsersWithClaims(node.getValue(), node.getOperation()); + } else { + totalUsers = secondaryUserStoreManager.countUsersWithClaims(USERNAME_CLAIM, SCIMCommonConstants.ANY); + } + } + } catch (org.wso2.carbon.user.core.UserStoreException e) { + throw resolveError(e, "Error while getting total user count in domain: " + domainName); + } + return totalUsers; + } + /** * Method to decide whether to paginate based on the offset and the limit in the request. * @@ -1394,7 +1416,7 @@ private UsersGetResponse filterUsersBySingleAttribute(ExpressionNode node, Map3.3.7 6.5.3 3.2.0.wso2v1 - 4.9.4 + 4.9.10 5.25.143 4.13.1 20030203.000129 From f31df1870bd03f920b4f8107b03e6be838c50990 Mon Sep 17 00:00:00 2001 From: user Date: Mon, 20 Nov 2023 12:28:54 +0530 Subject: [PATCH 2/3] Resolve conflicts Resolve conflicts resolve conflicts --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 01c127dd4..2cf759156 100644 --- a/pom.xml +++ b/pom.xml @@ -257,8 +257,8 @@ 3.3.7 6.5.3 3.2.0.wso2v1 - 4.9.10 - 5.25.143 + 4.9.18 + 5.25.509 4.13.1 20030203.000129 1.8.12 From 5477f7a9353077ed1b096928f2bb53edef8103db Mon Sep 17 00:00:00 2001 From: user Date: Mon, 20 Nov 2023 13:05:42 +0530 Subject: [PATCH 3/3] Update kernel version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5897cd44a..2f211340f 100644 --- a/pom.xml +++ b/pom.xml @@ -284,7 +284,7 @@ 3.3.7 6.5.3 3.2.0.wso2v1 - 4.9.15 + 4.9.18 5.25.509 4.13.1 20030203.000129