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 int
protected long
protected static final Map<String,
Map<String, FieldMetadata>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
addToCache
(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) void
invalidateFromCache
(String cacheKey) Allows for outside sources to invalidate entries from the Sku Metadata cache that is being used during sku inspects.boolean
useCache()
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:SkuMetadataCacheService
Not generally used but could be useful in some scenarios if you need to invalidate the entire cache- Specified by:
getEntireCache
in interfaceSkuMetadataCacheService
- Returns:
- the cache, keyed by
SkuMetadataCacheService.buildCacheKey(String)
-
useCache
public boolean useCache()Description copied from interface:SkuMetadataCacheService
Whether 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:
useCache
in interfaceSkuMetadataCacheService
-
getFromCache
- Specified by:
getFromCache
in interfaceSkuMetadataCacheService
-
addToCache
- Specified by:
addToCache
in interfaceSkuMetadataCacheService
-
invalidateFromCache
Description copied from interface:SkuMetadataCacheService
Allows for outside sources to invalidate entries from the Sku Metadata cache that is being used during sku inspects.- Specified by:
invalidateFromCache
in interfaceSkuMetadataCacheService
- Parameters:
cacheKey
- fromSkuMetadataCacheService.buildCacheKey(String)
-
buildCacheKey
Description copied from interface:SkuMetadataCacheService
Builds out the cache key to use for the other methods- Specified by:
buildCacheKey
in interfaceSkuMetadataCacheService
- Parameters:
productId
- optional productId, can be null- Returns:
-