- Timestamp:
- 2012-05-11T22:10:15+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
r25571 r25580 570 570 } 571 571 572 // testing whether a collection (or more generally, a module) is active 573 protected boolean pingModule(String name) { 574 // module (including collection) would have been added to module_map 575 // if activated, and removed from map if deactivated. 576 // The this.collection_list Element would contain the collection too, 577 // but the following check seems to be more generally useful 578 return this.module_map.containsKey(name); 579 } 580 572 581 /** creates and configures a new collection 573 582 if this is done for a reconfigure, the collection should be deactivated first. … … 835 844 return false; 836 845 } 837 846 838 847 protected boolean deactivateModule(String type, String name) { 839 848 … … 974 983 Element elem = (Element)commands.item(i); 975 984 String action = elem.getAttribute(GSXML.TYPE_ATT); 976 if (action.equals(GSXML.SYSTEM_TYPE_PING)) { 977 Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM, "Ping succeeded."); 985 986 if (action.equals(GSXML.SYSTEM_TYPE_PING)) { // ?a=s&sa=ping or ?a=s&sa=ping(&st=collection)&sn=colname 987 988 String message = ""; // will be creating the same messages as in GS2's recept/pingaction.cpp 989 String module_name = elem.getAttribute(GSXML.SYSTEM_MODULE_NAME_ATT); 990 String module_type = elem.getAttribute(GSXML.SYSTEM_MODULE_TYPE_ATT); 991 992 if(module_name.equals("")) { // server-level ping 993 message = "Ping succeeded."; 994 } else { // ping at collection level 995 if(pingModule(module_name)) { 996 message = "Ping for " + module_name + " succeeded."; 997 } else { 998 message = "Ping for " + module_name + " did not succeed."; 999 } 1000 } 1001 Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM, message); 978 1002 response.appendChild(s); 979 1003 } 980 // if (action.equals(GSXML.SYSTEM_TYPE_ISPERSISTENT)) {1004 //else if (action.equals(GSXML.SYSTEM_TYPE_ISPERSISTENT)) { 981 1005 // Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM, "Persistent: true."); 982 1006 // response.appendChild(s);
Note:
See TracChangeset
for help on using the changeset viewer.