Class DefaultFileLoadingStrategy
- java.lang.Object
-
- net.shibboleth.oidc.metadata.cache.impl.DefaultFileLoadingStrategy
-
- All Implemented Interfaces:
LoadingStrategy
@ThreadSafe public class DefaultFileLoadingStrategy extends Object implements LoadingStrategy
Default strategy for loading information from a file.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private FilemetadataFileThe metadata file.private StringmetadataFileFriendlyNameThe metadata file name to use in logs.
-
Constructor Summary
Constructors Constructor Description DefaultFileLoadingStrategy(Resource metadata)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private InstantgetMetadataUpdateTime()Get the time for the last update/modification of the metadata file.StringgetSourceIdentifier()byte[]load(CacheLoadingContext context)
-
-
-
Constructor Detail
-
DefaultFileLoadingStrategy
public DefaultFileLoadingStrategy(@Nullable Resource metadata) throws IOExceptionConstructor.- Parameters:
metadata- the metadata file resource. Can be null.- Throws:
IOException- if the file is not null put does not exist.
-
-
Method Detail
-
getMetadataUpdateTime
private Instant getMetadataUpdateTime()
Get the time for the last update/modification of the metadata file.- Returns:
- The last update time.
-
load
@Nullable public byte[] load(@Nonnull CacheLoadingContext context) throws CacheLoadingException- Specified by:
loadin interfaceLoadingStrategy- Throws:
CacheLoadingException
-
getSourceIdentifier
@Nonnull public String getSourceIdentifier()
- Specified by:
getSourceIdentifierin interfaceLoadingStrategy
-
-