com.elasticpath.service.order
Interface OrderService

All Superinterfaces:
EpPersistenceService, EpService
All Known Implementing Classes:
OrderServiceImpl

public interface OrderService
extends EpPersistenceService

Provides storage and access to Order objects.


Method Summary
 Order add(Order order)
          Adds the given order.
 Order addOrderReturn(long orderUid, OrderReturn orderReturn)
          Add the given OrderReturn to the order with given uid.
 java.util.List findAllUids()
          Returns all order uids as a list.
 java.util.List findByCreatedDate(java.util.Date date)
          Retrieves list of Order where the created date is later than the specified date.
 java.util.List findByUids(java.util.Collection orderUids)
          Returns a list of Order based on the given uids.
 java.util.List findOrder(java.lang.String propertyName, java.lang.String criteriaValue, boolean isExactMatch)
          Retrieve the list of orders, whose specified property matches the given criteria value.
 java.util.List findOrderAdvanced(AdvancedOrderSearchCriteria orderSearchCriteria, int maxResults)
          Advanced order search function based on the orderSearchCriteria and the max number of results to return.
 java.util.List findOrderByCriteria(OrderSearchCriteria orderSearchCriteria)
          Retrieve the list of orders, whose specified property contain the given criteria value.
 java.util.List findOrderByCriteria(OrderSearchCriteria orderSearchCriteria, int maxResults)
          Retrieve the list of orders, whose specified property contain the given criteria value.
 java.util.List findOrderByCustomerCriteria(java.lang.String propertyName, java.lang.String criteriaValue, boolean isExactMatch)
          Retrieve the list of orders, whose belonged customer's specified property matches the given criteria value.
 java.util.List findOrderByStatus(int orderStatus, int paymentStatus, int shipmentStatus)
          Retrieve the list of orders with the specified statuses.
 java.util.List findUidsByModifiedDate(java.util.Date date)
          Retrieves list of Order uids where the last modified date is later than the specified date.
 Order get(long orderUid)
          Get the order with the given UID.
 java.lang.String getNextOrderNumber()
          Returns the next order number.
 java.lang.Object getObject(long uid)
          Generic get method for all persistable domain models.
 Order getOrderDetail(long uid)
          Return the fully initialized order object.
 java.util.Map getOrderPaymentStatusMap()
          Returns a map of order payment statuses.
 java.util.Map getOrderReturnReasonMap()
          Returns a map of order return reasons.
 java.util.Map getOrderShipmentStatusMap()
          Returns a map of order shipment statuses.
 java.util.Map getOrderSkuReturnQtyMap(long orderUid)
          Get the orderSku uid -> returned quantity map for the order with given uid.
 java.util.Map getOrderStatusMap()
          Returns a map of order statuses.
 java.util.List list()
          List all orders stored in the database.
 OrderReturn recalculateOrderReturn(long orderUid, OrderReturn orderReturn)
          Recalculate the order return taxes, before-tax total and total.
 Order releaseOrderShipment(long orderUid, long orderShipmentUid, java.lang.String trackingCode, boolean captureFund, boolean sendConfEmail)
          Capture the order balance amount and update the OrderShipment status on success.
 void setOrderPaymentStatusFactory(OrderPaymentStatusFactory orderPaymentStatusFactory)
          Sets the OrderPaymentStatusFactory instance.
 void setOrderReturnReasonFactory(OrderReturnReasonFactory orderReturnReasonFactory)
          Sets the OrderReturnReasonFactory instance.
 void setOrderShipmentStatusFactory(OrderShipmentStatusFactory orderShipmentStatusFactory)
          Sets the OrderShipmentStatusFactory instance.
 OrderSku setOrderSkuProduct(OrderSku orderSku)
          Retrieve the Product associated with the given orderSku based on the productUid saved.
 OrderSku setOrderSkuProductSku(OrderSku orderSku)
          Retrieve the Product associated with the given orderSku based on the productUid saved.
 void setOrderStatusFactory(OrderStatusFactory orderStatusFactory)
          Sets the OrderStatusFactory instance.
 Order update(Order order)
          Updates the given order.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

Order add(Order order)
          throws EpServiceException
Adds the given order.

Parameters:
order - the order to add
Returns:
the persisted instance of order
Throws:
EpServiceException - - in case of any errors

addOrderReturn

Order addOrderReturn(long orderUid,
                     OrderReturn orderReturn)
Add the given OrderReturn to the order with given uid.

Parameters:
orderUid - orderUid the uid of the order.
orderReturn - orderReturn to be added.
Returns:
the updated order.

findAllUids

java.util.List findAllUids()
Returns all order uids as a list.

Returns:
all order uids as a list

findByCreatedDate

java.util.List findByCreatedDate(java.util.Date date)
Retrieves list of Order where the created date is later than the specified date.

Parameters:
date - date to compare with the created date
Returns:
list of Order whose created date is later than the specified date

findByUids

java.util.List findByUids(java.util.Collection orderUids)
Returns a list of Order based on the given uids. The returned orders will be populated based on the given load tuner.

Parameters:
orderUids - a collection of order uids
Returns:
a list of Orders

findOrder

java.util.List findOrder(java.lang.String propertyName,
                         java.lang.String criteriaValue,
                         boolean isExactMatch)
Retrieve the list of orders, whose specified property matches the given criteria value.

Parameters:
propertyName - order property to search on.
criteriaValue - criteria value to be used for searching.
isExactMatch - true for doing an exact match; false for doing a fuzzy match.
Returns:
list of orders matching the given criteria.

findOrderAdvanced

java.util.List findOrderAdvanced(AdvancedOrderSearchCriteria orderSearchCriteria,
                                 int maxResults)
Advanced order search function based on the orderSearchCriteria and the max number of results to return.

Parameters:
orderSearchCriteria - the order search criteria.
maxResults - the max number of orders to return on search.
Returns:
the list of orders matching the given criteria.

findOrderByCriteria

java.util.List findOrderByCriteria(OrderSearchCriteria orderSearchCriteria)
Retrieve the list of orders, whose specified property contain the given criteria value. Set global maxCmSearchResultCount variable in commerce-config.xml to change max number of results returned.

Parameters:
orderSearchCriteria - criteria for order search.
Returns:
list of orders matching the given criteria.

findOrderByCriteria

java.util.List findOrderByCriteria(OrderSearchCriteria orderSearchCriteria,
                                   int maxResults)
Retrieve the list of orders, whose specified property contain the given criteria value. Set maxResults to -1 where use the global maxCmSearchResultCount setting in commerce-config.xml.

Parameters:
orderSearchCriteria - criteria for order search.
maxResults - the max number of orders to return on search.
Returns:
list of orders matching the given criteria.

findOrderByCustomerCriteria

java.util.List findOrderByCustomerCriteria(java.lang.String propertyName,
                                           java.lang.String criteriaValue,
                                           boolean isExactMatch)
Retrieve the list of orders, whose belonged customer's specified property matches the given criteria value.

Parameters:
propertyName - order's belonged customer property to search on.
criteriaValue - criteria value to be used for searching.
isExactMatch - true for doing an exact match; false for doing a fuzzy match.
Returns:
list of orders matching the given criteria.

findOrderByStatus

java.util.List findOrderByStatus(int orderStatus,
                                 int paymentStatus,
                                 int shipmentStatus)
Retrieve the list of orders with the specified statuses.

Parameters:
orderStatus - the status of the order
paymentStatus - the status of the paymentreturnSummaryNode
shipmentStatus - the status of the shipment
Returns:
the list of orders with the specified statuses

findUidsByModifiedDate

java.util.List findUidsByModifiedDate(java.util.Date date)
Retrieves list of Order uids where the last modified date is later than the specified date.

Parameters:
date - date to compare with the last modified date
Returns:
list of Order whose last modified date is later than the specified date

get

Order get(long orderUid)
          throws EpServiceException
Get the order with the given UID. Return null if no matching record exists.

Parameters:
orderUid - the order UID
Returns:
the order if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getNextOrderNumber

java.lang.String getNextOrderNumber()
Returns the next order number.

Returns:
the order number as a String

getObject

java.lang.Object getObject(long uid)
                           throws EpServiceException
Generic get method for all persistable domain models.

Specified by:
getObject in interface EpPersistenceService
Parameters:
uid - the persisted instance uid
Returns:
the persisted instance if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getOrderDetail

Order getOrderDetail(long uid)
                     throws EpServiceException
Return the fully initialized order object.

Parameters:
uid - the persisted instance uid
Returns:
the persisted instance if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getOrderPaymentStatusMap

java.util.Map getOrderPaymentStatusMap()
Returns a map of order payment statuses.

Returns:
a map of order payment statuses

getOrderReturnReasonMap

java.util.Map getOrderReturnReasonMap()
Returns a map of order return reasons.

Returns:
a map of order return reasons.

getOrderShipmentStatusMap

java.util.Map getOrderShipmentStatusMap()
Returns a map of order shipment statuses.

Returns:
a map of order shipment statuses

getOrderSkuReturnQtyMap

java.util.Map getOrderSkuReturnQtyMap(long orderUid)
Get the orderSku uid -> returned quantity map for the order with given uid.

Parameters:
orderUid - the uid of the order.
Returns:
the orderSku uid -> returned quantity map.

getOrderStatusMap

java.util.Map getOrderStatusMap()
Returns a map of order statuses.

Returns:
a map of order statuses

list

java.util.List list()
                    throws EpServiceException
List all orders stored in the database.

Returns:
a list of orders
Throws:
EpServiceException - - in case of any errors

recalculateOrderReturn

OrderReturn recalculateOrderReturn(long orderUid,
                                   OrderReturn orderReturn)
Recalculate the order return taxes, before-tax total and total.

Parameters:
orderUid - the uid of the order.
orderReturn - the orderReturn to be recalculated.
Returns:
the updated orderReturn instance.

releaseOrderShipment

Order releaseOrderShipment(long orderUid,
                           long orderShipmentUid,
                           java.lang.String trackingCode,
                           boolean captureFund,
                           boolean sendConfEmail)
Capture the order balance amount and update the OrderShipment status on success.

Parameters:
orderUid - the uid of the order.
orderShipmentUid - the uid of the orderShipment to be released.
trackingCode - the trakcingCode for the orderShipment to be released.
captureFund - need to capture fund for this release or not
sendConfEmail - need to send customer a shipment confirmation email or not
Returns:
the updated order.

setOrderPaymentStatusFactory

void setOrderPaymentStatusFactory(OrderPaymentStatusFactory orderPaymentStatusFactory)
Sets the OrderPaymentStatusFactory instance.

Parameters:
orderPaymentStatusFactory - the OrderPaymentStatusFactory instance.

setOrderReturnReasonFactory

void setOrderReturnReasonFactory(OrderReturnReasonFactory orderReturnReasonFactory)
Sets the OrderReturnReasonFactory instance.

Parameters:
orderReturnReasonFactory - the OrderReturnReasonFactory instance.

setOrderShipmentStatusFactory

void setOrderShipmentStatusFactory(OrderShipmentStatusFactory orderShipmentStatusFactory)
Sets the OrderShipmentStatusFactory instance.

Parameters:
orderShipmentStatusFactory - the OrderShipmentStatusFactory instance.

setOrderSkuProduct

OrderSku setOrderSkuProduct(OrderSku orderSku)
Retrieve the Product associated with the given orderSku based on the productUid saved.

Parameters:
orderSku - the orderSku instatnce
Returns:
the orderSku instance with the product set inside if found.

setOrderSkuProductSku

OrderSku setOrderSkuProductSku(OrderSku orderSku)
Retrieve the Product associated with the given orderSku based on the productUid saved.

Parameters:
orderSku - the orderSku instatnce
Returns:
the orderSku instance with the product set inside if found.

setOrderStatusFactory

void setOrderStatusFactory(OrderStatusFactory orderStatusFactory)
Sets the OrderStatusFactory instance.

Parameters:
orderStatusFactory - the OrderStatusFactory instance.

update

Order update(Order order)
             throws EpServiceException
Updates the given order.

Parameters:
order - the order to update
Returns:
the persisted instance of order
Throws:
EpServiceException - - in case of any errors