Ignore:
Timestamp:
2009-09-11T11:54:17+12:00 (15 years ago)
Author:
mdewsnip
Message:

Completely rewrote the resumption token support, as its buginess finally tipped the "I can't stand it any more" scale...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/oaiservr/resumptiontoken.h

    r11769 r20590  
    22#define _RESUMPTIONTOKEN_H_
    33
    4 #include <vector>
    5 
    64#include "text_t.h"
    75
    8 // use the standard namespace
    9 #if !defined (GSDL_NAMESPACE_BROKEN)
    10 #if defined(GSDL_USE_OBJECTSPACE)
    11 using namespace ospace::std;
    12 #else
    13 using namespace std;
    14 #endif
    15 #endif
    166
    177class ResumptionToken
    18 { private:
    19   text_t  collection;
    20   text_t  browseNode;
    21   vector<int> browsePosition;
    22   int     startItem;
    23   text_t  buildDate;
    24   // TODO: add a server name to the variables list; see getToken in resumptionToken.cpp
     8{
     9 private:
     10  text_t build_date;
     11  text_t set;
     12  text_t metadata_prefix;
     13  text_t from;
     14  text_t until;
     15  text_t position;
     16
     17  bool valid;
    2518
    2619 public:
    27   ResumptionToken(const text_t &collection, const text_t &rootNode, const text_t &buildDate);
    28   ResumptionToken(const text_t &URN);
    29   text_t  getToken();
     20  ResumptionToken(const text_t &build_date, const text_t &set, const text_t &metadata_prefix,
     21          const text_t &from, const text_t &until, const text_t &position);
     22  ResumptionToken(const text_t &resumption_token_string);
    3023
    31   void setPosition(const text_t &node, int startItem);
     24  text_t getBuildDate() { return build_date; }
     25  text_t getSet() { return set; }
     26  text_t getMetadataPrefix() { return metadata_prefix; }
     27  text_t getFrom() { return from; }
     28  text_t getUntil() { return until; }
     29  text_t getPosition() { return position; }
    3230
    33   text_t  getCollection() { return collection; }
    34   text_t  getNode() { return browseNode; }
    35   int     getPosition() { return startItem; }
    36   int     getOffsetDepth() { return this->browsePosition.size(); }
    37   void    setOffset(int depth, int position) { this->browsePosition[depth] = position; }
    38   int getOffset(int offset) { return this->browsePosition[offset]; }
     31  text_t getResumptionTokenString();
    3932  bool isValid();
    4033};
    4134
     35
    4236#endif
Note: See TracChangeset for help on using the changeset viewer.