Interface LoadingStrategy

All Known Implementing Classes:
DefaultFileLoadingStrategy, DefaultResourceLoadingStrategy

public interface LoadingStrategy
A strategy that loads binary information from a configured source.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get a friendly name source identifier to use in log statements.
    byte[]
    Load cache data from a source.
  • Method Details

    • 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 CacheLoadingException
      Load cache data from a source. If the source data has not changed from the last time it was loaded (as specified in the CacheLoadingContext) 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, the CacheLoadingException should be thrown.
      Parameters:
      context - the cache loading context
      Returns:
      the cache information as bytes.
      Throws:
      CacheLoadingException - if there is an error loading the cache.