@GET @Path("/authSessions") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_AUTH_SESSIONS + "\")") public VXAuthSessionList getAuthSessions(@Context HttpServletRequest request) { SearchCriteria searchCriteria = searchUtil.extractCommonCriterias(request, AuthSessionService.AUTH_SESSION_SORT_FLDS); searchUtil.extractLong(request, searchCriteria, "id", "Auth Session Id"); searchUtil.extractLong(request, searchCriteria, "userId", "User Id"); searchUtil.extractInt(request, searchCriteria, "authStatus", "Auth Status"); searchUtil.extractInt(request, searchCriteria, "authType", "Auth Type"); searchUtil.extractInt(request, searchCriteria, "deviceType", "Device Type"); searchUtil.extractString( request, searchCriteria, "firstName", "User First Name", StringUtil.VALIDATION_NAME); searchUtil.extractString( request, searchCriteria, "lastName", "User Last Name", StringUtil.VALIDATION_NAME); searchUtil.extractString( request, searchCriteria, "requestUserAgent", "User Agent", StringUtil.VALIDATION_TEXT); searchUtil.extractString( request, searchCriteria, "requestIP", "Request IP Address", StringUtil.VALIDATION_IP_ADDRESS); searchUtil.extractString( request, searchCriteria, "loginId", "Login ID", StringUtil.VALIDATION_TEXT); searchUtil.extractDate(request, searchCriteria, "startDate", "Start date for search", null); searchUtil.extractDate(request, searchCriteria, "endDate", "End date for search", null); return sessionMgr.searchAuthSessions(searchCriteria); }
/** * Implements the traditional search functionalities for XUsers * * @param request * @return */ @GET @Path("/users") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_USERS + "\")") public VXUserList searchXUsers(@Context HttpServletRequest request) { SearchCriteria searchCriteria = searchUtil.extractCommonCriterias(request, xUserService.sortFields); searchUtil.extractString(request, searchCriteria, "name", "User name", null); searchUtil.extractString(request, searchCriteria, "emailAddress", "Email Address", null); searchUtil.extractInt(request, searchCriteria, "userSource", "User Source"); searchUtil.extractInt(request, searchCriteria, "isVisible", "User Visibility"); searchUtil.extractInt(request, searchCriteria, "status", "User Status"); searchUtil.extractStringList( request, searchCriteria, "userRoleList", "User Role List", "userRoleList", null, null); searchUtil.extractString(request, searchCriteria, "userRole", "UserRole", null); return xUserMgr.searchXUsers(searchCriteria); }
/** * Implements the traditional search functionalities for XGroups * * @param request * @return */ @GET @Path("/groups") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_GROUPS + "\")") public VXGroupList searchXGroups(@Context HttpServletRequest request) { SearchCriteria searchCriteria = searchUtil.extractCommonCriterias(request, xGroupService.sortFields); searchUtil.extractString(request, searchCriteria, "name", "group name", null); searchUtil.extractInt(request, searchCriteria, "isVisible", "Group Visibility"); searchUtil.extractString(request, searchCriteria, "groupSource", "group source", null); return xUserMgr.searchXGroups(searchCriteria); }