Changeset 25750

Show
Ignore:
Timestamp:
05.06.2012 15:42:12 (7 years ago)
Author:
sjm84
Message:

Some tidying and minor fixes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java

    r25727 r25750  
    2121package org.greenstone.gsdl3.collection; 
    2222 
    23 import org.greenstone.gsdl3.util.*; 
    24 import org.greenstone.gsdl3.core.*; 
    25 import org.greenstone.gsdl3.service.*; 
    26  
    27 // java XML classes we're using 
    28 import org.w3c.dom.Document; 
    29 import org.w3c.dom.Node; 
    30 import org.w3c.dom.Element; 
    31 import org.w3c.dom.NodeList; 
    32  
    33 import java.io.*; 
     23import java.io.File; 
    3424import java.util.HashMap; 
    3525import java.util.Iterator; 
    3626 
    37 import org.apache.log4j.*; 
     27import org.apache.log4j.Logger; 
     28import org.greenstone.gsdl3.core.MessageRouter; 
     29import org.greenstone.gsdl3.core.ModuleInterface; 
     30import org.greenstone.gsdl3.service.ServiceRack; 
     31import org.greenstone.gsdl3.util.GSFile; 
     32import org.greenstone.gsdl3.util.GSPath; 
     33import org.greenstone.gsdl3.util.GSXML; 
     34import org.greenstone.gsdl3.util.UserContext; 
     35import org.greenstone.gsdl3.util.XMLConverter; 
     36import org.w3c.dom.Document; 
     37import org.w3c.dom.Element; 
     38import org.w3c.dom.Node; 
     39import org.w3c.dom.NodeList; 
    3840 
    3941/* ServiceCluster - a groups of services that are related in some way 
    4042 * Implements ModuleInterface. Contains a list of services provided by the cluster, along with metadata about the cluster itself. 
    4143 * a collection is a special type of cluster 
    42  *  @author Katherine Don 
     44 *  @author <a href="mailto:kjdon@cs.waikato.ac.nz">Katherine Don</a> 
    4345 *  @version $Revision$ 
    4446 *  @see ModuleInterface 
     
    357359                // try for a default service in standard package 
    358360                s = (ServiceRack) Class.forName("org.greenstone.gsdl3.service." + servicetype).newInstance(); 
    359  
    360361            } 
    361362            catch (Exception e) 
     
    387388            if (s.configure(n, extra_info)) 
    388389            { 
    389  
    390390                // find out the supported service types for this service module 
    391391                Node types = s.process(message); 
     
    395395                { 
    396396                    String service = ((Element) typenodes.item(j)).getAttribute(GSXML.NAME_ATT); 
     397 
    397398                    if (service_map.get(service) != null) 
    398399                    { 
     
    444445    public Node process(Node message_node) 
    445446    { 
    446  
    447447        Element message = this.converter.nodeToElement(message_node); 
    448448 
     
    499499                Element single_message = mess_doc.createElement(GSXML.MESSAGE_ELEM); 
    500500                single_message.appendChild(request); 
     501 
    501502                Node response_message = this.service_map.get(service).process(single_message); 
    502503                if (response_message != null) 
     
    536537    protected Element processMessage(Element request) 
    537538    { 
    538  
    539539        Element response = this.doc.createElement(GSXML.RESPONSE_ELEM); 
    540540        response.setAttribute(GSXML.FROM_ATT, this.cluster_name); 
     
    547547            // create the collection element 
    548548            Element description = (Element) this.description.cloneNode(false); 
    549             // set collection type : mg or mgpp 
     549            // set collection type : mg, mgpp, lucene or solr 
    550550            description.setAttribute(GSXML.TYPE_ATT, col_type); 
    551551            description.setAttribute(GSXML.DB_TYPE_ATT, db_type);