class PurgeReportService {

    public CloseableIterator<String> exportDistinctObjectGroups(String processId) throws ProcessingStatusException {

        try (BatchReportClient batchReportClient = batchReportClientFactory.getClient()) {

            batchReportClient.generatePurgeDistinctObjectGroupInUnitReport(processId,
                new ReportExportRequest(DISTINCT_REPORT_JSONL));

        } catch (VitamClientInternalException e) {
            throw new ProcessingStatusException(StatusCode.FATAL,
                "Could not generate distinct object group report for deleted units to workspace", e);
        }

        try (WorkspaceClient workspaceClient = workspaceClientFactory.getClient()) {

            Response reportResponse = workspaceClient.getObject(processId, DISTINCT_REPORT_JSONL);
            JsonLineIterator jsonLineIterator = new JsonLineIterator(new VitamAsyncInputStream(reportResponse));

            return CloseableIteratorUtils.map(jsonLineIterator, JsonLineModel::getId);

        } catch (ContentAddressableStorageServerException | ContentAddressableStorageNotFoundException e) {
            throw new ProcessingStatusException(StatusCode.FATAL, "Could not load report from workspace", e);
        }
    }

    public  PurgeReportService();
    @VisibleForTesting  PurgeReportService(
        BatchReportClientFactory batchReportClientFactory,
        WorkspaceClientFactory workspaceClientFactory);

}