class IngestCleanupEligibilityService {

    public void checkObjectAttachmentsToExistingObjectGroups(String ingestOperationId,
        CleanupReportManager cleanupReportManager)
        throws ProcessingStatusException {

        try (MetaDataClient client = metaDataClientFactory.getClient()) {

            SelectMultiQuery query = new SelectMultiQuery();
            query.addUsedProjection(VitamFieldsHelper.id());
            query.addQueries(and().add(
                ne(VitamFieldsHelper.initialOperation(), ingestOperationId),
                eq(VitamFieldsHelper.operations(), ingestOperationId)
            ));

            ScrollSpliterator<JsonNode> scrollRequest = ScrollSpliteratorHelper
                .createObjectGroupScrollSplitIterator(client, query, VitamConfiguration.getBatchSize());

            scrollRequest.forEachRemaining(objectGroup -> {

                String objectGroupId = objectGroup.get("#id").asText();
                cleanupReportManager.reportObjectGroupError(objectGroupId,
                    "Existing object group updated by ingest operation " + ingestOperationId);
            });

        } catch (InvalidParseOperationException | InvalidCreateOperationException e) {
            throw new ProcessingStatusException(StatusCode.FATAL, "Could not list attachment to existing object groups",
                e);
        }
    }

    public  IngestCleanupEligibilityService(MetaDataClientFactory metaDataClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory);

}