|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bigllc.retsiq.simpleclient.AbstractSearchResponseHandler
public abstract class AbstractSearchResponseHandler
Abstract handler for search responses. This class provides some simple
processing of responses that derived handlers may find useful. Such as
counting records and providing lookup of fields by field name.
Handlers derived from this can override the Child methods. So rather than
trying to override data() they should override dataChild().
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Integer> |
columnNameIndex
|
protected java.util.List<java.lang.String> |
columns
|
protected java.util.List<java.lang.String> |
currentRow
|
protected boolean |
hasMoreRecords
|
protected java.lang.String |
path
|
protected java.lang.String |
query
|
protected int |
recordCount
|
protected int |
recordsInResponse
|
protected java.lang.String |
responseDelimiter
|
protected java.lang.String |
responseDelimiterHex
|
protected java.util.List<java.lang.String> |
select
|
protected RETSUserSession |
session
|
| Constructor Summary | |
|---|---|
AbstractSearchResponseHandler()
|
|
| Method Summary | |
|---|---|
void |
columns(java.util.List<java.lang.String> columns)
If results are returned then this method is called with the column headers returned. |
protected void |
columnsChild(java.util.List<java.lang.String> columns)
Override this method if derived handler wants to receive notification of columns(). |
void |
count(int count)
If a count was returned in the search response. |
protected void |
countChild(int count)
Override this method if derived handler wants to receive notification of count(). |
void |
data(java.util.List<java.lang.String> fields)
If results are returned then the this method is called for each record returned. |
protected abstract void |
dataChild(SearchRecord record)
Override this method if derived handler wants to receive notification of data(). |
void |
delimiter(java.lang.String hex)
If a delimiter is specified in the response then this method is called with the byte delimiter as hexidecimal string. |
protected void |
delimiterChild(java.lang.String hex)
Override this method if derived handler wants to receive notification of noRecordsFound(). |
void |
done()
On completion of processing of the search results or if a parsing error occurs then this called. |
java.util.List<java.lang.String> |
getColumns()
Get the column headers returned with the search. |
boolean |
getHasMoreRecords()
Returns true if the search results were a subset of the complete record set for the query. |
java.lang.String |
getPath()
Get the path requested for the search. |
java.lang.String |
getQuery()
Get the query requested for the search. |
int |
getRecordCount()
Return the number of records that match the query. |
int |
getRecordsInResponse()
Return the number of records processed in this search response. |
java.lang.String |
getResponseDelimiter()
Get the delimiter for the record. |
java.lang.String |
getResponseDelimiterHex()
Get the hex representation of the delimiter for the record. |
java.util.List<java.lang.String> |
getSelect()
Get the columns requested for the search. |
RETSUserSession |
getSession()
Get the user session used for the search. |
void |
hasMoreData()
If the results returned have been limited by either the user or the server and more results are available then this method will be called. |
protected void |
hasMoreDataChild()
Override this method if derived handler wants to receive notification of hasMoreData(). |
void |
noRecordsFound()
Callback when search was successful but specifically no records were found. |
protected void |
noRecordsFoundChild()
Override this method if derived handler wants to receive notification of noRecordsFound(). |
void |
responseCode(int code,
java.lang.String text,
java.lang.String description)
Callback for search RETS response code. |
void |
setContext(RETSUserSession session,
java.lang.String path,
java.lang.String query,
java.util.List<java.lang.String> select)
Set the search context for the results being parsed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RETSUserSession session
protected java.lang.String path
protected java.lang.String query
protected java.util.List<java.lang.String> select
protected java.util.Map<java.lang.String,java.lang.Integer> columnNameIndex
protected java.util.List<java.lang.String> columns
protected java.util.List<java.lang.String> currentRow
protected int recordCount
protected int recordsInResponse
protected boolean hasMoreRecords
protected java.lang.String responseDelimiterHex
protected java.lang.String responseDelimiter
| Constructor Detail |
|---|
public AbstractSearchResponseHandler()
| Method Detail |
|---|
public java.util.List<java.lang.String> getSelect()
SearchResponseHandler
getSelect in interface SearchResponseHandlerSearchResponseHandler.getSelect()public java.lang.String getPath()
SearchResponseHandler
getPath in interface SearchResponseHandlerSearchResponseHandler.getPath()public java.lang.String getQuery()
SearchResponseHandler
getQuery in interface SearchResponseHandlerSearchResponseHandler.getQuery()public RETSUserSession getSession()
SearchResponseHandler
getSession in interface SearchResponseHandlerSearchResponseHandler.getSession()public java.util.List<java.lang.String> getColumns()
public boolean getHasMoreRecords()
public int getRecordCount()
public int getRecordsInResponse()
getRecordsInResponse in interface SearchResponseHandlerpublic java.lang.String getResponseDelimiter()
public java.lang.String getResponseDelimiterHex()
protected void noRecordsFoundChild()
protected void delimiterChild(java.lang.String hex)
protected void countChild(int count)
protected void columnsChild(java.util.List<java.lang.String> columns)
throws RETSClientException
RETSClientException
protected abstract void dataChild(SearchRecord record)
throws RETSClientException
RETSClientExceptionprotected void hasMoreDataChild()
public void responseCode(int code,
java.lang.String text,
java.lang.String description)
SearchResponseHandler
responseCode in interface SearchResponseHandlercode - The RETS response code.text - The text associated with the response code.description - An associated long description of the response code.SearchResponseHandler.responseCode(int, String, String)public final void noRecordsFound()
SearchResponseHandler
noRecordsFound in interface SearchResponseHandlerSearchResponseHandler.noRecordsFound()public final void count(int count)
SearchResponseHandler
count in interface SearchResponseHandlerSearchResponseHandler.count(int)public final void delimiter(java.lang.String hex)
SearchResponseHandler
delimiter in interface SearchResponseHandlerhex - The byte delimiter as a hexidecimal string.SearchResponseHandler.delimiter(String)
public final void columns(java.util.List<java.lang.String> columns)
throws RETSClientException
SearchResponseHandler
columns in interface SearchResponseHandlercolumns - A list of column names.
RETSClientExceptionSearchResponseHandler.columns(List)
public final void data(java.util.List<java.lang.String> fields)
throws RETSClientException
SearchResponseHandler
data in interface SearchResponseHandlerfields - A list of the record fields.
RETSClientExceptionSearchResponseHandler.data(List)public final void hasMoreData()
SearchResponseHandler
hasMoreData in interface SearchResponseHandlerSearchResponseHandler.hasMoreData()public void done()
SearchResponseHandler
done in interface SearchResponseHandlerSearchResponseHandler.done()
public void setContext(RETSUserSession session,
java.lang.String path,
java.lang.String query,
java.util.List<java.lang.String> select)
SearchResponseHandler
setContext in interface SearchResponseHandlersession - The user session.path - The search path.query - The DMQL2 query.select - The columns selected to be returned or null for all.SearchResponseHandler.setContext(RETSUserSession, String, String, List)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||