com.raritantechnologies.verity.collection
Class QueryProcessorGateway

java.lang.Object
  extended bycom.raritantechnologies.verity.collection.QueryProcessorGateway
All Implemented Interfaces:
ICollectionGateway, java.lang.Runnable

public class QueryProcessorGateway
extends java.lang.Object
implements ICollectionGateway

ICollectionGateway implementation which uses an IQueryProcessor to generate results for indexing or other processing.

Uses a set of IQueryList objects to generate queries for the query processor.

The IResultSets returned from the IQueryProcessor are post-processed using an XMLResultProcessor to map the metadata to the schema required by indexers or other IGatewayOutputProcessors in the data collection / processing pipeline.

XML Configuration Template:
  <CollectionGateway name="QProc_1" 
          class="com.raritantechnologies.verity.collection.QueryProcessorGateway"
          pageSize="[ size of result sets to be processed ]"
          maxDocs="[ maximum number of results to be processed ]" >

    <QueryList>
      <Query> 
        <Field ID="[a search field]" value="[value to search]" />
        <Field ID="[another field]" value="[value to search]" />
      </Query>
      <Query>
        <Field ID="[second query first field]" value="[ some value ]" />
      </Query>
    </QueryList>

    <!-- Alternatively - can derive the query list from another SearchSource -->
    <QuerySource name="[ name of RTI SearchSource ]"
                    outputQueryFields="[ name of field(s) in query source result that have query=value parameters]" >

       <!-- Describes how to create a query to the QuerySource    -->
       <!-- to get the list of queries for the result Data source -->
       <QueryList>
          <Field ID="[ search field in QuerySource ]" value="[ value to search ]" >
          <!-- etc... -->
       </QueryList>
      
    </QuerySource>

    <!-- The Result data sources from which information will be extracted. -->
    <Sources>
      <Source name="[Search Source name]" >

        <!-- Example (Optional) XMLResultProcessor used to transform raw search result --> 
        <XMLResultProcessor>
          <RecordTag>Record</RecordTag>

          <!-- Define callback operations for the ProgrammableSAXFilter -->
          <!-- "shortcut versions -assume standard classes in com.raritantechnologies.xml.sax -->
          <Field ID="VdkVgwKey" callbackType="CData" >
            <ParamName>VdkVgwKey</ParamName> 
              <Comparator class="TagComparator" >
                <TagName>CIK</TagName>
              </Comparator>
          </Field>

          <Field ID="Name" callbackType="Attribute" >
            <ParamName>Name</ParamName> 
            <AttributeName>attrInXML</AttributeName>
            <Comparator class="TagComparator" >
                <TagName>Name</TagName>
            </Comparator>
          </Field>

          <!-- Fully qualified class names versions - use if custom callbacks are used (for example) -->
          <Field ID="CIK" callback="com.raritantechnologies.xml.sax.filter.callbacks.CDataCallbackOperation" >
            <ParamName>CIK</ParamName> 
              <Comparator class="com.raritantechnologies.xml.sax.filter.comparators.TagComparator" >
                <TagName>CIK</TagName>
              </Comparator>
          </Field>

          <Field ID="SIC" callback="com.raritantechnologies.xml.sax.filter.callbacks.AttributeCallbackOperation" >
            <AttributeName>StandardCode</AttributeName>
            <ParamName>SIC</ParamName> 
            <Comparator class="com.raritantechnologies.xml.sax.filter.comparators.TagComparator" >
              <TagName>SIC</TagName>
            </Comparator>
          </Field>

        </XMLResultProcessor>
      </Source>
    </Sources>
  </CollectionGateway>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
QueryProcessorGateway()
           
QueryProcessorGateway(ISearchFieldMap sfMap, java.lang.String ssName, IQueryList queryList)
           
 
Method Summary
 java.lang.String getConfigurationXML()
           
 void initialize(org.w3c.dom.Element gatewayElem, ISearchFieldMap sfMap)
          Initialize the ICollectionGateway from a Configuration XML element.
 boolean isPaused()
           
 void pause()
           
 void resume()
           
 void run()
           
 void run(ILoginInfo userInfo)
          Need to have loginInfo for sources which require login/pw access.
 void setDataAvailable(IResultSet rs, int currentQuery)
           
 void setDataComplete()
           
 void setGatewayListener(IGatewayListener listener)
          Sets the IGatewayListener interface.
 void setInputParameters(OrderedMap inputParams)
          set input parameters...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryProcessorGateway

public QueryProcessorGateway()

QueryProcessorGateway

public QueryProcessorGateway(ISearchFieldMap sfMap,
                             java.lang.String ssName,
                             IQueryList queryList)
Method Detail

setInputParameters

public void setInputParameters(OrderedMap inputParams)
Description copied from interface: ICollectionGateway
set input parameters...

Specified by:
setInputParameters in interface ICollectionGateway

run

public void run()
Specified by:
run in interface ICollectionGateway

run

public void run(ILoginInfo userInfo)
Description copied from interface: ICollectionGateway
Need to have loginInfo for sources which require login/pw access.

Specified by:
run in interface ICollectionGateway

setGatewayListener

public void setGatewayListener(IGatewayListener listener)
Description copied from interface: ICollectionGateway
Sets the IGatewayListener interface.

Specified by:
setGatewayListener in interface ICollectionGateway

setDataAvailable

public void setDataAvailable(IResultSet rs,
                             int currentQuery)

setDataComplete

public void setDataComplete()

pause

public void pause()
Specified by:
pause in interface ICollectionGateway

resume

public void resume()
Specified by:
resume in interface ICollectionGateway

isPaused

public boolean isPaused()
Specified by:
isPaused in interface ICollectionGateway

initialize

public void initialize(org.w3c.dom.Element gatewayElem,
                       ISearchFieldMap sfMap)
Description copied from interface: ICollectionGateway
Initialize the ICollectionGateway from a Configuration XML element.

Specified by:
initialize in interface ICollectionGateway

getConfigurationXML

public java.lang.String getConfigurationXML()
Specified by:
getConfigurationXML in interface ICollectionGateway