use of org.wso2.carbon.identity.api.server.idp.v1.model.IdentityProviderListResponse in project identity-api-server by wso2.
the class ServerIdpManagementService method createIDPListResponse.
private IdentityProviderListResponse createIDPListResponse(IdpSearchResult idpSearchResult, List<String> requestedAttributeList) {
List<IdentityProvider> idps = idpSearchResult.getIdPs();
IdentityProviderListResponse listResponse = new IdentityProviderListResponse();
if (CollectionUtils.isNotEmpty(idps)) {
List<IdentityProviderListItem> identityProviderList = new ArrayList<>();
for (IdentityProvider idp : idps) {
IdentityProviderListItem listItem = populateIDPListResponse(idp, requestedAttributeList);
identityProviderList.add(listItem);
}
listResponse.setIdentityProviders(identityProviderList);
listResponse.setCount(idps.size());
} else {
listResponse.setCount(0);
}
listResponse.setTotalResults(idpSearchResult.getTotalIDPCount());
listResponse.setStartIndex(idpSearchResult.getOffSet() + 1);
listResponse.setLinks(createLinks(V1_API_PATH_COMPONENT + IDP_PATH_COMPONENT, idpSearchResult.getLimit(), idpSearchResult.getOffSet(), idpSearchResult.getTotalIDPCount(), idpSearchResult.getFilter()));
return listResponse;
}
Aggregations