|
SDARTS | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.columbia.cs.sdarts.dbselection.DBSelectionServer
this class runs under soap server, export method processInput(String
type, String input), where type can be search: to query the rankings
of available collections on given term
add: to add a sdarts server with optional collection names; or remove: to
remove a collection from given sdarts server
when given a term(s) to query, by default, a CORI ranking score for each collection
that has been indexed is calculated, and returned within a XML string
representation of a SubcolInfo object.
Other ranking algorithm can be specified by giving
algorithm=algorithm-name at the beginning of the term
Currently, only CORI is supported.
when given command add or remove, with appropriate sdarts server url and collection names(s), the collection(s) will be added into (removed from) the in-memory indices
a sample code for calling to the dbselection server might be like this:
Call call = new Call();
call.setTargetObjectURI ("urn:db-selection-server");
call.setMethodName ("processInput");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC );
Vector params = new Vector();
params.addElement (new Parameter("type", type.getClass(), type, null));
params.addElement (new Parameter("input", input.getClass(), input, null));
call.setParams (params);
Response resp = call.invoke(new URL("http://persival.cs.columbia.edu:8181/soap/servlet/rpcrouter"),"" );
if (resp.generatedFault ()) {
Fault fault = resp.getFault ();
System.out.println ("Ouch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode ());
System.out.println (" Fault String = " + fault.getFaultString ());
Vector details = fault.getDetailEntries();
Enumeration detailsEnum = details.elements();
while(detailsEnum.hasMoreElements())
System.out.println(detailsEnum.nextElement().toString());
}
else {
byte[] retval = (byte []) resp.getReturnValue().getValue();
System.out.println(new String(retval));
}
SoapClient| Field Summary | |
java.lang.String |
defaultSdartsServerURL
|
java.util.Vector |
indices
|
| Constructor Summary | |
DBSelectionServer()
default constructor, initialize the index vector, and index collections from the default sdarts server |
|
| Method Summary | |
java.lang.String |
add(java.lang.String sdartsServerURL,
java.lang.String[] collections)
add one or more collections(s) for sdarts server at sdartsServerURL into the indecies in memory |
static void |
main(java.lang.String[] args)
|
byte[] |
processInput(java.lang.String type,
java.lang.String input)
given an command type, an input string input,
returns a string
|
java.lang.String |
search(java.lang.String input)
given a string input, calculate the CORI ranking score for
all available collections by calling
processInput(String). |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public java.util.Vector indices
public java.lang.String defaultSdartsServerURL
| Constructor Detail |
public DBSelectionServer()
| Method Detail |
public static void main(java.lang.String[] args)
throws java.lang.Exception
public java.lang.String search(java.lang.String input)
input, calculate the CORI ranking score for
all available collections by calling
processInput(String).
This method is synchronized so that search and updating index will not conflict each other when accessing the in-memory index.
input - the input terms to search forSubcolInfo object
public java.lang.String add(java.lang.String sdartsServerURL,
java.lang.String[] collections)
sdartsServerURL into the indecies in memorysdartsServerURL - the sdarts server url for the server who hosts
these collectionscollections - the collection names
public byte[] processInput(java.lang.String type,
java.lang.String input)
type, an input string input,
returns a string
the command can be one of the following values:
input is terms to be queried about.
optionally, a leading algorithm=algorithm-name will specify
a different ranking algorithm, than the default CORI.
The result will be a string representation of
SubcolInfo is returned.input is the sdarts server url followed
by one or more space-separated collection names that is to be added. the
return result will be a message indicates whether the adding is successful
or not. input is the sdarts server url followed
by one or more space-separated collection names that is to be removed. the
return result will be a message indicates whether the remvoal is successful
or not. type - the command type, must be one of "search", "add", "remove"input - the parameters for the command
|
SDARTS | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||