DLESE Tools
v1.6.0

org.dlese.dpc.serviceclients.remotesearch
Class RemoteSearcher

java.lang.Object
  extended by org.dlese.dpc.serviceclients.remotesearch.RemoteSearcher

public class RemoteSearcher
extends Object

RemoteSearcher plays a role anaogous to SimpleLuceneIndex in the DDS, only it performs searches for records using a DDS Web Service (version 1.0). RemoteSearcher employs the WebService client to do the actual search (via the urlCheck method (so this class can be thought of as a wrapper for the urlCheck Service).

A use case of RemoteSearcher follows:

  1. the user submits a query, which at this time is in the form of a URL (including wild cards)
  2. the query is given to searchDocs(java.lang.String), which in turn calls the UrlCheck method of the WebServiceClient, and then
  3. the result Document is parsed into an array of RemoteResultDoc

Author:
ostwald

Constructor Summary
RemoteSearcher(String ddsWebServicesBaseUrl, MetadataVocab vocab)
          Constructor for the RemoteSearcher object
 
Method Summary
 void destroy()
           
 GetRecordResponse getDocument(String id)
          Gets the document attribute of the RemoteSearcher object
 GetRecordResponse getRecord(String id)
          Gets the record attribute of the RemoteSearcher object
 MetadataVocab getVocab()
          Gets the vocab attribute of the RemoteSearcher object
 WebServiceClient getWebServiceClient()
          Gets the webServiceClient attribute of the RemoteSearcher object
static void main(String[] args)
          RemoteSearcher tester
 RemoteResultDoc[] searchDocs(String s)
          analogus to SimpleLuceneIndex.searchDoc, performs a search and returns an array of RemoteResultDoc objects that represent the results of the search.
static void setDebug(boolean db)
          Sets the debug attribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteSearcher

public RemoteSearcher(String ddsWebServicesBaseUrl,
                      MetadataVocab vocab)
Constructor for the RemoteSearcher object

Parameters:
ddsWebServicesBaseUrl - DDS Web Service URL
vocab - MetadataVocab object used to parse search results
Method Detail

getVocab

public MetadataVocab getVocab()
Gets the vocab attribute of the RemoteSearcher object

Returns:
The vocab value

getWebServiceClient

public WebServiceClient getWebServiceClient()
Gets the webServiceClient attribute of the RemoteSearcher object

Returns:
The webServiceClient value
See Also:
WebServiceClient

searchDocs

public RemoteResultDoc[] searchDocs(String s)
analogus to SimpleLuceneIndex.searchDoc, performs a search and returns an array of RemoteResultDoc objects that represent the results of the search.

Note: the urlCheck WebService returns information about duplicate records (that don't match the query, but which refer to the same resource) returned as an alsoCatalogedBy element of MatchingRecord . These duplicates are treated as search results by searchDocs - they are expanded into RemoteResultDoc objects and added to the results returned.

Parameters:
s - Description of the Parameter
Returns:
Description of the Return Value

getRecord

public GetRecordResponse getRecord(String id)
Gets the record attribute of the RemoteSearcher object

Parameters:
id - Description of the Parameter
Returns:
The record value

getDocument

public GetRecordResponse getDocument(String id)
Gets the document attribute of the RemoteSearcher object

Parameters:
id - Description of the Parameter
Returns:
The document value

destroy

public void destroy()

setDebug

public static void setDebug(boolean db)
Sets the debug attribute

Parameters:
db - The new debug value

main

public static void main(String[] args)
RemoteSearcher tester

Parameters:
args - The command line arguments

DLESE Tools
v1.6.0