Class RemoteSearcher

java.lang.Object
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 Details

    • 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 Details

    • 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:
    • 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