public class SessionPersistenceService extends Object implements IShoppingCartPersistenceService
| Modifier and Type | Field and Description |
|---|---|
static String |
SESSION_ATTRIBUTE_HAS_SESSION_ITEMS
Session key of the Boolean attribute that indicates whether the current
user has items saved in session
|
| Constructor and Description |
|---|
SessionPersistenceService() |
| Modifier and Type | Method and Description |
|---|---|
void |
emptyShoppingCartOfUser(String strUserName,
boolean bNotifyProviderService)
Remove every shopping cart items of a given user
|
ShoppingCartItem |
findItemById(int nIdShoppingCartItem)
Get a shopping cart item from its id
|
List<ShoppingCartItem> |
findItemsByFilter(ShoppingCartItemFilter filter)
Find items by filter
|
List<ShoppingCartItem> |
getItemsOfUser(String strUserName)
Get the items of a given user
|
String |
getServiceName()
Get the name of the persistence service
|
void |
removeItemFromUserShoppingCart(String strUserName,
int nIdShoppingCartItem,
boolean bNotifyProviderService)
Remove an item from the shopping cart of a user
|
void |
saveItem(ShoppingCartItem item)
Save a shopping cart item
|
boolean |
supportAnonymousUsers()
Check whether this service support anonymous users
|
public static final String SESSION_ATTRIBUTE_HAS_SESSION_ITEMS
public void saveItem(ShoppingCartItem item)
saveItem in interface IShoppingCartPersistenceServiceitem - The item to savepublic boolean supportAnonymousUsers()
supportAnonymousUsers in interface IShoppingCartPersistenceServicepublic List<ShoppingCartItem> findItemsByFilter(ShoppingCartItemFilter filter)
findItemsByFilter in interface IShoppingCartPersistenceServicefilter - The filter that items must matchpublic List<ShoppingCartItem> getItemsOfUser(String strUserName)
getItemsOfUser in interface IShoppingCartPersistenceServicestrUserName - The name of the user to get the items ofpublic String getServiceName()
getServiceName in interface IShoppingCartPersistenceServicepublic void removeItemFromUserShoppingCart(String strUserName, int nIdShoppingCartItem, boolean bNotifyProviderService)
removeItemFromUserShoppingCart in interface IShoppingCartPersistenceServicestrUserName - The name of the user to remove the item ofnIdShoppingCartItem - The id of the item to removebNotifyProviderService - True to notify the provider service, false
otherwisepublic void emptyShoppingCartOfUser(String strUserName, boolean bNotifyProviderService)
emptyShoppingCartOfUser in interface IShoppingCartPersistenceServicestrUserName - The name of the user to remove items ofbNotifyProviderService - True to notify the provider service, false
otherwisepublic ShoppingCartItem findItemById(int nIdShoppingCartItem)
findItemById in interface IShoppingCartPersistenceServicenIdShoppingCartItem - The id of the shopping cart itemCopyright © 2014 Mairie de Paris. All rights reserved.