Ignore:
Timestamp:
2003-08-06T12:02:10+12:00 (21 years ago)
Author:
kjdon
Message:

gadually standardising my Java code. have turned all class variables from like doc_ to this.doc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/ServiceRack.java

    r4903 r5098  
    5959
    6060    /** the absolute address of the site home */
    61     protected String site_home_ =null;
     61    protected String site_home =null;
    6262    /** the http address of the site home */
    63     protected String site_http_address_ =null;
     63    protected String site_http_address =null;
    6464
    6565    /** the name of the cluster (or collection) that this service
    6666    belongs to - if any */
    67     protected String cluster_name_ = null;
     67    protected String cluster_name = null;
    6868
    6969    /** some services can talk back to the message router */
    70     protected ModuleInterface router_ = null;
     70    protected ModuleInterface router = null;
    7171
    7272    /** a converter class to create Documents etc */
    73     protected XMLConverter converter_ = null;
     73    protected XMLConverter converter = null;
    7474
    7575    /** the original config info - if need to store it */
    76     protected Element config_info_ = null;
     76    protected Element config_info = null;
    7777
    7878    /** XML element for describe requests - the container doc */
    79     protected Document doc_ = null;
     79    protected Document doc = null;
    8080
    8181    /** XML element for describe requests - list of supported services
    8282    - this is static     */
    83     protected Element short_service_info_ = null;
     83    protected Element short_service_info = null;
    8484
    8585    /** XML element for stylesheet requests - map of service name to format
    8686    elem */
    87     protected HashMap format_info_map_ = null;
     87    protected HashMap format_info_map = null;
    8888
    8989    /** sets the cluster name */
    9090    public void setClusterName(String cluster_name) {
    91     cluster_name_ = cluster_name;
     91    this.cluster_name = cluster_name;
    9292    }
    9393    /** sets the collect name */
     
    9898    /** sets the site home */
    9999    public void setSiteHome(String site_home) {
    100     site_home_ = site_home;
     100    this.site_home = site_home;
    101101    }
    102102    /** sets the site http address */
    103103    public void setSiteAddress(String site_address) {
    104     site_http_address_ = site_address;
     104    this.site_http_address = site_address;
    105105    }
    106106
    107107    /** sets the message router */
    108108    public void setMessageRouter(ModuleInterface m) {
    109        router_ = m;
     109       this.router = m;
    110110    }
    111111
    112112    /** the no-args constructor */
    113113    public ServiceRack() {
    114     converter_ = new XMLConverter();
    115     doc_ = converter_.newDOM();
    116     short_service_info_ = doc_.createElement(GSXML.SERVICE_ELEM+GSXML.LIST_MODIFIER);
    117     format_info_map_ = new HashMap();
     114    this.converter = new XMLConverter();
     115    this.doc = this.converter.newDOM();
     116    this.short_service_info = this.doc.createElement(GSXML.SERVICE_ELEM+GSXML.LIST_MODIFIER);
     117    this.format_info_map = new HashMap();
    118118    }
    119119   
     
    143143    public String process(String xml_in) {
    144144   
    145     Document doc = converter_.getDOM(xml_in);
     145    Document doc = this.converter.getDOM(xml_in);
    146146   
    147147    Element res = process(doc.getDocumentElement());
    148     return converter_.getString(res);
     148    return this.converter.getString(res);
    149149   
    150150    }
     
    161161    NodeList requests = message.getElementsByTagName(GSXML.REQUEST_ELEM);
    162162    Document mess_doc = message.getOwnerDocument();
    163     Element mainResult = doc_.createElement(GSXML.MESSAGE_ELEM);
     163    Element mainResult = this.doc.createElement(GSXML.MESSAGE_ELEM);
    164164    if (requests.getLength()==0) {
    165165        // no requests
     
    174174        Element response = processDescribe(request);
    175175        if (response !=null) {
    176             mainResult.appendChild(doc_.importNode(response, true));
     176            mainResult.appendChild(this.doc.importNode(response, true));
    177177        }
    178178       
    179179        } else if (type.equals(GSXML.REQUEST_TYPE_FORMAT)) {
    180180        Element response = processFormat(request);
    181             mainResult.appendChild(doc_.importNode(response, true));
     181            mainResult.appendChild(this.doc.importNode(response, true));
    182182       
    183183           
     
    220220            }
    221221            if (response !=null) {
    222             mainResult.appendChild(doc_.importNode(response, true));
     222            mainResult.appendChild(this.doc.importNode(response, true));
    223223            }
    224224           
     
    240240    protected Element processDescribe(Element request) {
    241241   
    242     Element response = doc_.createElement(GSXML.RESPONSE_ELEM);
     242    Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
    243243    response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_DESCRIBE);
    244244   
     
    264264     */
    265265    protected Element processFormat(Element request) {
    266     Element response = doc_.createElement(GSXML.RESPONSE_ELEM);
     266    Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
    267267    response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_FORMAT);
    268268   
     
    275275   
    276276    // describe a particular service   
    277     if (format_info_map_.containsKey(to)) {
     277    if (this.format_info_map.containsKey(to)) {
    278278        response.appendChild(getServiceFormat(to));
    279279        response.setAttribute(GSXML.FROM_ATT, to);
     
    288288    protected Element getServiceList(String lang) {
    289289    // for now, it is static and has no language stuff
    290     return (Element) short_service_info_.cloneNode(true);
     290    return (Element) this.short_service_info.cloneNode(true);
    291291    }
    292292   
     
    295295
    296296    protected Element getServiceFormat(String service) {
    297     Element format = (Element)((Element)format_info_map_.get(service)).cloneNode(true);
     297    Element format = (Element)((Element)this.format_info_map.get(service)).cloneNode(true);
    298298    return format;
    299299    }
Note: See TracChangeset for help on using the changeset viewer.