Package io.goobi.viewer.controller
Class DataManager
java.lang.Object
io.goobi.viewer.controller.DataManager
Application-scoped singleton that acts as the central access point for the DAO, configuration, and other core services.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the Solr search index client directly, without triggeringSolrSearchIndex.checkReloadNeeded().Getter for the fieldauthResponseListener.Getter for the fieldbookmarkManager.Getter for the fieldconfiguration.getDao()Getter for the fielddao.intstatic DataManagerGetter for the fieldinstance.Returns the application-scopedIpRangeCache.Getter for the fieldlanguageHelper.Returns the application-scopedLicenseTypeCache.getModule.Getter for the fieldmodules.Getter for the fieldrecordCampaignMap.Getter for the fieldsearchIndex.intgetSessionCount.Getter for the fieldsessionMap.de.intranda.monitoring.timer.TimeAnalysisgetUrlBuilder.voidinjectAuthResponseListener.voidinjectBookmarkManager(SessionStoreBookmarkManager bookmarkManager) injectBookmarkManager.voidinjectConfiguration(Configuration configuration) Sets custom Configuration object (used for unit testing).voidSets custom IDAO object (used for unit testing).voidinjectSearchIndex(SolrSearchIndex searchIndex) Sets custom SolrSearchIndex object (used for unit testing).booleanisModuleLoaded(String id) isModuleLoaded.booleanregisterModule(IModule module) registerModule.voidvoidsetClientManager(ClientApplicationManager manager) voidsetConnectorVersion(String connectorVersion) voidsetHotfolderFileCount(int hotfolderFileCount) voidsetIndexerVersion(String indexerVersion) voidsetRecordCampaignMap(Map<String, List<Campaign>> recordCampaignMap) Setter for the fieldrecordCampaignMap.voidsetRestApiManager(RestApiManager restApiManager) voidsetUsageStatisticsRecorder(UsageStatisticsRecorder usageStatisticsRecorder)
-
Method Details
-
getInstance
Getter for the fieldinstance.- Returns:
- the singleton DataManager instance
-
getModules
Getter for the fieldmodules.Returns a defensive copy to prevent
ConcurrentModificationExceptionwhen JSF'sc:forEachiterates the list while a background thread registers a new module viaregisterModule(IModule).- Returns:
- a snapshot of all registered viewer modules
-
getUrlBuilder
getUrlBuilder.- Returns:
- the URL builder provided by a registered module, or the default URL builder if no module provides one
-
getModule
getModule.- Parameters:
id- unique identifier of the module to look up- Returns:
- the registered IModule with the given ID
- Throws:
ModuleMissingException- if any.
-
isModuleLoaded
isModuleLoaded.- Parameters:
id- unique identifier of the module to check- Returns:
- true if a module with the given ID is currently registered, false otherwise
-
registerModule
registerModule.- Parameters:
module- module instance to register- Returns:
- true if the module was successfully registered, false if a module with the same ID is already registered
-
getSessionCount
public int getSessionCount()getSessionCount.- Returns:
- a int.
-
getSessionMap
Getter for the fieldsessionMap.- Returns:
- the map of active HTTP session data, keyed by session ID
-
getConfiguration
Getter for the fieldconfiguration.- Returns:
- the global viewer configuration instance, initialised lazily on first access
-
getLanguageHelper
Getter for the fieldlanguageHelper.- Returns:
- the language helper instance for ISO language code lookups, initialised lazily on first access
-
getSearchIndex
Getter for the fieldsearchIndex.- Returns:
- the Solr search index instance, initialised lazily on first access
-
closeSearchIndex
Closes the Solr search index client directly, without triggeringSolrSearchIndex.checkReloadNeeded().Use this during application shutdown instead of
getSearchIndex().close()to prevent a closed client from being silently replaced by a new one.- Throws:
IOException- if closing the client fails
-
getDao
Getter for the fielddao.- Returns:
- the data access object for database operations, initialised lazily on first access
- Throws:
DAOException- if any.
-
injectConfiguration
Sets custom Configuration object (used for unit testing).- Parameters:
configuration- configuration instance to inject
-
injectSearchIndex
Sets custom SolrSearchIndex object (used for unit testing).- Parameters:
searchIndex- Solr search index instance to inject
-
injectDao
Sets custom IDAO object (used for unit testing).- Parameters:
dao- DAO instance to inject
-
getBookmarkManager
Getter for the fieldbookmarkManager.- Returns:
- the session-scoped bookmark manager, creating one if not yet initialized
-
injectBookmarkManager
injectBookmarkManager.- Parameters:
bookmarkManager- bookmark manager instance to inject
-
injectAuthResponseListener
injectAuthResponseListener.- Parameters:
listener- authentication response listener to inject
-
getAuthResponseListener
Getter for the fieldauthResponseListener.- Returns:
- the authentication response listener, creating one if not yet initialized
-
getRecordCampaignMap
Getter for the fieldrecordCampaignMap.- Returns:
- the map of persistent identifiers (PI) to associated crowdsourcing campaigns
-
setRecordCampaignMap
Setter for the fieldrecordCampaignMap.- Parameters:
recordCampaignMap- map of PI to associated crowdsourcing campaigns
-
getIndexerVersion
-
setIndexerVersion
- Parameters:
indexerVersion- version string of the Goobi viewer indexer
-
getConnectorVersion
-
setConnectorVersion
- Parameters:
connectorVersion- version string of the Goobi viewer connector
-
getHotfolderFileCount
public int getHotfolderFileCount() -
setHotfolderFileCount
public void setHotfolderFileCount(int hotfolderFileCount) - Parameters:
hotfolderFileCount- number of files currently in the hotfolder
-
getRestApiManager
-
setRestApiManager
- Parameters:
restApiManager- REST API manager instance to set
-
getRecordLockManager
-
getLicenseTypeCache
Returns the application-scopedLicenseTypeCache. Seedocs/superpowers/specs/2026-04-22-dao-access-cache-design.md.- Returns:
- the singleton cache instance; never null
-
getIpRangeCache
Returns the application-scopedIpRangeCache.- Returns:
- the singleton cache instance; never null
-
getTiming
public de.intranda.monitoring.timer.TimeAnalysis getTiming() -
resetTiming
public void resetTiming() -
getFileResourceManager
-
getRestApiJobManager
-
getArchiveManager
-
getClientManager
- Throws:
DAOException
-
getSecurityManager
-
setClientManager
-
getUsageStatisticsRecorder
- Throws:
DAOException
-
setUsageStatisticsRecorder
-
getBearerTokenManager
-