use of org.gluu.conf.model.SharedConfigurationEntry in project oxCore by GluuFederation.
the class ConfigurationFactory method loadCacheConfiguration.
private CacheConfiguration loadCacheConfiguration() {
SharedConfigurationEntry sharedConfigurationEntry = persistenceEntryManager.find(SharedConfigurationEntry.class, SHARED_CONFIGURATION_DN);
if (sharedConfigurationEntry == null) {
LOG.error("Failed to load share configuration from DB. Please fix it!!!.");
throw new ConfigurationException("Failed to load shared configuration from DB.");
}
CacheConfiguration cacheConfiguration = sharedConfigurationEntry.getCacheConfiguration();
if (cacheConfiguration == null || cacheConfiguration.getCacheProviderType() == null) {
LOG.error("Failed to read cache configuration from DB. Please check configuration oxCacheConfiguration attribute " + "that must contain cache configuration JSON represented by CacheConfiguration.class. Shared configuration DN: " + SHARED_CONFIGURATION_DN);
LOG.info("Creating fallback IN-MEMORY cache configuration ... ");
cacheConfiguration = new CacheConfiguration();
cacheConfiguration.setInMemoryConfiguration(new InMemoryConfiguration());
LOG.info("IN-MEMORY cache configuration is created.");
}
LOG.info("Cache configuration: " + cacheConfiguration);
return cacheConfiguration;
}
Aggregations