Revision 59804
Added by Miriam Baglioni over 3 years ago
OaiIterator.java | ||
---|---|---|
35 | 35 |
private String token; |
36 | 36 |
private boolean started; |
37 | 37 |
private HttpConnector httpConnector; |
38 |
private String prev_token = null; |
|
39 | 38 |
|
40 | 39 |
public OaiIterator(final String baseUrl, final String mdFormat, final String set, final String fromDate, final String untilDate, final HttpConnector httpConnector) { |
41 | 40 |
this.baseUrl = baseUrl; |
... | ... | |
52 | 51 |
this.started = true; |
53 | 52 |
try { |
54 | 53 |
this.token = firstPage(); |
55 |
prev_token = token; |
|
56 | 54 |
} catch (CollectorServiceException e) { |
57 | 55 |
throw new RuntimeException(e); |
58 | 56 |
} |
... | ... | |
75 | 73 |
while (queue.isEmpty() && (token != null) && !token.isEmpty()) { |
76 | 74 |
try { |
77 | 75 |
token = otherPages(token); |
78 |
if(prev_token.equals(token)){ |
|
79 |
throw new RuntimeException("OAI Iterator Exception: got the same resumption token twice"); |
|
80 |
} |
|
81 |
prev_token = token; |
|
82 | 76 |
} catch (CollectorServiceException e) { |
83 | 77 |
throw new RuntimeException(e); |
84 | 78 |
} |
Also available in: Unified diff
removed check for same RT from one call to the other (no specification say that it must be different) Left the check that at least one element named record should be present in the returned list