fr.cnes.sitools.resources.order
Class AbstractDatasetOrderResource

java.lang.Object
  extended by ExtendedWadlServerResource
      extended by fr.cnes.sitools.common.resource.AbstractSitoolsResource
          extended by fr.cnes.sitools.common.SitoolsResource
              extended by fr.cnes.sitools.common.resource.SitoolsParameterizedResource
                  extended by fr.cnes.sitools.resources.order.AbstractOrderResource
                      extended by fr.cnes.sitools.resources.order.AbstractDatasetOrderResource
All Implemented Interfaces:
IResource, IOrderResource
Direct Known Subclasses:
OrderResource

public abstract class AbstractDatasetOrderResource
extends AbstractOrderResource


Field Summary
 
Fields inherited from class fr.cnes.sitools.common.SitoolsResource
DEFAULT_MEDIATYPE
 
Constructor Summary
AbstractDatasetOrderResource()
           
 
Method Summary
 DatabaseRequest executeRequest(DatabaseRequestParameters params)
          Execute the request
 int getCountOnDataset(DataSet ds, java.lang.String requestQuery, org.restlet.data.Form form)
          Get the number of records in result of a search on the specified dataset with the specified requestQuery or a Form containing the url of a file on the server
 java.lang.String getOrderName()
          Return the name of the order
 void initialiseOrder()
          First step of the order, Initialize it
 ListReferencesAPI listFilesToOrder()
          Abstract method to list all the files to order.
abstract  ListReferencesAPI listFilesToOrder(DatabaseRequest dbRequest)
          Abstract method to list all the files to order.
 DatabaseRequestParameters prepareRequest()
          Prepare the database request.
 
Methods inherited from class fr.cnes.sitools.resources.order.AbstractOrderResource
checkUser, doInit, doInitialiseOrder, doTerminateOrder, executeOrder, getFileName, notifyAdminEnd, orderGet, orderPost, processOrder, terminateOrder
 
Methods inherited from class fr.cnes.sitools.common.resource.SitoolsParameterizedResource
addStandardResponseInfo, getId, getModel, getOverrideParameterValue, getOverrideParameterValueObject, getOverrideParams, getParameterValue, getParent, setId, setModel, setParent, sitoolsDescribe
 
Methods inherited from class fr.cnes.sitools.common.SitoolsResource
addStandardGetRequestInfo, addStandardInternalServerErrorInfo, addStandardNotificationInfo, addStandardObjectResponseInfo, addStandardPostOrPutRequestInfo, addStandardResourceCollectionFilterInfo, addStandardSimpleResponseInfo, configure, getNotificationObject, getRepresentation, getRepresentation, getSettings, getSitoolsApplication, getSitoolsSetting, trace, trace
 
Methods inherited from class fr.cnes.sitools.common.resource.AbstractSitoolsResource
getMediaType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.cnes.sitools.common.model.IResource
getDescription, getName
 

Constructor Detail

AbstractDatasetOrderResource

public AbstractDatasetOrderResource()
Method Detail

initialiseOrder

public void initialiseOrder()
                     throws java.lang.Exception
First step of the order, Initialize it

Overrides:
initialiseOrder in class AbstractOrderResource
Throws:
java.lang.Exception - if there is any error

prepareRequest

public DatabaseRequestParameters prepareRequest()
                                         throws java.lang.Exception
Prepare the database request. This method can be overridden in order to change the database request

Returns:
a DatabaseRequestParameters representing the database request parameters
Throws:
java.lang.Exception - if there is an error while preparing the request

getCountOnDataset

public int getCountOnDataset(DataSet ds,
                             java.lang.String requestQuery,
                             org.restlet.data.Form form)
                      throws java.lang.Exception
Get the number of records in result of a search on the specified dataset with the specified requestQuery or a Form containing the url of a file on the server

Parameters:
ds - the DataSet
requestQuery - the query request
form - the form containing the url of a file on the server
Returns:
the number of records in result of a search, 0 if there is an error
Throws:
java.lang.Exception - if there are some errors

executeRequest

public DatabaseRequest executeRequest(DatabaseRequestParameters params)
                               throws SitoolsException
Execute the request

Parameters:
params - the a DatabaseRequestParameters representing the database request parameters
Returns:
a DatabaseRequest
Throws:
SitoolsException - if there is an error while creating the request

listFilesToOrder

public abstract ListReferencesAPI listFilesToOrder(DatabaseRequest dbRequest)
                                            throws SitoolsException
Abstract method to list all the files to order.

Parameters:
dbRequest - the DatabaseRequest containing the request to the database
Returns:
a ListReferencesAPI containing the list of Reference to order
Throws:
SitoolsException - if there is any error

listFilesToOrder

public ListReferencesAPI listFilesToOrder()
                                   throws SitoolsException
Abstract method to list all the files to order.

Specified by:
listFilesToOrder in class AbstractOrderResource
Returns:
a ListReferencesAPI containing the list of Reference to order
Throws:
SitoolsException - if there is any error

getOrderName

public java.lang.String getOrderName()
Description copied from class: AbstractOrderResource
Return the name of the order

Specified by:
getOrderName in class AbstractOrderResource
Returns:
the name of the order


Copyright © 2010-2013 CNES. All Rights Reserved.