Searches
The RETS IQ RETS Library provides a simple way to execute searches and process the results in an efficient manner. Two methods for streaming result sets are provided:
-
'Pull' SearchResultSets in which the search API call returns an iterable result set.
-
'Push' SearchHandlers in which a callback interface is implemented and search result rows are passed to it via using callback methods.
SearchResultSets
RETSUserSession provides a number of search methods that return a SearchResultSet. These API calls return after the search response header has been received, and result rows can be retrieved using the hasNext(), next(), and nextAsMap() methods on the result set. See the simple examples for an example of SearchResultSet usage.
SearchHandlers
The RET IQ RETS Library provides a some out of the box handlers to get you started. These include the DelimitedSearchResponseHandler and RecordCollectionResponseHandler.
The DelimitedSearchResponseHandler which writes the search response directly to an output stream such as a file in a comma delimited format.
The RecordCollectionResponseHandler can be used to collect all the records in memory and access as a list of Search Records.
Developers can implement their own handlers to process search results, for example by entering them directly into their internal database. For more information on developing your own handlers please refer to the Search Handlers User Guide.