com.silverpeas.gallery.dao
Class MediaOrderSQLQueryBuilder

java.lang.Object
  extended by com.silverpeas.gallery.dao.MediaOrderSQLQueryBuilder
All Implemented Interfaces:
MediaOrderCriteriaProcessor

public class MediaOrderSQLQueryBuilder
extends Object
implements MediaOrderCriteriaProcessor

A dynamic builder of a SQL query.


Constructor Summary
MediaOrderSQLQueryBuilder()
           
 
Method Summary
 void endProcessing()
          Informs the processor the process is ended.
 List<Order> orderingResult(List<Order> orders)
          This method must be called after the order list is entirely loaded.
 MediaOrderCriteriaProcessor processComponentInstance(String componentInstanceId)
          Processes the criterion on the component instance identifier.
 MediaOrderCriteriaProcessor processIdentifiers(List<String> identifiers)
          Processes the criterion on the order identifiers.
 MediaOrderCriteriaProcessor processNbDaysAfterThatDeleteAnOrder(Date referenceDate, int nbDaysAfterThatDeleteAnOrder)
          Processes the criterion on the nb of days after that an order should be deleted.
 MediaOrderCriteriaProcessor processOrderer(String ordererId)
          Processes the criterion on the orderer identifier of the orders.
 org.apache.commons.lang3.tuple.Pair<String,List<Object>> result()
          Gets the result of the processing.
 void startProcessing()
          Informs the processor the start of the process.
 MediaOrderCriteriaProcessor then()
          Informs the processor that there is a new criterion to process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaOrderSQLQueryBuilder

public MediaOrderSQLQueryBuilder()
Method Detail

startProcessing

public void startProcessing()
Description copied from interface: MediaOrderCriteriaProcessor
Informs the processor the start of the process. The processor use this method to allocate all the resources required by the processing here. It uses it to initialize the processor state machine.

Specified by:
startProcessing in interface MediaOrderCriteriaProcessor

endProcessing

public void endProcessing()
Description copied from interface: MediaOrderCriteriaProcessor
Informs the processor the process is ended. The processor use this method to deallocate all the resources that were used during the processing. It uses it to tear down the processor state machine or to finalize some treatments.

The processing has to stop once this method is called. Hence, the call of process methods should result to nothing or to an exception.

Specified by:
endProcessing in interface MediaOrderCriteriaProcessor

result

public org.apache.commons.lang3.tuple.Pair<String,List<Object>> result()
Description copied from interface: MediaOrderCriteriaProcessor
Gets the result of the processing. Warning, the result can be incomplete if called before the processing ending (triggered with the call of MediaOrderCriteriaProcessor.endProcessing() method).

Specified by:
result in interface MediaOrderCriteriaProcessor
Returns:
the processing result.

then

public MediaOrderCriteriaProcessor then()
Description copied from interface: MediaOrderCriteriaProcessor
Informs the processor that there is a new criterion to process. This method must be used by the caller to chain the different criterion processings.

Specified by:
then in interface MediaOrderCriteriaProcessor
Returns:
the processor itself.

processComponentInstance

public MediaOrderCriteriaProcessor processComponentInstance(String componentInstanceId)
Description copied from interface: MediaOrderCriteriaProcessor
Processes the criterion on the component instance identifier.

Specified by:
processComponentInstance in interface MediaOrderCriteriaProcessor
Parameters:
componentInstanceId - the identifier of the component instance concerned by the criterion.
Returns:
the processor itself.

processOrderer

public MediaOrderCriteriaProcessor processOrderer(String ordererId)
Description copied from interface: MediaOrderCriteriaProcessor
Processes the criterion on the orderer identifier of the orders.

Specified by:
processOrderer in interface MediaOrderCriteriaProcessor
Parameters:
ordererId - the orderer user concerned by the criterion.
Returns:
the processor itself.

processNbDaysAfterThatDeleteAnOrder

public MediaOrderCriteriaProcessor processNbDaysAfterThatDeleteAnOrder(Date referenceDate,
                                                                       int nbDaysAfterThatDeleteAnOrder)
Description copied from interface: MediaOrderCriteriaProcessor
Processes the criterion on the nb of days after that an order should be deleted.

Specified by:
processNbDaysAfterThatDeleteAnOrder in interface MediaOrderCriteriaProcessor
nbDaysAfterThatDeleteAnOrder - the nb of days after that an order should be deleted.
Returns:
the processor itself.

processIdentifiers

public MediaOrderCriteriaProcessor processIdentifiers(List<String> identifiers)
Description copied from interface: MediaOrderCriteriaProcessor
Processes the criterion on the order identifiers.

Specified by:
processIdentifiers in interface MediaOrderCriteriaProcessor
Parameters:
identifiers - the order identifiers concerned by the criterion.
Returns:
the processor itself.

orderingResult

public List<Order> orderingResult(List<Order> orders)
Description copied from interface: MediaOrderCriteriaProcessor
This method must be called after the order list is entirely loaded. If an ordering was specified and if it was not possible to perform it by SQL clauses, then a logical sort is performed.

Specified by:
orderingResult in interface MediaOrderCriteriaProcessor


Copyright © 2016 Silverpeas. All Rights Reserved.