Class RemoteLogoCacheDownloader
java.lang.Object
pl.edu.icm.unity.engine.api.files.logo.RemoteLogoCacheDownloader
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
@Component
public class RemoteLogoCacheDownloader
extends Object
implements org.springframework.beans.factory.DisposableBean
Downloads and caches on local disk logo files referenced by a remote source (a SAML federation's
IdPs, an OpenID federation's OPs, ...), so that they can later be served locally without a browser
or per-request server side fetch to the (untrusted, remote-controlled) original URI. Downloads for
a given cache group + namespace (e.g. a single federation) are coalesced: while a run is in progress,
further requests don't start a parallel run - the latest one supersedes any not-yet-started request
queued behind it, and runs as soon as the current run finishes. See
CachedLogoFileLoader for
the read side.-
Constructor Summary
ConstructorsConstructorDescriptionRemoteLogoCacheDownloader(UnityServerConfiguration conf, pl.edu.icm.unity.base.message.MessageSource msg, URIAccessService uriAccessService, ExecutorsService executorsService, org.springframework.core.env.Environment environment) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()downloadLogoFilesAsync(String cacheGroup, String namespaceId, Map<? extends LogoCacheKey, Map<String, String>> logosByKeyAndLocale, String httpsTruststore)
-
Constructor Details
-
RemoteLogoCacheDownloader
public RemoteLogoCacheDownloader(UnityServerConfiguration conf, pl.edu.icm.unity.base.message.MessageSource msg, URIAccessService uriAccessService, ExecutorsService executorsService, org.springframework.core.env.Environment environment)
-
-
Method Details
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
downloadLogoFilesAsync
public CompletableFuture<Void> downloadLogoFilesAsync(String cacheGroup, String namespaceId, Map<? extends LogoCacheKey, Map<String, String>> logosByKeyAndLocale, String httpsTruststore) - Parameters:
cacheGroup- logical owner of the cache (e.g. "samlIdpLogos", "oauthFederationLogos") - keeps different modules' caches from colliding on disk.namespaceId- id of the remote source the logos come from (e.g. a federation id) - used to scope cleanup of no-longer-referenced logos to a single refresh run.logosByKeyAndLocale- for every cached entity, its logo URI(s) keyed by locale code (empty string for the default/unlocalized one).
-