private void performParentSearch(LinkedList<DcsEntity> result, String archive_id) { //This mocks the parent search it ignores the parent id and just returns everything that parent isn't null for (Map.Entry<String, Set<DcsEntity>> entry : archiveUtil.getEntities().entrySet()) { for (DcsEntity entity : entry.getValue()) { if (!(entity instanceof DcsDeliverableUnit)) { continue; } DcsDeliverableUnit du = (DcsDeliverableUnit) entity; for (DcsDeliverableUnitRef parentRef : du.getParents()) { if (parentRef.getRef().equalsIgnoreCase(archive_id)) { if (!result.contains(du)) { result.add(du); } } } } } }
private void performParentSearch(LinkedList<DcsEntity> result, String archive_id) { //This mocks the parent search it ignores the parent id and just returns everything that parent isn't null for (Map.Entry<String, Set<DcsEntity>> entry : archiveUtil.getEntities().entrySet()) { for (DcsEntity entity : entry.getValue()) { if (!(entity instanceof DcsDeliverableUnit)) { continue; } DcsDeliverableUnit du = (DcsDeliverableUnit) entity; for (DcsDeliverableUnitRef parentRef : du.getParents()) { if (parentRef.getRef().equalsIgnoreCase(archive_id)) { if (!result.contains(du)) { result.add(du); } } } } } }
@Override public DcsDeliverableUnit determineDepositRoot(Set<DcsDeliverableUnit> candidates) { // Root du does not have another du in this list as a parent for (DcsDeliverableUnit candidate : candidates) { boolean has_local_parent = false; for (DcsDeliverableUnitRef parent : candidate.getParents()) { String parentId = parent.getRef(); for (DcsDeliverableUnit parentCandidate : candidates) { if (parentId.equals(parentCandidate.getId())) { has_local_parent = true; break; } } } if (!has_local_parent) { log.debug("Root deposit DU is: {}", candidate.getId()); return candidate; } } log.debug("Unable to find root deposit DU"); return null; } }
@Override public DcsDeliverableUnit determineDepositRoot(Set<DcsDeliverableUnit> candidates) { // Root du does not have another du in this list as a parent for (DcsDeliverableUnit candidate : candidates) { boolean has_local_parent = false; for (DcsDeliverableUnitRef parent : candidate.getParents()) { String parentId = parent.getRef(); for (DcsDeliverableUnit parentCandidate : candidates) { if (parentId.equals(parentCandidate.getId())) { has_local_parent = true; break; } } } if (!has_local_parent) { log.debug("Root deposit DU is: {}", candidate.getId()); return candidate; } } log.debug("Unable to find root deposit DU"); return null; } }
parent_id = ref.getRef();
if (parentRef.getRef().equals(dataSetDu.getId())) { hasCorrectParent = true; break;