use of org.hisp.dhis.webapi.controller.exception.NotFoundException in project dhis2-core by dhis2.
the class TrackerImportController method getJobReport.
@GetMapping(value = "/jobs/{uid}/report", produces = APPLICATION_JSON_VALUE)
public TrackerImportReport getJobReport(@PathVariable String uid, @RequestParam(defaultValue = "errors", required = false) String reportMode, HttpServletResponse response) throws HttpStatusCodeException, NotFoundException {
TrackerBundleReportMode trackerBundleReportMode = TrackerBundleReportMode.getTrackerBundleReportMode(reportMode);
setNoStore(response);
return Optional.ofNullable(notifier.getJobSummaryByJobId(JobType.TRACKER_IMPORT_JOB, uid)).map(report -> trackerImportService.buildImportReport((TrackerImportReport) report, trackerBundleReportMode)).orElseThrow(() -> NotFoundException.notFoundUid(uid));
}
Aggregations