agave-profiles/profiles-core/src/main/java/org/iplantc/service/profile/dao/ScimProfileDAO.java
/**
	 * Makes API call to SCIM API for profile info.
	 * @param filter the filter to apply to the query
	 * @param offset the number of results to skip before returing the following {@code limit} results
	 * @param limit the max number of results to return
	 * @return a list of Profile objects mapped from the query response of the SCIM2 service
	 * @throws RemoteDataException if the service is unavailable.
	 */
Makes API call to SCIM API for profile info.
Makes API call to SCIM API for profile info .
private List<Profile> fetchResults(Filter filter, int limit, int offset) throws RemoteDataException
	{
		limit = Math.min(Math.max(0, limit), Settings.MAX_PAGE_SIZE);
		offset = Math.max(1, offset+1);
		List<Profile> profiles = new ArrayList<Profile>();
		try {
			ScimService scimService = getScimService();
			SearchRequestBuilder builder = scimService.searchRequest("Users").page(offset, limit);
			if (filter != null) {
				builder.filter(filter.toString());
			}
			ListResponse<UserResource> searchResponse = builder.invoke(UserResource.class);
			return searchResponse
					.getResources()
					.stream()
					.map(ScimProfile::new)
					.collect(Collectors.toList());
		} 
		catch (Exception e) {
			throw new RemoteDataException("Failed to retrieve profile data", e);
		}
	}
private List < Profile > fetchResults ( Filter filter , int limit , int offset ) throws RemoteDataException { limit = Math . min ( Math . max ( 0 , limit ) , Settings . MAX_PAGE_SIZE ) ; offset = Math . max ( 1 , offset + 1 ) ; List < Profile > profiles = new ArrayList < Profile > ( ) ; try { ScimService scimService = getScimService ( ) ; SearchRequestBuilder builder = scimService . searchRequest ( "Users" ) . page ( offset , limit ) ; if ( filter != null ) { builder . filter ( filter . toString ( ) ) ; } ListResponse < UserResource > searchResponse = builder . invoke ( UserResource . class ) ; return searchResponse . getResources ( ) . stream ( ) . map ( ScimProfile :: new ) . collect ( Collectors . toList ( ) ) ; } catch ( Exception e ) { throw new RemoteDataException ( "Failed to retrieve profile data" , e ) ; } }
Makes API call to SCIM API for profile info.
Makes API call to SCIM API for profile info .
// Create a ScimService using the credentials in the service config