use of org.apache.camel.component.salesforce.api.dto.analytics.reports.AbstractReportResultsBase in project camel by apache.
the class AnalyticsApiProcessor method processExecuteSyncReport.
private void processExecuteSyncReport(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
String reportId;
final Boolean includeDetails = getParameter(INCLUDE_DETAILS, exchange, IGNORE_BODY, IS_OPTIONAL, Boolean.class);
// try getting report metadata from body first
ReportMetadata reportMetadata = exchange.getIn().getBody(ReportMetadata.class);
if (reportMetadata != null) {
reportId = reportMetadata.getId();
if (reportId == null) {
reportId = getParameter(REPORT_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
}
} else {
reportId = getParameter(REPORT_ID, exchange, USE_BODY, NOT_OPTIONAL);
reportMetadata = getParameter(REPORT_METADATA, exchange, IGNORE_BODY, IS_OPTIONAL, ReportMetadata.class);
}
analyticsClient.executeSyncReport(reportId, includeDetails, reportMetadata, new AnalyticsApiClient.ReportResultsResponseCallback() {
@Override
public void onResponse(AbstractReportResultsBase reportResults, SalesforceException ex) {
processResponse(exchange, reportResults, ex, callback);
}
});
}
Aggregations