Package net.shibboleth.idp.admin.impl
Class InstallableComponentPropertyCache
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.admin.impl.InstallableComponentPropertyCache
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
A caching shim on top of
InstallableComponentSupport.loadInfo(List, HttpClient, HttpClientSecurityParameters).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<URL,Pair<Instant, Properties>> The cache.private DurationHow long before a cached entry expires.private final org.slf4j.LoggerLogger.private final ReadWriteLockShared lock. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidloadInfo(List<URL> updateURLs, org.apache.hc.client5.http.classic.HttpClient client, HttpClientSecurityParameters securityParameters) Provide a shim on top ofInstallableComponentSupport.loadInfo(List, HttpClient, HttpClientSecurityParameters).voidsetCacheLife(Duration howLong) SetcacheLife.Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logLogger. -
cache
The cache. -
cacheLife
How long before a cached entry expires. -
readWriteLock
Shared lock.
-
-
Constructor Details
-
InstallableComponentPropertyCache
public InstallableComponentPropertyCache()
-
-
Method Details
-
setCacheLife
SetcacheLife.- Parameters:
howLong- what to set
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
loadInfo
@Nullable public Properties loadInfo(@Nonnull List<URL> updateURLs, @Nonnull org.apache.hc.client5.http.classic.HttpClient client, @Nullable HttpClientSecurityParameters securityParameters) Provide a shim on top ofInstallableComponentSupport.loadInfo(List, HttpClient, HttpClientSecurityParameters).We use the first URL in the list as the cache key.
- Parameters:
updateURLs- where to lookclient- the http client to usesecurityParameters- the HttpClientSecurityParameters, if any- Returns:
- the property files for the component.
-