use of org.apache.camel.component.salesforce.api.dto.analytics.reports.ReportStatusEnum in project camel by apache.
the class SalesforceReportResultsToListConverter method convertToList.
@Converter
public static List<List<String>> convertToList(final AbstractReportResultsBase reportResults, final Exchange exchange) {
List<List<String>> results = null;
if (reportResults instanceof AsyncReportResults) {
AsyncReportResults asyncReportResults = (AsyncReportResults) reportResults;
final ReportStatusEnum status = asyncReportResults.getAttributes().getStatus();
// only successfully completed async report results have data rows
if (status != ReportStatusEnum.Success) {
throw new IllegalArgumentException("Invalid asynchronous report results status " + status);
}
}
switch(reportResults.getReportMetadata().getReportFormat()) {
case TABULAR:
results = convertTabularResults(reportResults, exchange);
break;
case SUMMARY:
results = convertSummaryResults(reportResults, exchange);
break;
case MATRIX:
results = convertMatrixResults(reportResults, exchange);
break;
default:
}
return results;
}
Aggregations