Interface LoadingStrategy
-
public interface LoadingStrategyA strategy that loads binary information from a configured source.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetSourceIdentifier()Get a friendly name source identifier to use in log statements.byte[]load(CacheLoadingContext context)Load cache data from a source.
-
-
-
Method Detail
-
getSourceIdentifier
@Nonnull String getSourceIdentifier()
Get a friendly name source identifier to use in log statements.- Returns:
- the source identifier friendly name.
-
load
@Nullable byte[] load(@Nonnull CacheLoadingContext context) throws CacheLoadingExceptionLoad cache data from a source. If the source data has not changed from the last time it was loaded (as specified in the cache loading context) a null should be returned. If source data can not be loaded for a known and accepted reason, a null should be returned. For any other error in loading cache data, theCacheLoadingExceptionshould be thrown.- Parameters:
context- the cache loading context- Returns:
- the cache information as bytes.
- Throws:
CacheLoadingException- if there is an error loading the cache.
-
-