use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseWsdlInfoEndpointsDTO in project carbon-apimgt by wso2.
the class APIMappingUtil method fromEndpointsMapToWSDLValidationResponseEndpointsDTO.
/**
* Converts the provided WSDL endpoint map to REST API DTO.
*
* @param endpoints endpoint map
* @return converted map to DTO
*/
private static List<WSDLValidationResponseWsdlInfoEndpointsDTO> fromEndpointsMapToWSDLValidationResponseEndpointsDTO(Map<String, String> endpoints) {
List<WSDLValidationResponseWsdlInfoEndpointsDTO> endpointsDTOList = new ArrayList<>();
for (String endpointName : endpoints.keySet()) {
WSDLValidationResponseWsdlInfoEndpointsDTO endpointDTO = new WSDLValidationResponseWsdlInfoEndpointsDTO();
endpointDTO.setName(endpointName);
endpointDTO.setLocation(endpoints.get(endpointName));
endpointsDTOList.add(endpointDTO);
}
return endpointsDTOList;
}
use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseWsdlInfoEndpointsDTO in project carbon-apimgt by wso2.
the class APIMappingUtil method fromWSDLValidationResponseToDTO.
/**
* Converts a WSDL validation response model to DTO.
*
* @param validationResponse validation response model
* @return Converted WSDL validation response model to DTO
*/
public static WSDLValidationResponseDTO fromWSDLValidationResponseToDTO(WSDLValidationResponse validationResponse) {
WSDLValidationResponseDTO wsdlValidationResponseDTO = new WSDLValidationResponseDTO();
WSDLInfo wsdlInfo;
if (validationResponse.isValid()) {
wsdlValidationResponseDTO.setIsValid(true);
wsdlInfo = validationResponse.getWsdlInfo();
WSDLValidationResponseWsdlInfoDTO wsdlInfoDTO = new WSDLValidationResponseWsdlInfoDTO();
wsdlInfoDTO.setVersion(wsdlInfo.getVersion());
List<WSDLValidationResponseWsdlInfoEndpointsDTO> endpointsDTOList = fromEndpointsMapToWSDLValidationResponseEndpointsDTO(wsdlInfo.getEndpoints());
wsdlInfoDTO.setEndpoints(endpointsDTOList);
wsdlValidationResponseDTO.setWsdlInfo(wsdlInfoDTO);
} else {
wsdlValidationResponseDTO.setIsValid(false);
wsdlValidationResponseDTO.setErrors(getErrorListItemsDTOsFromErrorHandler(validationResponse.getError()));
}
return wsdlValidationResponseDTO;
}
Aggregations