com.raritantechnologies.searchApp.query
Class QueryResultBeanSet

java.lang.Object
  extended bycom.raritantechnologies.searchApp.query.QueryResultBeanSet

public class QueryResultBeanSet
extends java.lang.Object

Contains a unique set of QueryResultBean objects.

Used for top queries (against ANY search source), saved queries, session-scoped search history, email alert agent.

Includes methods for sorting chronologically, most hits, most attempts (most popular), most/least efficient.


Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
static int SORT_BY_CURRENT_RESULTS
           
static int SORT_BY_DATE
           
static int SORT_BY_NAME
           
static int SORT_BY_QUERIES
           
static int SORT_BY_RESP_TIME
           
static int SORT_BY_RESULTS
           
 
Constructor Summary
QueryResultBeanSet()
           
 
Method Summary
 void addQueryResult(QueryResultBean qrb)
          Add a QueryResultBean to the set.
 void addQueryResult(QueryResultBean qrb, boolean dedupFlag)
          Add a QueryResultBean to the set.
 void deleteQueryResult(java.lang.Integer queryID)
           
 IResultSet getAsResultSet()
           
 java.lang.String getName()
           
static QueryResultBeanSet getNewResults(QueryResultBeanSet fromSet, java.lang.Integer pageSize, java.lang.Integer startRec)
          Refires the queries in Set (using QueryResultBean.reExecuteQuery( ) ) Filter the result sets on those with new or changed results.
static QueryResultBeanSet getNewResults(QueryResultBeanSet fromSet, java.lang.Integer pageSize, java.lang.Integer startRec, SourceLoginInfo[] sources)
           
 QueryResultBean getQuery(java.lang.Integer queryID)
          Returns QueryResultBean keyed by queryID or null if none found with this ID.
 QueryResultBean getQuery(java.lang.String queryName)
          Returns QueryResultBean keyed by name or null if none found with this name.
 java.util.Iterator getQueryResults()
          Returns an iterator of QueryResultBean objects in non-sorted order.
 java.util.Iterator getQueryResults(int sortedBy, boolean ascending)
          Returns an iterator of QueryResultBean objects according to the sort criterion specified by the caller.
 java.util.Iterator getQueryResults(int sortedBy, boolean ascending, SourceLoginInfo[] sources)
           
 void getTimedResultSets(DateTimePeriod[] periods, DateSearchField fromDate, DateSearchField toDate)
          Creates a QueryResultBeanSet for each time period with all of the QueryResultBeans in this set, executed for the period date range.
 void getTimedResultSets(DateTimePeriod[] periods, DateSearchField fromDate, DateSearchField toDate, SourceLoginInfo[] sources)
           
 java.lang.String getXML(boolean includeSources)
           
 void setName(java.lang.String name)
           
 void setQueryResult(QueryResultBean queryBean)
           
 void setRefreshInterval(long milliseconds)
           
 int size()
          returns the number of QueryResultBean object in this QueryResultBeanSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SORT_BY_DATE

public static final int SORT_BY_DATE
See Also:
Constant Field Values

SORT_BY_RESULTS

public static final int SORT_BY_RESULTS
See Also:
Constant Field Values

SORT_BY_CURRENT_RESULTS

public static final int SORT_BY_CURRENT_RESULTS
See Also:
Constant Field Values

SORT_BY_QUERIES

public static final int SORT_BY_QUERIES
See Also:
Constant Field Values

SORT_BY_RESP_TIME

public static final int SORT_BY_RESP_TIME
See Also:
Constant Field Values

SORT_BY_NAME

public static final int SORT_BY_NAME
See Also:
Constant Field Values
Constructor Detail

QueryResultBeanSet

public QueryResultBeanSet()
Method Detail

addQueryResult

public void addQueryResult(QueryResultBean qrb)
Add a QueryResultBean to the set. This method should deduplicate identical queries, but should keep track of statistics like average response time, counts of queries for most/least popular stats etc.


addQueryResult

public void addQueryResult(QueryResultBean qrb,
                           boolean dedupFlag)
Add a QueryResultBean to the set. This method should deduplicate identical queries (if dedupFlag == true), but should keep track of statistics like average response time, counts of queries for most/least popular stats etc.


size

public int size()
returns the number of QueryResultBean object in this QueryResultBeanSet.


getQuery

public QueryResultBean getQuery(java.lang.Integer queryID)
Returns QueryResultBean keyed by queryID or null if none found with this ID.


getQuery

public QueryResultBean getQuery(java.lang.String queryName)
Returns QueryResultBean keyed by name or null if none found with this name.


deleteQueryResult

public void deleteQueryResult(java.lang.Integer queryID)

setQueryResult

public void setQueryResult(QueryResultBean queryBean)

getQueryResults

public java.util.Iterator getQueryResults()
Returns an iterator of QueryResultBean objects in non-sorted order.


getAsResultSet

public IResultSet getAsResultSet()

getQueryResults

public java.util.Iterator getQueryResults(int sortedBy,
                                          boolean ascending)
Returns an iterator of QueryResultBean objects according to the sort criterion specified by the caller.


getQueryResults

public java.util.Iterator getQueryResults(int sortedBy,
                                          boolean ascending,
                                          SourceLoginInfo[] sources)

getNewResults

public static QueryResultBeanSet getNewResults(QueryResultBeanSet fromSet,
                                               java.lang.Integer pageSize,
                                               java.lang.Integer startRec)
Refires the queries in Set (using QueryResultBean.reExecuteQuery( ) ) Filter the result sets on those with new or changed results. returns QueryResultBeanSet containing query/response beans with new results, or if the results were not cached, with all results.


getNewResults

public static QueryResultBeanSet getNewResults(QueryResultBeanSet fromSet,
                                               java.lang.Integer pageSize,
                                               java.lang.Integer startRec,
                                               SourceLoginInfo[] sources)

getTimedResultSets

public void getTimedResultSets(DateTimePeriod[] periods,
                               DateSearchField fromDate,
                               DateSearchField toDate)
Creates a QueryResultBeanSet for each time period with all of the QueryResultBeans in this set, executed for the period date range.


getTimedResultSets

public void getTimedResultSets(DateTimePeriod[] periods,
                               DateSearchField fromDate,
                               DateSearchField toDate,
                               SourceLoginInfo[] sources)

getXML

public java.lang.String getXML(boolean includeSources)

setRefreshInterval

public void setRefreshInterval(long milliseconds)

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()