com.elasticpath.service.shoppingcart
Interface ShoppingCartService

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

public interface ShoppingCartService
extends EpPersistenceService

Provide customer-session related business service.


Method Summary
 ShoppingCart add(ShoppingCart shoppingCart)
          Adds the given shopping cart.
 ShoppingCart getCartByCustomerSession(CustomerSession customerSession)
          This method retrieves the shopping cart for the given customer session.
 ShoppingCart load(long shoppingCartUid)
          Load the shopping cart with the given UID.
 void update(ShoppingCart shoppingCart)
          Updates the given shopping cart.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

ShoppingCart add(ShoppingCart shoppingCart)
                 throws EpServiceException
Adds the given shopping cart.

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

getCartByCustomerSession

ShoppingCart getCartByCustomerSession(CustomerSession customerSession)
                                      throws EpServiceException
This method retrieves the shopping cart for the given customer session. Although this is not yet implemented, this method will attempt to find carts corresponding to the customer in the customer session or the session GUID if there is no customer. If multiple carts have been saved for the session or customer, they will be merged and the merged cart will be returned.

Parameters:
customerSession - the customer session for which the shopping cart is requested
Returns:
the shopping cart corresponding to the session or an empty cart if no session was found
Throws:
EpServiceException - - in case of any errors

load

ShoppingCart load(long shoppingCartUid)
                  throws EpServiceException
Load the shopping cart with the given UID. Throw an unrecoverable exception if there is no matching database row.

Parameters:
shoppingCartUid - the shopping cart UID
Returns:
the shopping cart if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

update

void update(ShoppingCart shoppingCart)
            throws EpServiceException
Updates the given shopping cart.

Parameters:
shoppingCart - the shopping cart to update
Throws:
EpServiceException - - in case of any errors