Class DefaultResourceLoadingStrategy
java.lang.Object
net.shibboleth.oidc.metadata.cache.impl.DefaultResourceLoadingStrategy
- All Implemented Interfaces:
LoadingStrategy
Default strategy for loading information from a resource.
- Since:
- 3.1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate InstantGet the time for the last update/modification of the metadata resource.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. -
metadataResource
The metadata resource. -
metadataResourceFriendlyName
The metadata resource name to use in logs.
-
-
Constructor Details
-
DefaultResourceLoadingStrategy
Constructor.- Parameters:
metadata- the metadata resource. Can be null.
-
-
Method Details
-
getMetadataUpdateTime
Get the time for the last update/modification of the metadata resource.- Returns:
- The last update time.
- Throws:
IOException- if the time cannot be fetched.
-
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.
-