From 87a5b092669265b79ce48f10cebc2c73f20ac81d Mon Sep 17 00:00:00 2001 From: harshanl Date: Fri, 9 Sep 2016 19:16:00 +0530 Subject: [PATCH] Added users/count API --- .../mgt/jaxrs/service/impl/UserManagementServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java index df34771125c..294e52928c1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java @@ -327,7 +327,9 @@ public class UserManagementServiceImpl implements UserManagementService { try { UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager(); int userCount = userStoreManager.listUsers("*", -1).length; - return Response.status(Response.Status.OK).entity(userCount).build(); + BasicUserInfoList result = new BasicUserInfoList(); + result.setCount(userCount); + return Response.status(Response.Status.OK).entity(result).build(); } catch (UserStoreException e) { String msg = "Error occurred while retrieving the user count."; log.error(msg, e);