diff options
author | Sunder Tattavarada <statta@research.att.com> | 2020-06-10 15:50:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-06-10 15:50:48 +0000 |
commit | 9c9c3bdb37389cb6e49278038b27c445e7cdb6b6 (patch) | |
tree | 39ab47185f70ce44a731dfaf864b216fc4e5b03d /ecomp-sdk/epsdk-app-common/src | |
parent | 6be714fd6ddf3a3f088019cd81b32120d86ef682 (diff) | |
parent | 1484acff4ddce388b61f46761c188d859a4309c5 (diff) |
Merge "Improved Profile Search performance"
Diffstat (limited to 'ecomp-sdk/epsdk-app-common/src')
-rw-r--r-- | ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java index ff80d413..24e44d4b 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java @@ -139,6 +139,24 @@ public class ProfileSearchController extends RestrictedBaseController { logger.error(EELFLoggerDelegate.applicationLogger, "getUserPagination failed", e); } } + + @RequestMapping(value = { "/get_all_users" }, method = RequestMethod.GET) + public void getAllUsers(HttpServletRequest request, HttpServletResponse response) { + Map<String, Object> model = new HashMap<>(); + ObjectMapper mapper = new ObjectMapper(); + logger.info(EELFLoggerDelegate.applicationLogger, "Initiating get_all_users in ProfileSearchController"); + List<User> profileList = null; + try { + profileList = service.listAllUsers(); + model.put("profileList", mapper.writeValueAsString(profileList)); + JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); + JSONObject j = new JSONObject(msg); + response.setContentType(APPLICATION_JSON); + response.getWriter().write(j.toString()); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.applicationLogger, "getAllUsers failed", e); + } + } @SuppressWarnings("unchecked") private Map<String, Object> setDashboardData(HttpServletRequest request) |