org.LexGrid.LexBIG.caCore.applicationservice.impl
Class PaginationHelper

java.lang.Object
  extended by org.LexGrid.LexBIG.caCore.applicationservice.impl.PaginationHelper

public class PaginationHelper
extends Object

Class to enable pagination over multiple Coding Schemes (databases).

Author:
Kevin Peterson

Field Summary
(package private)  LexEVSApplicationServiceImpl lexEVSApplicationService
           
(package private)  int maxResultsPerQuery
           
 
Constructor Summary
PaginationHelper()
           
 
Method Summary
private  gov.nih.nci.system.dao.Response combineIndividualDAOResponses(List<gov.nih.nci.system.dao.Response> responses)
          Combine the responses from multipe DAOs into one Response.
 LexEVSApplicationServiceImpl getLexEVSApplicationService()
           
 int getMaxResultsPerQuery()
           
 gov.nih.nci.system.dao.Response getResponseFromMultipleCodingSchemeQuery(gov.nih.nci.system.dao.Request request, List<LexEVSDAO> daoList, int maxToReturn)
          Return the results (Correctly paged) from multipe databases.
private  int getResultsCountInIndividualDAOForQuery(Object criteria, LexEVSDAO dao)
          Get the number of results in a given DAO for a given Criteria Query.
private  gov.nih.nci.system.dao.Response queryIndividualDAO(Object criteria, LexEVSDAO dao, int startRow, int maxToReturn)
          Get the results in a given DAO for a given Criteria Query.
 void setLexEVSApplicationService(LexEVSApplicationServiceImpl lexEVSApplicationService)
           
 void setMaxResultsPerQuery(int maxResultsPerQuery)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lexEVSApplicationService

LexEVSApplicationServiceImpl lexEVSApplicationService

maxResultsPerQuery

int maxResultsPerQuery
Constructor Detail

PaginationHelper

public PaginationHelper()
Method Detail

getResponseFromMultipleCodingSchemeQuery

public gov.nih.nci.system.dao.Response getResponseFromMultipleCodingSchemeQuery(gov.nih.nci.system.dao.Request request,
                                                                                List<LexEVSDAO> daoList,
                                                                                int maxToReturn)
                                                                         throws Exception
Return the results (Correctly paged) from multipe databases.

Parameters:
request - The Request being processed
daoList - List of available DAOs
maxToReturn - Maximum results to return per query, i.e. page size
Returns:
Paged results
Throws:
Exception

getResultsCountInIndividualDAOForQuery

private int getResultsCountInIndividualDAOForQuery(Object criteria,
                                                   LexEVSDAO dao)
                                            throws gov.nih.nci.system.applicationservice.ApplicationException
Get the number of results in a given DAO for a given Criteria Query.

Parameters:
criteria - The Criteria to query.
dao - DAO used with this Criteria
Returns:
Number of results in this DAO for the given Criteria
Throws:
gov.nih.nci.system.applicationservice.ApplicationException

queryIndividualDAO

private gov.nih.nci.system.dao.Response queryIndividualDAO(Object criteria,
                                                           LexEVSDAO dao,
                                                           int startRow,
                                                           int maxToReturn)
                                                    throws gov.nih.nci.system.applicationservice.ApplicationException
Get the results in a given DAO for a given Criteria Query.

Parameters:
criteria - The Criteria to query.
dao - DAO used with this Criteria
startRow - The row to start the Query on.
maxToReturn - Page size
Returns:
Paged results
Throws:
gov.nih.nci.system.applicationservice.ApplicationException

combineIndividualDAOResponses

private gov.nih.nci.system.dao.Response combineIndividualDAOResponses(List<gov.nih.nci.system.dao.Response> responses)
Combine the responses from multipe DAOs into one Response.

Parameters:
responses - Individual responses
Returns:
Combined responses

getLexEVSApplicationService

public LexEVSApplicationServiceImpl getLexEVSApplicationService()

setLexEVSApplicationService

public void setLexEVSApplicationService(LexEVSApplicationServiceImpl lexEVSApplicationService)

getMaxResultsPerQuery

public int getMaxResultsPerQuery()

setMaxResultsPerQuery

public void setMaxResultsPerQuery(int maxResultsPerQuery)