- Timestamp:
- 2011-04-20T21:02:12+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java
r23913 r23938 296 296 * Use the time value plus the current system time to get the expiration date string. 297 297 */ 298 String expiration_date = OAIXML.getTime(System.currentTimeMillis() + OAIXML.getTokenExpiration()); 298 String expiration_date = OAIXML.getTime(System.currentTimeMillis() + OAIXML.getTokenExpiration()); // in milliseconds 299 299 token.setAttribute(OAIXML.EXPIRATION_DATE, expiration_date); 300 300 } … … 1034 1034 // See OAIConfig.xml 1035 1035 // dynamically works out what the earliestDateStamp is, since it varies by collection 1036 // returns this time in *milliseconds*. 1036 1037 protected long getEarliestDateStamp(NodeList oai_coll) { 1037 1038 //do the earliestDatestamp 1038 long lastmodified= System.currentTimeMillis();1039 long earliestDatestamp = System.currentTimeMillis(); 1039 1040 int oai_coll_size = oai_coll.getLength(); 1040 1041 if (oai_coll_size == 0) { 1041 1042 logger.info("returned oai collection list is empty. Setting repository earliestDatestamp to be 1970-01-01."); 1042 lastmodified= 0;1043 earliestDatestamp = 0; 1043 1044 } 1044 //the collection build time is determined by the last modified time of the buildConfig.xml file 1045 // the earliestDatestamp is now stored as a metadata element in the collection's buildConfig.xml file 1046 // we get the earliestDatestamp among the collections 1045 1047 for(int i=0; i<oai_coll_size; i++) { 1046 long coll_ build_time = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.LASTMODIFIED));1047 lastmodified = (lastmodified > coll_build_time)? coll_build_time : lastmodified;1048 long coll_earliestDatestamp = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.EARLIEST_DATESTAMP)); 1049 earliestDatestamp = (earliestDatestamp > coll_earliestDatestamp)? coll_earliestDatestamp : earliestDatestamp; 1048 1050 } 1049 return lastmodified; 1051 1052 return earliestDatestamp*1000; // converting from seconds to milliseconds 1050 1053 } 1051 1054 }
Note:
See TracChangeset
for help on using the changeset viewer.