@Service(value="blSkuMetadataCacheService") public class SkuMetadataCacheServiceImpl extends Object implements SkuMetadataCacheService
Modifier and Type | Field and Description |
---|---|
protected int |
cacheEntityMetaDataTtl |
protected long |
lastCacheFlushTime |
protected static Map<String,Map<String,FieldMetadata>> |
METADATA_CACHE |
Constructor and Description |
---|
SkuMetadataCacheServiceImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
addToCache(String cacheKey,
Map<String,FieldMetadata> metadata) |
String |
buildCacheKey(String productId)
Builds out the cache key to use for the other methods
|
Map<String,Map<String,FieldMetadata>> |
getEntireCache()
Not generally used but could be useful in some scenarios if you need to invalidate the entire cache
|
Map<String,FieldMetadata> |
getFromCache(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.
|
@Value(value="${cache.entity.dao.metadata.ttl}") protected int cacheEntityMetaDataTtl
protected long lastCacheFlushTime
protected static final Map<String,Map<String,FieldMetadata>> METADATA_CACHE
public Map<String,Map<String,FieldMetadata>> getEntireCache()
SkuMetadataCacheService
getEntireCache
in interface SkuMetadataCacheService
SkuMetadataCacheService.buildCacheKey(String)
public boolean useCache()
SkuMetadataCacheService
useCache
in interface SkuMetadataCacheService
public Map<String,FieldMetadata> getFromCache(String cacheKey)
getFromCache
in interface SkuMetadataCacheService
public boolean addToCache(String cacheKey, Map<String,FieldMetadata> metadata)
addToCache
in interface SkuMetadataCacheService
public void invalidateFromCache(String cacheKey)
SkuMetadataCacheService
invalidateFromCache
in interface SkuMetadataCacheService
cacheKey
- from SkuMetadataCacheService.buildCacheKey(String)
public String buildCacheKey(String productId)
SkuMetadataCacheService
buildCacheKey
in interface SkuMetadataCacheService
productId
- optional productId, can be nullCopyright © 2022. All rights reserved.