Ignore:
Timestamp:
2012-05-11T22:10:15+12:00 (12 years ago)
Author:
ak19
Message:

SystemAction now supports pinging on a collection with ?a=s&sa=ping&st=collection&sn=colName

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java

    r25571 r25580  
    7474            system.setAttribute(GSXML.SYSTEM_SUBSET_ATT, info);
    7575        }
    76         else if (subaction.equals("ping")){
    77             // No pinging on collections yet in GS3 as is there in GS2
    78             // The ping subaction is at present just for activate.pl
     76        else if (subaction.equals("ping")) { // can ping the server or a collection
     77            String name = (String) params.get(GSParams.SYSTEM_MODULE_NAME);
     78           
     79            if(name != null && !name.equals("")) {
     80                // Pinging a collection (or module) with ?a=s&sa=ping&st=collection&sn=<colName>
     81                // is a collection-level (servicecluster/module level) ping
     82               
     83                String type = (String) params.get(GSParams.SYSTEM_MODULE_TYPE);
     84                if(type == null || type.equals("")) {
     85                    type = "collection"; // if the st=collection was omitted, assume collection
     86                }               
     87                // ping action set to moduleType=Collection and moduleName=colName
     88                system.setAttribute(GSXML.SYSTEM_MODULE_NAME_ATT, name);
     89                system.setAttribute(GSXML.SYSTEM_MODULE_TYPE_ATT, type);
     90                system.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_PING);
     91            } // else SYSTEM_MODULE_NAME given by the "sn" GSParam is null or empty
     92              // meaning server-level ping: ?a=s&sa=ping
     93             
    7994            system.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_PING);
    8095        }
Note: See TracChangeset for help on using the changeset viewer.