class BatchReportServiceImpl {

    public void exportUnitsToInvalidate(String processId, int tenantId, ReportExportRequest reportExportRequest)
        throws IOException, ContentAddressableStorageServerException {

        File file =
            Files.createFile(Paths.get(VitamConfiguration.getVitamTmpFolder(), reportExportRequest.getFilename()))
                .toFile();

        try {
            try (
                OutputStream outputStream = new FileOutputStream(file);
                JsonLineWriter jsonLineWriter = new JsonLineWriter(outputStream);
                CloseableIterator<Document> units = unitComputedInheritedRulesInvalidationRepository
                    .findCollectionByProcessIdTenant(processId, tenantId)) {

                while (units.hasNext()) {
                    Document unit = units.next();
                    jsonLineWriter.addEntry(new JsonLineModel((String) unit.get("id")));
                }
            }

            transferDocumentToWorkspace(processId, reportExportRequest.getFilename(), file);

        } finally {
            deleteQuietly(file);
        }
    }

    public  BatchReportServiceImpl(EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository, PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository, WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository);
    @VisibleForTesting  BatchReportServiceImpl(
        EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository,
        PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository);

}