Class PerkStoreService
java.lang.Object
org.exoplatform.perkstore.service.PerkStoreService
- All Implemented Interfaces:
ExoPerkStoreStatisticService, org.picocontainer.Startable
public class PerkStoreService
extends Object
implements ExoPerkStoreStatisticService, org.picocontainer.Startable
A service to manage perkstore entities
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe cache of the global settings each node loaded. -
Constructor Summary
ConstructorsConstructorDescriptionPerkStoreService(PerkStoreWebSocketService webSocketService, PerkStoreStorage perkStoreStorage, org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.container.PortalContainer container, org.exoplatform.services.cache.CacheService cacheService) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckCanCreateOrder(ProductOrder order, String username) countOrders(OrderFilter filter, String username) countUserOrders(OrderFilter filter, String username) createOrder(ProductOrder order, String username) voiddeleteProduct(long productId, String username) getFileDetail(long productId, long imageId, boolean retrieveData, String username) getGlobalSettings(String username) getOrderById(long orderId) getOrders(OrderFilter filter, String username) getProductById(long productId) getProductById(long productId, String username) getProducts(boolean available, String username) getStatisticParameters(String operation, Object result, Object... methodArgs) Retrieve statistic log parametersbooleanisPerkStoreManager(String username) voidreplaceTransactions(String oldHash, String newHash) voidsaveGlobalSettings(GlobalSettings settings, String username) saveOrder(ProductOrder order, ProductOrderModificationType modificationType, String username, boolean checkUsername) voidsaveOrderTransactionStatus(Map<String, Object> transactionDetails) saveProduct(Product product, String username) voidstart()voidstop()
-
Field Details
-
GLOBAL_SETTINGS_CACHE_NAME
The cache of the global settings each node loaded.- See Also:
-
-
Constructor Details
-
PerkStoreService
public PerkStoreService(PerkStoreWebSocketService webSocketService, PerkStoreStorage perkStoreStorage, org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.container.PortalContainer container, org.exoplatform.services.cache.CacheService cacheService)
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
saveGlobalSettings
- Throws:
Exception
-
getGlobalSettings
-
getGlobalSettings
- Throws:
Exception
-
saveProduct
-
deleteProduct
-
getProducts
-
getOrders
- Throws:
Exception
-
countOrders
- Throws:
Exception
-
countUserOrders
-
checkCanCreateOrder
- Throws:
PerkStoreException
-
createOrder
- Throws:
Exception
-
saveOrder
public ProductOrder saveOrder(ProductOrder order, ProductOrderModificationType modificationType, String username, boolean checkUsername) throws Exception - Throws:
Exception
-
saveOrderTransactionStatus
-
getOrderById
-
getProductById
-
getProductById
-
getFileDetail
public FileDetail getFileDetail(long productId, long imageId, boolean retrieveData, String username) throws Exception - Throws:
Exception
-
isPerkStoreManager
-
replaceTransactions
-
getStatisticParameters
public Map<String,Object> getStatisticParameters(String operation, Object result, Object... methodArgs) Description copied from interface:ExoPerkStoreStatisticServiceRetrieve statistic log parameters- Specified by:
getStatisticParametersin interfaceExoPerkStoreStatisticService- Parameters:
operation-result-methodArgs-- Returns:
- a
Mapof parameters to include in statistic log
-