Changeset 25571 for main


Ignore:
Timestamp:
2012-05-10T17:32:18+12:00 (12 years ago)
Author:
ak19
Message:

Added a ping SystemAction to mirror GS2's updated ability to ping the server as is needed for activate.pl. (GS2 also allows pinging a collection, but that's not been ported to GS3 yet).

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3
Files:
3 edited

Legend:

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

    r25481 r25571  
    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
     79            system.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_PING);
     80        }
     81        //else if (subaction.equals("is-persistent")){
     82        //  system.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_ISPERSISTENT);
     83        //}
    7684        else
    7785        {
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java

    r25089 r25571  
    974974        Element elem = (Element)commands.item(i);
    975975        String action = elem.getAttribute(GSXML.TYPE_ATT);
    976         if (action.equals(GSXML.SYSTEM_TYPE_CONFIGURE)) {
     976        if (action.equals(GSXML.SYSTEM_TYPE_PING)) {
     977            Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM,  "Ping succeeded.");
     978            response.appendChild(s);
     979        }
     980        //if (action.equals(GSXML.SYSTEM_TYPE_ISPERSISTENT)) {
     981        //  Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM,  "Persistent: true.");
     982        //  response.appendChild(s);
     983        //}
     984        else if (action.equals(GSXML.SYSTEM_TYPE_CONFIGURE)) {
    977985          String subset = elem.getAttribute(GSXML.SYSTEM_SUBSET_ATT);
    978986          if (subset.equals("")) {
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java

    r25450 r25571  
    233233    public static final String SYSTEM_TYPE_ACTIVATE = "activate";
    234234    public static final String SYSTEM_TYPE_DEACTIVATE = "deactivate";
     235    public static final String SYSTEM_TYPE_PING = "ping";
     236    //public static final String SYSTEM_TYPE_ISPERSISTENT = "is-persistent";
    235237
    236238    public static final String SYSTEM_SUBSET_ATT = "subset";
Note: See TracChangeset for help on using the changeset viewer.