fr.cnes.sitools.dataset.database.jdbc
Class SQLRangeDatabaseRequest

java.lang.Object
  extended by fr.cnes.sitools.dataset.database.jdbc.SQLDatabaseRequest
      extended by fr.cnes.sitools.dataset.database.jdbc.SQLRangeDatabaseRequest
All Implemented Interfaces:
DatabaseRequest

public class SQLRangeDatabaseRequest
extends SQLDatabaseRequest

Execute a request for some records specified by a List of ranges

Author:
m.gond

Constructor Summary
SQLRangeDatabaseRequest(DatabaseRequestParameters params)
          Create a new SQLRangeDatabaseRequest with the given DatabaseRequestParameters
 
Method Summary
 int calculateTotalCountFromBase()
          Compute from the database the number of Records in the current request
 void createDistinctRequest()
          Create a SQL Distinct request
 void createRequest()
          Create a Request
 int getCount()
          Get the number of results in the current request for pagination purpose
 int getTotalCount()
          get the number of records in the current request
 boolean nextResult()
          Move the cursor on the next result.
 
Methods inherited from class fr.cnes.sitools.dataset.database.jdbc.SQLDatabaseRequest
buildURI, checkRequest, close, getDistinctRequestAsString, getMaxResultsToSend, getPageSize, getPrimaryKeys, getRecord, getRequestAsString, getSelectedPrimaryKey, getStartIndex, isCountDone, isLastResult, setAttributeValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLRangeDatabaseRequest

public SQLRangeDatabaseRequest(DatabaseRequestParameters params)
Create a new SQLRangeDatabaseRequest with the given DatabaseRequestParameters

Parameters:
params - the DatabaseRequestParameters
Method Detail

createRequest

public final void createRequest()
                         throws SitoolsException
Description copied from interface: DatabaseRequest
Create a Request

Specified by:
createRequest in interface DatabaseRequest
Overrides:
createRequest in class SQLDatabaseRequest
Throws:
SitoolsException - when request fails

createDistinctRequest

public void createDistinctRequest()
                           throws SitoolsException
Description copied from interface: DatabaseRequest
Create a SQL Distinct request

Specified by:
createDistinctRequest in interface DatabaseRequest
Overrides:
createDistinctRequest in class SQLDatabaseRequest
Throws:
SitoolsException - when occurs

nextResult

public final boolean nextResult()
                         throws SitoolsException
Description copied from interface: DatabaseRequest
Move the cursor on the next result.

Specified by:
nextResult in interface DatabaseRequest
Overrides:
nextResult in class SQLDatabaseRequest
Returns:
true if the new current row is valid; false if there are no more rows
Throws:
SitoolsException - if a database access error occurs or this method is called on a closed result set

getTotalCount

public int getTotalCount()
Description copied from interface: DatabaseRequest
get the number of records in the current request

Specified by:
getTotalCount in interface DatabaseRequest
Overrides:
getTotalCount in class SQLDatabaseRequest
Returns:
the number of records in the current request

getCount

public int getCount()
Description copied from interface: DatabaseRequest
Get the number of results in the current request for pagination purpose

Specified by:
getCount in interface DatabaseRequest
Overrides:
getCount in class SQLDatabaseRequest
Returns:
the number of results in the current request for pagination purpose

calculateTotalCountFromBase

public int calculateTotalCountFromBase()
                                throws SitoolsException
Description copied from interface: DatabaseRequest
Compute from the database the number of Records in the current request

Specified by:
calculateTotalCountFromBase in interface DatabaseRequest
Overrides:
calculateTotalCountFromBase in class SQLDatabaseRequest
Returns:
the number of total results or 0 if it cannot perform the request
Throws:
SitoolsException - if a database access error occurs or this method is called on a closed result set


Copyright © 2010-2013 CNES. All Rights Reserved.