Class SkuMetadataCacheServiceImpl
java.lang.Object
org.broadleafcommerce.admin.server.service.SkuMetadataCacheServiceImpl
- All Implemented Interfaces:
SkuMetadataCacheService
@Service("blSkuMetadataCacheService")
public class SkuMetadataCacheServiceImpl
extends Object
implements SkuMetadataCacheService
- Author:
- Jerry Ocanas (jocanas)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected longprotected static final Map<String,Map<String, FieldMetadata>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddToCache(String cacheKey, Map<String, FieldMetadata> metadata) buildCacheKey(String productId) Builds out the cache key to use for the other methodsNot generally used but could be useful in some scenarios if you need to invalidate the entire cachegetFromCache(String cacheKey) voidinvalidateFromCache(String cacheKey) Allows for outside sources to invalidate entries from the Sku Metadata cache that is being used during sku inspects.booleanuseCache()Whether or not to use the cache.
-
Field Details
-
METADATA_CACHE
-
cacheEntityMetaDataTtl
@Value("${cache.entity.dao.metadata.ttl}") protected int cacheEntityMetaDataTtl -
lastCacheFlushTime
protected long lastCacheFlushTime
-
-
Constructor Details
-
SkuMetadataCacheServiceImpl
public SkuMetadataCacheServiceImpl()
-
-
Method Details
-
getEntireCache
Description copied from interface:SkuMetadataCacheServiceNot generally used but could be useful in some scenarios if you need to invalidate the entire cache- Specified by:
getEntireCachein interfaceSkuMetadataCacheService- Returns:
- the cache, keyed by
SkuMetadataCacheService.buildCacheKey(String)
-
useCache
public boolean useCache()Description copied from interface:SkuMetadataCacheServiceWhether or not to use the cache. If they cache is configured to be used but is past the metadata TTL, the cache is cleared out from this method- Specified by:
useCachein interfaceSkuMetadataCacheService
-
getFromCache
- Specified by:
getFromCachein interfaceSkuMetadataCacheService
-
addToCache
- Specified by:
addToCachein interfaceSkuMetadataCacheService
-
invalidateFromCache
Description copied from interface:SkuMetadataCacheServiceAllows for outside sources to invalidate entries from the Sku Metadata cache that is being used during sku inspects.- Specified by:
invalidateFromCachein interfaceSkuMetadataCacheService- Parameters:
cacheKey- fromSkuMetadataCacheService.buildCacheKey(String)
-
buildCacheKey
Description copied from interface:SkuMetadataCacheServiceBuilds out the cache key to use for the other methods- Specified by:
buildCacheKeyin interfaceSkuMetadataCacheService- Parameters:
productId- optional productId, can be null- Returns:
-