private void performFormerSearch(LinkedList<DcsEntity> results, String formerExternalRef) { for (Map.Entry<String, Set<DcsEntity>> entries : archiveUtil.getEntities().entrySet()) { for (DcsEntity entity : entries.getValue()) { if (!(entity instanceof DcsDeliverableUnit)) { continue; } DcsDeliverableUnit du = (DcsDeliverableUnit) entity; if (du.getFormerExternalRefs().contains(formerExternalRef)) { results.add(du); } } } }
private void performFormerSearch(LinkedList<DcsEntity> results, String formerExternalRef) { for (Map.Entry<String, Set<DcsEntity>> entries : archiveUtil.getEntities().entrySet()) { for (DcsEntity entity : entries.getValue()) { if (!(entity instanceof DcsDeliverableUnit)) { continue; } DcsDeliverableUnit du = (DcsDeliverableUnit) entity; if (du.getFormerExternalRefs().contains(formerExternalRef)) { results.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); } } } } } }
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 <T extends DcsEntity> Collection<T> getParentsOf(String entityId, Class<T> constraint) { Collection<DcsEntity> results = new HashSet<DcsEntity>(); for (Set<DcsEntity> entity_set: archiveUtil.getEntities().values()) { for (DcsEntity entity: entity_set) { if (constraint.isInstance(entity)) { if (constraint == DcsDeliverableUnit.class) { DcsDeliverableUnit du = (DcsDeliverableUnit) entity; if (du.getParents().contains(new DcsDeliverableUnitRef(entityId))) { results.add(du); } } } } } Collection<T> constrainedResults = new HashSet<T>(results.size()); for (DcsEntity e : results) { if (e.getClass() == constraint) { constrainedResults.add(constraint.cast(e)); } } return constrainedResults; } }
Set<DcsEntity> descendants = new HashSet<DcsEntity>(); java.util.Collection<DcsEntity> entities = new HashSet<DcsEntity>(); for (Set<DcsEntity> allEntities : archiveUtil.getEntities().values()) { entities.addAll(allEntities);
Set<DcsEntity> descendants = new HashSet<DcsEntity>(); java.util.Collection<DcsEntity> entities = new HashSet<DcsEntity>(); for (Set<DcsEntity> allEntities : archiveUtil.getEntities().values()) { entities.addAll(allEntities);
public DcsFile findFile(String business_id, String type) { for (Set<DcsEntity> entities : archiveUtil.getEntities().values()) { for (DcsEntity entity : entities) { if (!(entity instanceof DcsFile)) { continue; } DcsFile file = (DcsFile) entity; for (DcsResourceIdentifier res : file.getAlternateIds()) { if (res.getIdValue().equals(business_id) && Id.getAuthority().equals(res.getAuthorityId()) && type.equals(res.getTypeId())) { return file; } } } } return null; } }
@Override public DcsFile findDataSetFile(String business_id) { for (Set<DcsEntity> entities : archiveUtil.getEntities().values()) { for (DcsEntity entity : entities) { if (!(entity instanceof DcsFile)) { continue; } DcsFile file = (DcsFile) entity; for (DcsResourceIdentifier res : file.getAlternateIds()) { if (res.getIdValue().equals(business_id) && Id.getAuthority().equals(res.getAuthorityId()) && Types.DATA_SET.name().equals(res.getTypeId())) { return file; } } } } return null; } }
public BusinessObjectState findLatestState(String business_id) { List<DcsDeliverableUnit> dus = new ArrayList<DcsDeliverableUnit>(); for (Set<DcsEntity> entities : archiveUtil.getEntities().values()) { for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) {
List<DcsDeliverableUnit> dus = new ArrayList<DcsDeliverableUnit>(); for (Set<DcsEntity> entities : archiveUtil.getEntities().values()) { for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) {
final String archiveId = e.getValue(); for (Map.Entry<String, Set<DcsEntity>> e2 : archiveUtil.getEntities().entrySet()) { for (final DcsEntity archivedEntity : e2.getValue()) { if (!e2.getKey().equals(archiveId)) {
final String archiveId = e.getValue(); for (Map.Entry<String, Set<DcsEntity>> e2 : archiveUtil.getEntities().entrySet()) { for (final DcsEntity archivedEntity : e2.getValue()) { if (!e2.getKey().equals(archiveId)) {
@Override public BusinessObjectState findLatestState(String business_id) { List<DcsDeliverableUnit> dus = new ArrayList<DcsDeliverableUnit>(); for (Set<DcsEntity> entities : archiveUtil.getEntities().values()) { for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) { dusCopy.addAll(dus); for (Set<DcsEntity> entities : archiveUtil.getEntities().values()) { for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) {