Class RulesLoader
-
- All Implemented Interfaces:
public class RulesLoaderFacilitates the download and caching of rules from a url as well as an asset bundled with the app.
-
-
Constructor Summary
Constructors Constructor Description RulesLoader(String cacheName)
-
Method Summary
Modifier and Type Method Description StringgetCacheName()Gets the cache name that will be used for storing and retrieving the rules when using operations of this class. voidloadFromUrl(@NonNull() String url, @NonNull() AdobeCallback<RulesLoadResult> callback)Loads rules from the urland invokescallbackwith the extracted rules.RulesLoadResultloadFromAsset(@NonNull() String assetName)Loads rules from an asset bundled with the app and returns the extracted rules. RulesLoadResultloadFromCache(@NonNull() String key)Loads rules that were previously cached via loadFromAsset()orloadFromUrl-
-
Constructor Detail
-
RulesLoader
RulesLoader(String cacheName)
-
-
Method Detail
-
getCacheName
@NonNull() String getCacheName()
Gets the cache name that will be used for storing and retrieving the rules when using operations of this class.
- Returns:
cache name that will be used for storing and retrieving the rules.
-
loadFromUrl
void loadFromUrl(@NonNull() String url, @NonNull() AdobeCallback<RulesLoadResult> callback)
Loads rules from the
urland invokescallbackwith the extracted rules. Additionally, the extracted content is cached in cache bucket with namenameandurlas the key inCacheService.- Parameters:
url- the url from which the compressed rules are to be downloadedcallback- the callback that will be invoked with the result of the download
-
loadFromAsset
@NonNull() RulesLoadResult loadFromAsset(@NonNull() String assetName)
Loads rules from an asset bundled with the app and returns the extracted rules. Additionally, the extracted content is cached in cache bucket with name
RulesLoader.getCacheName()andassetNameas the key inCacheService.- Parameters:
assetName- the asset name from where the rules must be fetched- Returns:
RulesDownloadResultindicating the result of the load operation.
-
loadFromCache
@NonNull() RulesLoadResult loadFromCache(@NonNull() String key)
Loads rules that were previously cached via
loadFromAsset()orloadFromUrl- Parameters:
key- the asset name or url that was previously used for loading and storing rules vialoadFromAsset()orloadFromUrl- Returns:
RulesDownloadResultindicating the result of the load operation.
-
-
-
-