Skip to content
Snippets Groups Projects
Commit 10d10220 authored by mbrodhu's avatar mbrodhu
Browse files

solve that every resumption token is invalid

parent eb33932a
No related branches found
No related tags found
No related merge requests found
......@@ -42,13 +42,14 @@ public abstract class RecordListDelivererAbstract implements RecordListDeliverer
// Check if resumptionToken is invalid or existing.
if (request.getResumptionToken() != null) {
boolean restokDCExisting = RecordListDelivererIDIOM.cursorCollector != null
boolean restokIDIOMExisting = RecordListDelivererIDIOM.cursorCollector != null
&& RecordListDelivererIDIOM.cursorCollector.containsKey(request.getResumptionToken());
System.out.println(request.getResumptionToken() + " exists: " + RecordListDelivererDC.cursorCollector.containsKey(request.getResumptionToken()));
boolean restokIDIOMExisting = RecordListDelivererDC.cursorCollector != null
boolean restokDCExisting = RecordListDelivererDC.cursorCollector != null
&& RecordListDelivererDC.cursorCollector.containsKey(request.getResumptionToken());
if (!restokDCExisting || !restokIDIOMExisting) {
System.out.println("BUHUH");
if (!restokDCExisting && !restokIDIOMExisting) {
System.out.println("BLA");
result.setError(TGConstants.OAI_BAD_RESUMPTION_TOKEN, "The value of the "
+ request.getResumptionToken() + " argument is invalid or expired.");
}
......
......@@ -347,17 +347,19 @@ public class OaiPmhTest {
System.out.println("Test for the verb \"ListRecords\" with sets with succesfull response");
//String p = this.request.getRequest("ListRecords", "", "oai_dc", "project:TGPR-f89ad029-4eb2-ae5c-6028-5db876513128", "", "", "");
String p = this.request.getRequest("ListRecords", "", "oai_dc", "", "2012-04-23T20:04:18Z", "2012-04-23T20:04:18Z", "");
String p = this.request.getRequest("ListRecords", "", "oai_dc", "", "", "", "");
System.out.println(p);
String resToken = "";
/*for (Map.Entry<String, Integer> entry : RecordListDelivererDC.cursorCollector.entrySet()) {
for (Map.Entry<String, Integer> entry : RecordListDelivererDC.cursorCollector.entrySet()) {
resToken = entry.getKey();
String p2 = this.request.getRequest("ListRecords", "", "", "", "", "", resToken);
System.out.println(p2);
System.out.println("HASH MAP AFTER: ");
System.out.println(RecordListDelivererDC.cursorCollector);
System.out.println("-----------------------------------\n");
}
String p2 = this.request.getRequest("ListRecords", "", "", "", "", "", resToken);
System.out.println(p2);
System.out.println("HASH MAP AFTER: ");
System.out.println(RecordListDelivererDC.cursorCollector);
System.out.println("-----------------------------------\n");*/
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment