Class BaseIntegrationCache<K extends IntegrationCacheKey,T>
java.lang.Object
de.hybris.platform.integrationservices.cache.impl.BaseIntegrationCache<K,T>
- All Implemented Interfaces:
IntegrationCache<K,T>
- Direct Known Subclasses:
CsrfParametersCache,DestinationRestTemplateCache,WebhookConvertedItemCache,WebhookDeletedItemCache
public abstract class BaseIntegrationCache<K extends IntegrationCacheKey,T>
extends Object
implements IntegrationCache<K,T>
Base implementation of the IntegrationCache to be extended
for specific generic values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the key exists in the cacheGets the item from the cache by the keyprotected CacheRegiongetCache()Retrieves cache regions used by this cache.Retrieves concrete class of the cached values.protected CacheValueLoaderReturns a cache value loader for the specified item.protected org.slf4j.Loggerlog()Returns a logger for writing in to the log.voidPuts the item in the cache, referenced by the keyRemoves the item from the cache by the keyvoidsetCacheRegion(CacheRegion region) protected abstract CacheKeytoCacheKey(K key) Converts theIntegrationCacheKeyspecific to the implementation to aCacheKey
-
Constructor Details
-
BaseIntegrationCache
public BaseIntegrationCache()
-
-
Method Details
-
get
Description copied from interface:IntegrationCacheGets the item from the cache by the key- Specified by:
getin interfaceIntegrationCache<K extends IntegrationCacheKey,T> - Parameters:
key- Key to the cached item- Returns:
- The object if the key exists, otherwise null
-
put
Description copied from interface:IntegrationCachePuts the item in the cache, referenced by the key- Specified by:
putin interfaceIntegrationCache<K extends IntegrationCacheKey,T> - Parameters:
key- Key to the cached itemitem- Item to cache
-
remove
Description copied from interface:IntegrationCacheRemoves the item from the cache by the key- Specified by:
removein interfaceIntegrationCache<K extends IntegrationCacheKey,T> - Parameters:
key- Key to the item to invalidate- Returns:
- The invalidated item, otherwise null
-
contains
Description copied from interface:IntegrationCacheIndicates whether the key exists in the cache- Specified by:
containsin interfaceIntegrationCache<K extends IntegrationCacheKey,T> - Parameters:
key- Key to test for existence- Returns:
- True if the key exists, otherwise false
-
toCacheKey
Converts theIntegrationCacheKeyspecific to the implementation to aCacheKey- Parameters:
key- an integration key to convert- Returns:
- converted cache key
-
getValueType
Retrieves concrete class of the cached values.- Returns:
- class of the values stored in the cache.
-
load
Returns a cache value loader for the specified item. This implementation simply loads the specified item without any changes or transformations done to it.- Parameters:
item- an item to be placed into the cache.- Returns:
- a loader creating a value to be placed in the cache.
-
setCacheRegion
-
getCache
Retrieves cache regions used by this cache.- Returns:
- a region injected into this facade.
- See Also:
-
log
protected org.slf4j.Logger log()Returns a logger for writing in to the log.- Returns:
- a logger for writing into the log.
-