com.bigllc.retsiq.simpleclient.util
Interface SearchStrategy

All Known Implementing Classes:
AlphaSearchStrategy, DateFieldSearchStrategy, DateTimeFieldSearchStrategy, DivideAndConquerStrategy, IntegerFieldSearchStrategy, NoneSearchStrategy

public interface SearchStrategy

Search strategy interface. This interface is to allow implementations of searches where the target RETS server has a limit on max records pulled in one search. Users can use an implementation of SearchStrategy rather than calling RETSUserSession.search to attempt to pull the complete listing for their query with one API call. Any strategy implementations should handle the search response handler passed so that it appears as one call. For example done should only appear to be invoked once. Any strategy must also discover the number of records and call max records. Some care may need to be taken in case changes have been to the backing database since the initial record count is fetched.

Author:
Marc G. Smith

Method Summary
 java.util.List<java.lang.String> getQueryBatches(RETSUserSession session, java.lang.String path, java.lang.String query)
          Get a list of queries that break up the original query so that all records for the original query can be retrieved/
 void search(RETSUserSession session, java.lang.String path, java.lang.String query, java.util.List<java.lang.String> fields, boolean decoded, SearchResponseHandler out)
          Execute a search using the strategy implemented to return all the records using multiple queries.
 

Method Detail

search

void search(RETSUserSession session,
            java.lang.String path,
            java.lang.String query,
            java.util.List<java.lang.String> fields,
            boolean decoded,
            SearchResponseHandler out)
            throws RETSClientException
Execute a search using the strategy implemented to return all the records using multiple queries.

Parameters:
session - the user session to search with
path - the resource and classification to query in the following format - /<Resource>/<Classification>.
query - the DMQL2 query to execute.
fields - the fields to return, an empty list or null will fetch all the fields.
decoded - if true lookup values are decoded otherwise raw values are returned.
out - the handler to process the response.
Throws:
RETSClientException

getQueryBatches

java.util.List<java.lang.String> getQueryBatches(RETSUserSession session,
                                                 java.lang.String path,
                                                 java.lang.String query)
                                                 throws RETSClientException
Get a list of queries that break up the original query so that all records for the original query can be retrieved/

Parameters:
session - the user session to search with
path - the resource and classification to query in the following format - /<Resource>/<Classification>.
query - the DMQL2 query to execute.
Returns:
a list of DMQL2 criteria that can be used one at a time in consecutive searches to retrieve all records.
Throws:
RETSClientException