Class DefaultFileLoadingStrategy
java.lang.Object
net.shibboleth.oidc.metadata.cache.impl.DefaultFileLoadingStrategy
- All Implemented Interfaces:
LoadingStrategy
Default strategy for loading information from a file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate InstantGet the time for the last update/modification of the metadata file.Get a friendly name source identifier to use in log statements.byte[]load(CacheLoadingContext context) Load cache data from a source.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
metadataFile
The metadata file. -
metadataFileFriendlyName
The metadata file name to use in logs.
-
-
Constructor Details
-
DefaultFileLoadingStrategy
Constructor.- Parameters:
metadata- the metadata file resource. Can be null.- Throws:
IOException- if the file is not null put does not exist.
-
-
Method Details
-
getMetadataUpdateTime
Get the time for the last update/modification of the metadata file.- Returns:
- The last update time.
-
load
Load cache data from a source. If the source data has not changed from the last time it was loaded (as specified in theCacheLoadingContext) anullshould be returned. If source data can not be loaded for a known and accepted reason, anullshould be returned. For any other error in loading cache data, theCacheLoadingExceptionshould be thrown.- Specified by:
loadin interfaceLoadingStrategy- Parameters:
context- the cache loading context- Returns:
- the cache information as bytes.
- Throws:
CacheLoadingException- if there is an error loading the cache.
-
getSourceIdentifier
Get a friendly name source identifier to use in log statements.- Specified by:
getSourceIdentifierin interfaceLoadingStrategy- Returns:
- the source identifier friendly name.
-