use of org.wso2.carbon.identity.api.server.fetch.remote.v1.model.RemoteFetchConfigurationListResponse in project identity-api-server by wso2.
the class ServerRemoteFetchConfigManagementService method getRemoteFetchConfigs.
/**
* Get list of remote fetch configurations.
*
* @return RemoteFetchConfigurationListResponse.
*/
public RemoteFetchConfigurationListResponse getRemoteFetchConfigs() {
OptionalInt optionalIntLimit = OptionalInt.empty();
OptionalInt optionalIntOffset = OptionalInt.empty();
try {
return createRemoteFetchConfigurationListResponse(RemoteFetchServiceHolder.getRemoteFetchConfigurationService().getBasicRemoteFetchConfigurationList(optionalIntLimit, optionalIntOffset));
} catch (RemoteFetchCoreException e) {
throw handleRemoteFetchConfigurationException(e, RemoteFetchConfigurationConstants.ErrorMessage.ERROR_CODE_ERROR_LISTING_RF_CONFIGS, null);
}
}
use of org.wso2.carbon.identity.api.server.fetch.remote.v1.model.RemoteFetchConfigurationListResponse in project identity-api-server by wso2.
the class ServerRemoteFetchConfigManagementService method createRemoteFetchConfigurationListResponse.
/**
* This method is used to create list response from basic remote fetch configuration.
* This method is create list item from basic remote fetch configuration list items.
*
* @param basicRemoteFetchConfigurationList List response.
* @return RemoteFetchConfigurationListResponse.
*/
private RemoteFetchConfigurationListResponse createRemoteFetchConfigurationListResponse(List<BasicRemoteFetchConfiguration> basicRemoteFetchConfigurationList) {
RemoteFetchConfigurationListResponse remoteFetchConfigurationListResponse = new RemoteFetchConfigurationListResponse();
if (CollectionUtils.isNotEmpty(basicRemoteFetchConfigurationList)) {
List<RemoteFetchConfigurationListItem> remoteFetchConfigurations = new ArrayList<>();
for (BasicRemoteFetchConfiguration basicRemoteFetchConfiguration : basicRemoteFetchConfigurationList) {
RemoteFetchConfigurationListItem remoteFetchConfigurationListItem = populateRemoteFetchConfigurationListResponse(basicRemoteFetchConfiguration);
remoteFetchConfigurations.add(remoteFetchConfigurationListItem);
}
remoteFetchConfigurationListResponse.setRemotefetchConfigurations(remoteFetchConfigurations);
remoteFetchConfigurationListResponse.setCount(remoteFetchConfigurations.size());
} else {
remoteFetchConfigurationListResponse.setCount(0);
}
return remoteFetchConfigurationListResponse;
}
Aggregations