Source:
public void runJob() { log.debug("Creating content AIPS for deposit {}", getDepositPID()); Model model = getReadOnlyModel(); log.debug("Ingesting content for deposit containing objects", getDepositPID()); Map<String, String> depositStatus = getDepositStatus(); String destinationPath = depositStatus.get(DepositField.containerId.name()); PID destPid = PIDs.get(destinationPath); if (destPid == null) { failJob("Invalid destination URI", "The provide destination uri " + destinationPath + " was not a valid repository path"); } RepositoryObject destObj = repoObjLoader.getRepositoryObject(destPid); if (!(destObj instanceof ContentContainerObject)) { failJob("Cannot add children to destination", "Cannot deposit to destination " + destPid + ", types does not support children"); } String groups = depositStatus.get(DepositField.permissionGroups.name()); AccessGroupSet groupSet = new AccessGroupSet(groups); aclService.assertHasAccess( "Depositor does not have permissions to ingest to destination " + destPid, destPid, groupSet, Permission.ingest); Bag depositBag = model.getBag(getDepositPID().getRepositoryPath()); calculateWorkRemaining(depositBag); if (!resumed) { getDepositStatusFactory().setIngestInprogress(getDepositUUID(), true); } try { ingestChildren((ContentContainerObject) destObj, depositBag, groupSet); addIngestionEventForContainer((ContentContainerObject) destObj, depositBag.asResource()); } catch (DepositException | FedoraException | IOException e) { failJob(e, "Failed to ingest content for deposit {0}", getDepositPID().getQualifiedId()); } if (!areObjectsInFedora(depositBag)) { failJob("Some objects did not make it to Fedora from this deposit: ", getDepositPID().getQualifiedId()); } }

Target:
public void runJob() { log.debug("Creating content AIPS for deposit {}", getDepositPID()); Model model = getReadOnlyModel(); log.debug("Ingesting content for deposit containing objects", getDepositPID()); Map<String, String> depositStatus = getDepositStatus(); String destinationPath = depositStatus.get(DepositField.containerId.name()); PID destPid = PIDs.get(destinationPath); if (destPid == null) { failJob("Invalid destination URI", "The provide destination uri " + destinationPath + " was not a valid repository path"); } RepositoryObject destObj = repoObjLoader.getRepositoryObject(destPid); if (!(destObj instanceof ContentContainerObject)) { failJob("Cannot add children to destination", "Cannot deposit to destination " + destPid + ", types does not support children"); } String groups = depositStatus.get(DepositField.permissionGroups.name()); AccessGroupSet groupSet = new AccessGroupSet(groups); aclService.assertHasAccess( "Depositor does not have permissions to ingest to destination " + destPid, destPid, groupSet, Permission.ingest); Bag depositBag = model.getBag(getDepositPID().getRepositoryPath()); calculateWorkRemaining(depositBag); if (!resumed) { getDepositStatusFactory().setIngestInprogress(getDepositUUID(), true); } try { ingestChildren((ContentContainerObject) destObj, depositBag, groupSet); addIngestionEventForContainer((ContentContainerObject) destObj, depositBag.asResource()); } catch (DepositException | FedoraException | IOException e) { failJob(e, "Failed to ingest content for deposit {0}", getDepositPID().getQualifiedId()); } Collection<String> pids = new ArrayList<>(); DepositGraphUtils.walkChildrenDepthFirst(depositBag, pids, true); List<PID> objectsNotInFedora = verificationService.listObjectsNotInFedora(pids); if (objectsNotInFedora.size() > 0) { failJob("Some objects from this deposit didn't make it to Fedora:\n", verificationService.listObjectPIDs(getDepositPID().getQualifiedId(), objectsNotInFedora)); } }