class IngestCleanupEligibilityService {

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

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

            SelectMultiQuery query = new SelectMultiQuery();
            query.addQueries(eq(VitamFieldsHelper.initialOperation(), ingestOperationId));

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

            MultiValuedMap<String, String> updatedObjectGroupsByOpi = new ArrayListValuedHashMap<>();

            scrollRequest.forEachRemaining(objectGroupNode -> {
                try {
                    List<String> ops = JsonHandler
                        .getFromJsonNode(objectGroupNode.get(VitamFieldsHelper.operations()),
                            STRING_LIST_TYPE_REFERENCE);

                    for (String op : ops) {
                        if (!op.equals(ingestOperationId)) {
                            String id = objectGroupNode.get(VitamFieldsHelper.id()).asText();
                            updatedObjectGroupsByOpi.put(op, id);
                        }
                    }
                } catch (InvalidParseOperationException e) {
                    throw new RuntimeException(e);
                }
            });

            if (!updatedObjectGroupsByOpi.isEmpty()) {

                Set<String> ingestOperations = checkIngestOperations(updatedObjectGroupsByOpi.keySet());
                Set<String> nonIngestOperations =
                    SetUtils.difference(updatedObjectGroupsByOpi.keySet(), ingestOperations);

                for (String nonIngestOperation : nonIngestOperations) {
                    for (String objectGroupId : updatedObjectGroupsByOpi.get(nonIngestOperation)) {
                        cleanupReportManager.reportObjectGroupWarning(objectGroupId,
                            "Updates occurred to object group by operation " + nonIngestOperations);
                    }
                }

                for (String nonIngestOperation : ingestOperations) {
                    for (String objectGroupId : updatedObjectGroupsByOpi.get(nonIngestOperation)) {
                        cleanupReportManager.reportObjectGroupError(objectGroupId,
                            "Updates occurred to object group by ingest operation " + nonIngestOperations);
                    }
                }
            }
        } catch (InvalidCreateOperationException | InvalidParseOperationException | LogbookClientException e) {
            throw new ProcessingStatusException(StatusCode.FATAL, "Could not checks updated object groups", e);
        }
    }

    public  IngestCleanupEligibilityService(MetaDataClientFactory metaDataClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory);

}