fr.cnes.sitools.dataset.database.mongodb
Class MongoDBDistinctDatabaseRequest

java.lang.Object
  extended by fr.cnes.sitools.dataset.database.mongodb.MongoDBDatabaseRequest
      extended by fr.cnes.sitools.dataset.database.mongodb.MongoDBDistinctDatabaseRequest
All Implemented Interfaces:
DatabaseRequest

public class MongoDBDistinctDatabaseRequest
extends MongoDBDatabaseRequest

Create a request NOSQL

Author:
m.gond (Akka Technologies

Constructor Summary
MongoDBDistinctDatabaseRequest(DatabaseRequestParameters params)
          Create a SQLDatabaseRequest
 
Method Summary
 void close()
          Close the current request
 void createDistinctRequest()
          Create a SQL Distinct request
 int getCount()
          Get the number of results in the current request for pagination purpose
 Record getRecord()
          Return the current ResultSet in a Record object
 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.mongodb.MongoDBDatabaseRequest
buildURI, calculateTotalCountFromBase, checkRequest, createMongoDBRequestModel, createRequest, getDistinctRequestAsString, getKeysAsString, getMaxResultsToSend, getPageSize, getPrimaryKeys, getRequestAsString, getSelectedPrimaryKey, getStartIndex, isCountDone, isLastResult, setAttributeValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MongoDBDistinctDatabaseRequest

public MongoDBDistinctDatabaseRequest(DatabaseRequestParameters params)
Create a SQLDatabaseRequest

Parameters:
params - the request parameters
Method Detail

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 MongoDBDatabaseRequest
Throws:
SitoolsException - when occurs

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 MongoDBDatabaseRequest
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 MongoDBDatabaseRequest
Returns:
the number of results in the current request for pagination purpose

nextResult

public 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 MongoDBDatabaseRequest
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

getRecord

public Record getRecord()
                 throws SitoolsException
Description copied from interface: DatabaseRequest
Return the current ResultSet in a Record object

Specified by:
getRecord in interface DatabaseRequest
Overrides:
getRecord in class MongoDBDatabaseRequest
Returns:
the Record of the current ResultSet
Throws:
SitoolsException - if a database access error occurs or this method is called on a closed result set

close

public void close()
           throws SitoolsException
Close the current request

Specified by:
close in interface DatabaseRequest
Overrides:
close in class MongoDBDatabaseRequest
Throws:
SitoolsException - if there is an error while closing the JDBC request


Copyright © 2010-2013 CNES. All Rights Reserved.