Class WmtsCapabilitiesDownloaderImpl
java.lang.Object
io.jmix.mapsflowui.component.loader.impl.WmtsCapabilitiesDownloaderImpl
- All Implemented Interfaces:
WmtsCapabilitiesDownloader
Default
WmtsCapabilitiesDownloader implementation that fetches documents over HTTP using
HttpClient. The request timeout is taken from MapsFlowuiProperties.getWmtsCapabilitiesTimeout().
Downloaded documents are cached per URL for MapsFlowuiProperties.getWmtsCapabilitiesCacheTtl(), and
concurrent downloads of the same document are coalesced into a single request. Failures are not cached.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String, WmtsCapabilitiesDownloaderImpl.CacheEntry> protected final Map<String, CompletableFuture<String>> protected final MapsFlowuiProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HttpClientReturns the GetCapabilities document available at the given URL.protected StringdownloadDocument(String url) protected Instantnow()resolveCapabilitiesUrl(@Nullable String sourceUrl, @Nullable String explicitUrl) Resolves the URL of the GetCapabilities document.
-
Field Details
-
properties
-
cache
-
inFlightDownloads
-
-
Constructor Details
-
WmtsCapabilitiesDownloaderImpl
-
-
Method Details
-
resolveCapabilitiesUrl
Description copied from interface:WmtsCapabilitiesDownloaderResolves the URL of the GetCapabilities document.- Specified by:
resolveCapabilitiesUrlin interfaceWmtsCapabilitiesDownloader- Parameters:
sourceUrl- the WMTS source service URL, may benullexplicitUrl- explicitly configured document URL, may benull- Returns:
explicitUrlif set, otherwise the standard KVP GetCapabilities URL derived fromsourceUrl
-
download
Description copied from interface:WmtsCapabilitiesDownloaderReturns the GetCapabilities document available at the given URL.- Specified by:
downloadin interfaceWmtsCapabilitiesDownloader- Parameters:
url- the document URL- Returns:
- the document content
-
downloadDocument
-
createHttpClient
-
now
-