- Timestamp:
- 2019-02-28T22:00:57+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java
r29311 r32830 140 140 this.recept = new OAIReceptionist(); 141 141 142 // the receptionist uses a OAIMessageRouter or Communicator to send its requests to. We either create a OAIMessageRouter here for the designated site (if site_name set), or we create a Communicator for a remote site. The is given to t eh Receptionist, and the servlet never talks to it again.directly.142 // the receptionist uses a OAIMessageRouter or Communicator to send its requests to. We either create a OAIMessageRouter here for the designated site (if site_name set), or we create a Communicator for a remote site. The is given to the Receptionist, and the servlet never talks to it again directly. 143 143 if (site_name != null) 144 144 { … … 342 342 343 343 if (query!=null && query.equals("reset")) { 344 logger. error("reset was called*******************");344 logger.info("reset was called*******************"); 345 345 out.println("<?xml version='1.0' encoding='UTF-8' ?>"); 346 346 out.println(this.recept.process("<message><request reset='true'/></message>")); … … 348 348 } 349 349 String[] pairs = (query == null) ? null : query.split("&");//split into key/value pairs 350 351 // besides "reset", the only other non-verb (non-OAI) requests allowed would be: (de)activate="collName" 352 if(pairs.length == 1) { 353 String command = pairs[0]; 354 int index = command.indexOf('='); 355 if(index != -1) { 356 String collName = command.substring(index+1); 357 command = command.substring(0, index); 358 if(command.equals(GSXML.SYSTEM_TYPE_ACTIVATE)) { 359 logger.info("activating OAI collection " + collName + " was called*******************"); 360 out.println("<?xml version='1.0' encoding='UTF-8' ?>"); 361 out.println(this.recept.process("<message><request " + GSXML.SYSTEM_TYPE_ACTIVATE+"='"+collName+"'/></message>")); 362 return; 363 364 } else if(command.equals(GSXML.SYSTEM_TYPE_DEACTIVATE)) { 365 logger.info("deactivating OAI collection " + collName + " was called*******************"); 366 out.println("<?xml version='1.0' encoding='UTF-8' ?>"); 367 out.println(this.recept.process("<message><request " + GSXML.SYSTEM_TYPE_DEACTIVATE+"='"+collName+"'/></message>")); 368 return; 369 } 370 } 371 // any other format for activate/deactivate command in query is wrong, continue processing and fail with "badVerb" message: 372 } 373 350 374 351 375 String verb = getVerb(query);
Note:
See TracChangeset
for help on using the changeset viewer.