Revision 53781
Added by Andreas Czerniak over 5 years ago
RestIterator.java | ||
---|---|---|
113 | 113 |
} |
114 | 114 |
|
115 | 115 |
private void initQueue() { |
116 |
// query = baseUrl + "?" + queryParams + querySize + "&" + resumptionParam + "=" + resumptionStr + queryFormat; |
|
117 |
// change at 2018-08-30 and remove resumptionParam&-Type from "query" URL because first request starts mostly at the beginning. |
|
118 | 116 |
query = baseUrl + "?" + queryParams + querySize + queryFormat; |
119 |
|
|
120 | 117 |
} |
121 | 118 |
|
122 | 119 |
private void disconnect() { |
... | ... | |
199 | 196 |
|
200 | 197 |
resumptionInt += resultSizeValue; |
201 | 198 |
|
202 |
/* replaced by switch statement as follow |
|
203 |
if("scan".equals(resumptionType.toLowerCase())) { resumptionStr = xprResumptionPath.evaluate(resultNode);} |
|
204 |
if("count".equals(resumptionType.toLowerCase())){ resumptionStr = Integer.toString(resumptionInt); } |
|
205 |
*/ |
|
206 | 199 |
switch(resumptionType.toLowerCase()) { |
207 | 200 |
case "scan": // read of resumptionToken , evaluate next results, e.g. OAI, iterate over items |
208 | 201 |
resumptionStr = xprResumptionPath.evaluate(resultNode); |
... | ... | |
224 | 217 |
} |
225 | 218 |
} |
226 | 219 |
|
227 |
// |
|
228 | 220 |
if( ( (emptyXml.toLowerCase()).equals(resultXml.toLowerCase()) ) |
229 | 221 |
|| ( (nodeList != null) && (nodeList.getLength() < resultSizeValue) ) |
230 | 222 |
) { |
... | ... | |
239 | 231 |
log.info("discoverResultSize: " + discoverResultSize); |
240 | 232 |
break; |
241 | 233 |
|
242 |
case "pagination": // pagination, iterate over pages
|
|
243 |
case "page": |
|
234 |
case "pagination": |
|
235 |
case "page": // pagination, iterate over pages
|
|
244 | 236 |
pagination += 1; |
245 | 237 |
if (nodeList != null) { |
246 | 238 |
discoverResultSize += nodeList.getLength(); |
... | ... | |
259 | 251 |
|
260 | 252 |
if (resultTotal == -1) { |
261 | 253 |
resultTotal = Integer.parseInt(xprResultTotalPath.evaluate(resultNode)); |
254 |
if(resumptionType.toLowerCase().equals("page")) { resultTotal += 1; } // to correct the upper bound |
|
262 | 255 |
log.info("resultTotal was -1 is now: " + resultTotal); |
263 | 256 |
} |
264 | 257 |
log.info("resultTotal: " + resultTotal); |
Also available in: Unified diff
Issue Enhancement #3858 and code cleanup in RestIterator