1
|
package eu.dnetlib.data.collector.plugins.schemaorg;
|
2
|
|
3
|
import org.apache.commons.logging.Log;
|
4
|
import org.apache.commons.logging.LogFactory;
|
5
|
|
6
|
import java.util.Iterator;
|
7
|
import java.util.concurrent.ArrayBlockingQueue;
|
8
|
|
9
|
public class SchemaOrgIterable implements Iterable<String> {
|
10
|
private static final Log log = LogFactory.getLog(SchemaOrgIterable.class);
|
11
|
|
12
|
public static class Options {
|
13
|
private EndpointAccessIterator.Options endpointAccessOptions;
|
14
|
private DatasetMappingIterator.Options datasetMappingOptions;
|
15
|
|
16
|
public EndpointAccessIterator.Options getEndpointAccessOptions() {
|
17
|
return endpointAccessOptions;
|
18
|
}
|
19
|
|
20
|
public void setEndpointAccessOptions(EndpointAccessIterator.Options endpointAccessOptions) {
|
21
|
this.endpointAccessOptions = endpointAccessOptions;
|
22
|
}
|
23
|
|
24
|
public DatasetMappingIterator.Options getDatasetMappingOptions() {
|
25
|
return datasetMappingOptions;
|
26
|
}
|
27
|
|
28
|
public void setDatasetMappingOptions(DatasetMappingIterator.Options datasetMappingOptions) {
|
29
|
this.datasetMappingOptions = datasetMappingOptions;
|
30
|
}
|
31
|
}
|
32
|
|
33
|
private Options options;
|
34
|
private RepositoryIterable repository;
|
35
|
|
36
|
public SchemaOrgIterable(Options options, RepositoryIterable repository){
|
37
|
this.options = options;
|
38
|
this.repository = repository;
|
39
|
}
|
40
|
|
41
|
@Override
|
42
|
public Iterator<String> iterator() {
|
43
|
Iterator<String> repositoryIterator = this.repository.iterator();
|
44
|
EndpointAccessIterator endpointAccessIterator = new EndpointAccessIterator(options.getEndpointAccessOptions(), repositoryIterator);
|
45
|
DatasetMappingIterator datasetMappingIterator = new DatasetMappingIterator(options.getDatasetMappingOptions(), endpointAccessIterator);
|
46
|
|
47
|
return datasetMappingIterator;
|
48
|
}
|
49
|
}
|