@Service(value="blResourcePurgeService") public class ResourcePurgeServiceImpl extends Object implements ResourcePurgeService
ResourcePurgeService for additional API documentation.
A basic Quartz scheduled job configuration for calling this service can be configured as follows:
<bean id="purgeCartConfig" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="SECONDS_OLD" value="2592000"/>
<entry key="STATUS" value="IN_PROCESS"/>
</map>
</property>
</bean>
<p/>
<bean id="purgeCartJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="blResourcePurgeService" />
<property name="targetMethod" value="purgeCarts" />
<property name="arguments">
<list>
<ref bean="purgeCartConfig"/>
</list>
</property>
</bean>
<p/>
<bean id="purgeCartTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
<property name="jobDetail" ref="purgeCartJobDetail" />
<property name="startDelay" value="30000" />
<property name="repeatInterval" value="86400000" />
</bean>
| Modifier and Type | Field and Description |
|---|---|
protected CustomerService |
customerService |
protected OrderService |
orderService |
protected Integer |
pageSize |
protected ResourcePurgeDao |
resourcePurgeDao |
protected StreamingTransactionCapableUtil |
transUtil |
| Constructor and Description |
|---|
ResourcePurgeServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deleteCart(Order cart)
Remove the cart from the persistence layer.
|
protected void |
deleteCustomer(Customer customer)
Remove the cart from the persistence layer.
|
protected List<Order> |
getCartsToPurge(Map<String,String> config,
int startPos,
int length)
Get the list of carts to delete from the database.
|
protected Long |
getCartsToPurgeLength(Map<String,String> config)
Get the count of carts to delete from the database.
|
protected List<Customer> |
getCustomersToPurge(Map<String,String> config,
int startPos,
int length)
Get the list of carts to delete from the database.
|
protected Long |
getCustomersToPurgeLength(Map<String,String> config)
Get the count of carts to delete from the database.
|
Integer |
getPageSize()
Override the default page size (set by property streaming.transaction.item.page.size) by which entities will be purged.
|
void |
init() |
void |
purgeCarts(Map<String,String> config)
Execute a purge of carts from the persistence layer based on the configuration parameters.
|
void |
purgeCustomers(Map<String,String> config) |
void |
setPageSize(Integer pageSize)
Override the default page size (set by property streaming.transaction.item.page.size) by which entities will be purged.
|
protected StreamingTransactionCapableUtil transUtil
protected ResourcePurgeDao resourcePurgeDao
protected OrderService orderService
protected CustomerService customerService
protected Integer pageSize
@PostConstruct public void init()
public void purgeCarts(Map<String,String> config)
ResourcePurgeServiceorg.broadleafcommerce.core.order.service.OrderService#findCarts(String[],
org.broadleafcommerce.core.order.service.type.OrderStatus[], java.util.Date, Boolean, int, int)
for more info on the default behavior.purgeCarts in interface ResourcePurgeServiceconfig - Map of params used to drive the selection of carts to purgepublic void purgeCustomers(Map<String,String> config)
purgeCustomers in interface ResourcePurgeServicepublic Integer getPageSize()
ResourcePurgeServicegetPageSize in interface ResourcePurgeServicepublic void setPageSize(Integer pageSize)
ResourcePurgeServicesetPageSize in interface ResourcePurgeServicepageSize - the page sizeprotected List<Order> getCartsToPurge(Map<String,String> config, int startPos, int length)
config - params for the queryprotected Long getCartsToPurgeLength(Map<String,String> config)
config - params for the queryprotected void deleteCart(Order cart)
cart - the cart to removeprotected List<Customer> getCustomersToPurge(Map<String,String> config, int startPos, int length)
config - params for the queryprotected Long getCustomersToPurgeLength(Map<String,String> config)
config - params for the queryprotected void deleteCustomer(Customer customer)
customer - the customer to removeCopyright © 2014. All Rights Reserved.