Safe iteration

This commit is contained in:
Fabio Sinibaldi 2020-12-16 15:26:53 +01:00
parent a9aad3724d
commit 977623247c
3 changed files with 14 additions and 7 deletions

View File

@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for org.gcube.data-publishing.gFeed.oai-pmh
## [1.0.5-SNAPSHOT] - 2020-12-15
Do not stop on single repository error
## [1.0.4] - 2020-12-15
- Dependency management
- Naming Convention

View File

@ -9,7 +9,7 @@
</parent>
<artifactId>oai-harvester</artifactId>
<name>oai-harvester</name>
<version>1.0.4</version>
<version>1.0.5-SNAPSHOT</version>
<scm>
<connection>scm:git:${gitBaseUrl}/gFeed</connection>

View File

@ -27,12 +27,16 @@ public class OAICollector implements DataCollector<OAIRecord> {
AccessPoint point=epr.profile().accessPoints().asCollection().iterator().next();
String baseUrl=point.address();
log.debug("Address is "+baseUrl);
OAIClient client = new OAIClient(baseUrl);
point.properties().iterator().forEachRemaining((Property p)->{
if(p.name().equals("set"))
client.getSpecifiedSets().add(p.value());
});
toReturn.addAll(client.getAll(OAIClient.DC_METADATA_PREFIX));
try {
OAIClient client = new OAIClient(baseUrl);
point.properties().iterator().forEachRemaining((Property p)->{
if(p.name().equals("set"))
client.getSpecifiedSets().add(p.value());
});
toReturn.addAll(client.getAll(OAIClient.DC_METADATA_PREFIX));
}catch(Throwable t) {
log.warn("Unable to use repository "+epr.id()+" NAME : "+epr.profile().name(),t);
}
}
return toReturn;