Package org.ametys.plugins.site
Class SiteInformationCache
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.site.SiteInformationCache
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class SiteInformationCache extends AbstractLogEnabled implements Serviceable, Component
A cache for site information provided by the Back-Office.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
SiteInformationCache.SiteUrlComparator
-
Field Summary
Fields Modifier and Type Field Description private LDAPDataSourceManager
_ldapDataSourceManager
private Map<SiteUrl,Site>
_sites
private SQLDataSourceManager
_sqlDataSourceManager
private Lock
_syncLock
private UserPopulationDAO
_userPopulationDAO
static String
BACKOFFICE_PREFIX_IDENTIFIER
Prefix for backoffice synchronized userpopulationsstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description SiteInformationCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_configureSites(Configuration conf, Collection<Site> sites)
private Configuration
_getBackofficeConfiguration(String url)
private void
_serialize(Configuration configuration, File file)
private void
_synchronize()
private void
_synchronizeMonitoringAndCaptcha(Configuration boConfiguration)
private void
_synchronizePopulationsAndDatasources()
Synchronize the local user populations and datasources with backofficeprivate void
_synchronizeSites()
Map<SiteUrl,Site>
getSites()
Returns the cached informations.void
resetSitesCache()
Clear cached informations.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
BACKOFFICE_PREFIX_IDENTIFIER
public static final String BACKOFFICE_PREFIX_IDENTIFIER
Prefix for backoffice synchronized userpopulations- See Also:
- Constant Field Values
-
_ldapDataSourceManager
private LDAPDataSourceManager _ldapDataSourceManager
-
_sqlDataSourceManager
private SQLDataSourceManager _sqlDataSourceManager
-
_userPopulationDAO
private UserPopulationDAO _userPopulationDAO
-
-
Constructor Detail
-
SiteInformationCache
public SiteInformationCache()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
resetSitesCache
public void resetSitesCache()
Clear cached informations.
-
getSites
public Map<SiteUrl,Site> getSites()
Returns the cached informations.- Returns:
- the cached informations.
-
_synchronize
private void _synchronize()
-
_synchronizeSites
private void _synchronizeSites() throws ConfigurationException
- Throws:
ConfigurationException
-
_configureSites
private void _configureSites(Configuration conf, Collection<Site> sites) throws ConfigurationException
- Throws:
ConfigurationException
-
_getBackofficeConfiguration
private Configuration _getBackofficeConfiguration(String url)
-
_synchronizePopulationsAndDatasources
private void _synchronizePopulationsAndDatasources() throws Exception
Synchronize the local user populations and datasources with backoffice- Throws:
Exception
- If an unexpected error occurred
-
_serialize
private void _serialize(Configuration configuration, File file) throws Exception
- Throws:
Exception
-
_synchronizeMonitoringAndCaptcha
private void _synchronizeMonitoringAndCaptcha(Configuration boConfiguration)
-
-