Changeset 31912
- Timestamp:
- 2017-08-21T18:03:37+12:00 (6 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/OAICollection.java
r29265 r31912 150 150 // pass the xml node to the service for configuration 151 151 if (this.oai_service_rack.configure(oai_service_xml, extra_info)) { 152 153 // once we've configured the OAIPMH service, we can use the OAIPMH service to 154 // retrieve the earliest timestamp of the collection from the oai-inf db and 155 // overwrite Collection.earliestDatestamp with it. 156 long earliestTimestamp = this.oai_service_rack.getEarliestTimestamp(); 157 if(earliestTimestamp == -1) { 158 //this.earliestDatestamp = -1; 159 logger.warn("No OAI timestamp for collection " + this.cluster_name 160 + ". Falling back to using its earliestDatestamp from build config: " + this.earliestDatestamp); 161 } else { 162 this.earliestDatestamp = earliestTimestamp; // milliseconds 163 } 164 152 165 153 166 // find out the supported service types for this service module -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java
r31229 r31912 239 239 // send to MR 240 240 msg_node = mr.process(message); 241 logger.info("*** " + XMLConverter.getPrettyString(msg_node));241 //logger.info("*** " + XMLConverter.getPrettyString(msg_node)); 242 242 NodeList response_list = ((Element)msg_node).getElementsByTagName(GSXML.RESPONSE_ELEM); 243 243 for (int c=0; c<response_list.getLength(); c++) { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java
r31911 r31912 233 233 } 234 234 235 /** 236 * @return the associated OAICollection's OAI_EARLIEST_TIMESTAMP_OID record's 237 * OAI_INF_TIMESTAMP field from the collection's oai-inf.db IN MILLISECONDS 238 */ 239 public long getEarliestTimestamp() { 240 long timestamp = -1; 241 242 DBInfo oai_info = null; 243 if(oaiinf_db != null) { 244 // get internal record containing the earliest timestamp of the collection 245 oai_info = this.oaiinf_db.getInfo(OAIXML.OAI_EARLIEST_TIMESTAMP_OID); 246 if (oai_info == null) { 247 logger.warn("Can't get collection " + this.cluster_name + "'s earliest timestamp from oai-inf db. No entry for 'OID' " + OAIXML.OAI_EARLIEST_TIMESTAMP_OID + " in the db."); 248 } else { 249 timestamp = Long.parseLong(oai_info.getInfo(OAIXML.OAI_INF_TIMESTAMP)) * 1000; // stored in seconds, so x1000 to convert to milliseconds 250 //logger.info("@@@ found earliest OAI timestamp for collection " + this.coll_name + ": " + timestamp + " (ms)"); 251 } 252 } 253 return timestamp; 254 } 255 235 256 protected Element findNamedMetadataFormat(Element list_meta_formats, String prefix) { 236 257 NodeList formats = list_meta_formats.getElementsByTagName(OAIXML.METADATA_FORMAT); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIResumptionToken.java
r28880 r31912 161 161 if (token.indexOf(":") != -1) { 162 162 token = token.substring(0, token.indexOf(":")); 163 logger. error("looking up "+token);163 logger.info("looking up "+token); 164 164 } 165 165 if (stored_tokens.containsKey(token)) { … … 174 174 if (token.indexOf(":") != -1) { 175 175 base_name = token.substring(0, token.indexOf(":")); 176 logger. error("getting data for "+base_name);176 logger.info("getting data for "+base_name); 177 177 } 178 178 HashMap<String, String> data = new HashMap<String, String>(stored_tokens.get(base_name)); 179 179 if (data == null) { 180 logger. error("data was null!!");180 logger.warn("data was null!!"); 181 181 return null; 182 182 } … … 211 211 Iterator<Map.Entry<String,Long>> i = token_set.iterator(); 212 212 int size = expiration_data.size(); 213 logger. error("start tokens "+size);213 logger.info("start tokens "+size); 214 214 Long time_now = System.currentTimeMillis(); 215 215 while (i.hasNext()==true) { … … 218 218 Long exp = entry.getValue(); 219 219 if (exp < time_now) { 220 logger. error("token "+key+" is expired, "+ OAIXML.getTime(exp));220 logger.info("token "+key+" is expired, "+ OAIXML.getTime(exp)); 221 221 i.remove(); 222 222 // also remove the token from the stored tokens … … 225 225 } 226 226 size = expiration_data.size(); 227 logger. error("end tokens "+size);227 logger.info("end tokens "+size); 228 228 } 229 229 … … 242 242 } 243 243 } catch (Exception e) { 244 logger.error("couldn't find or ResumptionToken.xml "+e.getMessage());244 logger.error("couldn't find or work with ResumptionToken.xml "+e.getMessage()); 245 245 } 246 246 // if we have got here, have't managed to load file via class loader - … … 287 287 clearExpiredTokens(); 288 288 if (resumption_token_file == null) { 289 logger. error("no available resumption token file, not storing tokens");289 logger.warn("no available resumption token file, not storing tokens"); 290 290 return false; 291 291 }
Note:
See TracChangeset
for help on using the changeset viewer.