com.elasticpath.service.catalog.impl
Class ProductCacheUpdateServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.catalog.impl.ProductCacheUpdateServiceImpl
All Implemented Interfaces:
ProductCacheUpdateService, EpService

public class ProductCacheUpdateServiceImpl
extends AbstractEpServiceImpl
implements ProductCacheUpdateService

This service updates the product cache implemented by the RefreshableCachedProductRetrieveStrategy when changes to the products are made through the Commerce Manager. Note that the cache should be configured to not evict products automatically when using this service.


Constructor Summary
ProductCacheUpdateServiceImpl()
           
 
Method Summary
 void setCacheUpdatePropertiesFile(java.lang.String cacheUpdatePropertiesFile)
          Set the properties file used to track cache update times.
 void setProductService(ProductService productService)
          Sets the product service.
 void setPropertiesDao(PropertiesDao propertiesDao)
          Set the DAO used to load properties.
 void setRefreshableCachedProductRetrieveStrategy(RefreshableCachedProductRetrieveStrategy refreshableCachedProductRetrieveStrategy)
          Set the cached product retrieve strategy that is to be updated.
 void setUtility(Utility utility)
          Set the utility class.
 void updateProductCache()
          Update the product cache.
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Constructor Detail

ProductCacheUpdateServiceImpl

public ProductCacheUpdateServiceImpl()
Method Detail

setCacheUpdatePropertiesFile

public void setCacheUpdatePropertiesFile(java.lang.String cacheUpdatePropertiesFile)
Set the properties file used to track cache update times.

Parameters:
cacheUpdatePropertiesFile - the file name (without the .properties extension)

setProductService

public void setProductService(ProductService productService)
Sets the product service.

Parameters:
productService - the product service

setPropertiesDao

public void setPropertiesDao(PropertiesDao propertiesDao)
Set the DAO used to load properties.

Parameters:
propertiesDao - the DAO used to load properties.

setRefreshableCachedProductRetrieveStrategy

public void setRefreshableCachedProductRetrieveStrategy(RefreshableCachedProductRetrieveStrategy refreshableCachedProductRetrieveStrategy)
Set the cached product retrieve strategy that is to be updated.

Parameters:
refreshableCachedProductRetrieveStrategy - the RefreshableCachedProductRetrieveStrategy

setUtility

public void setUtility(Utility utility)
Set the utility class.

Parameters:
utility - the utility class

updateProductCache

public void updateProductCache()
Update the product cache. This will retrieve all products that have been modified since the last time this method was invoked and then update their cache entries in the RefreshableCachedProductRetrieveStrategy.

Specified by:
updateProductCache in interface ProductCacheUpdateService