Package io.goobi.viewer.controller
Class RestApiManager
java.lang.Object
io.goobi.viewer.controller.RestApiManager
Handles urls to configured rest api endpoints.
Two endpoints are managed: one for data (solr, dao) and one for content (image, ocr, other media) An AbstractApiUrlManager
is kept for
both. These can either be injected directly in the constructor or resolved from a Configuration
.
In the latter case, data resources url is taken from Configuration.getRestApiUrl()
, content resources url is taken from
Configuration.getIIIFApiUrl()
.
Both urls are updated if the configuration changes. Also, if the configured url contains '/rest' that part is rewritten to '/api/v1' if the rewritten url points to a goobi viewer v1 rest api.
- Author:
- florian
-
Constructor Summary
ConstructorDescriptionCreate an instance directly using the unchanged given ApiUrlManagers.RestApiManager
(Configuration config) Create an instance based on configuration. -
Method Summary
-
Constructor Details
-
RestApiManager
public RestApiManager()Create an instance directly using the unchanged given ApiUrlManagers. -
RestApiManager
Create an instance based on configuration. Final urls may change from configured ones- Parameters:
config
-
-
-
Method Details
-
getDataApiManager
- Returns:
- the dataApiManager if it is either set directly or if the configured rest endpoint points to a goobi viewer v1 rest endpoint. Otherwise null is returned
-
getDataApiManager
-
getDataApiUrl
- Returns:
- The url to the data api. Either
AbstractApiUrlManager.getApiUrl()
of thegetDataApiManager()
if it exists, or else the configuredConfiguration.getRestApiUrl()
-
getContentApiUrl
- Returns:
- The url to the content api. Either
AbstractApiUrlManager.getApiUrl()
of thegetContentApiManager()
if it exists, or else the configuredConfiguration.getIIIFApiUrl()
-
getContentApiManager
- Returns:
- the contentApiManager if it is either set directly or if the configured rest endpoint points to a goobi viewer v1 rest endpoint. Otherwise null is returned
-
getContentApiManager
-
getCMSMediaImageApiManager
-
getCMSMediaImageApiManager
-
isLegacyUrl
- Parameters:
restApiUrl
-- Returns:
- true if restApiUrl is legacy URL; false otherwise
-
getIIIFDataApiUrl
- Returns:
- the url to the data api to use for IIIF resources
-
getIIIFContentApiUrl
- Returns:
- the url to the content api to use for IIIF resources
-
getIIIFContentApiUrl
- Parameters:
version
-- Returns:
- the url to the content api to use for IIIF resources
-
getIIIFDataApiManager
-
getIIIFContentApiManager
-
getVersionToUseForIIIF
- Returns:
- Appropriate API version to use for IIIF
-