/** * Places the supplied entities in the backing map, keyed by their alternate identifiers. * * @param entities the entities to add in the backing map */ protected void mapAlternateIds(DcsEntity... entities) { for (DcsEntity e : entities) { for (DcsResourceIdentifier altId : e.getAlternateIds()) { Set<DcsEntity> value; if (entityMap.containsKey(altId.getIdValue())) { value = entityMap.get(altId.getIdValue()); } else { value = new HashSet<DcsEntity>(); } value.add(e); entityMap.put(altId.getIdValue(), value); } } }
/** * Places the supplied entities in the backing map, keyed by their alternate identifiers. * * @param entities the entities to add in the backing map */ protected void mapAlternateIds(DcsEntity... entities) { for (DcsEntity e : entities) { for (DcsResourceIdentifier altId : e.getAlternateIds()) { Set<DcsEntity> value; if (entityMap.containsKey(altId.getIdValue())) { value = entityMap.get(altId.getIdValue()); } else { value = new HashSet<DcsEntity>(); } value.add(e); entityMap.put(altId.getIdValue(), value); } } }
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; } }
private static void addResourceIdentifierSet(SolrInputDocument doc, Collection<DcsResourceIdentifier> set) { if( set == null || set.size() == 0){ return; } for( DcsResourceIdentifier id : set){ setadd(doc, ResourceIdentifierField.AUTHORITY, id.getAuthorityId()); setadd(doc, ResourceIdentifierField.TYPE, id.getTypeId()); setadd(doc, ResourceIdentifierField.VALUE, id.getIdValue()); } }
@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; } }
.equals(Types.METADATA_FILE.name())) { metadataFile.setId(id.getIdValue());
if (!isEmptyOrNull(rid.getIdValue())) { writer.startNode(E_IDVALUE); writer.setValue(rid.getIdValue()); writer.endNode();