Search in sources :

Example 1 with CacheConfiguration

use of org.xdi.service.cache.CacheConfiguration in project oxAuth by GluuFederation.

the class ApplicationFactory method getCacheConfiguration.

@Produces
@ApplicationScoped
public CacheConfiguration getCacheConfiguration() {
    CacheConfiguration cacheConfiguration = applianceService.getAppliance().getCacheConfiguration();
    if (cacheConfiguration == null || cacheConfiguration.getCacheProviderType() == null) {
        log.error("Failed to read cache configuration from LDAP. Please check appliance oxCacheConfiguration attribute " + "that must contain cache configuration JSON represented by CacheConfiguration.class. Applieance DN: " + applianceService.getAppliance().getDn());
        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;
}
Also used : InMemoryConfiguration(org.xdi.service.cache.InMemoryConfiguration) CacheConfiguration(org.xdi.service.cache.CacheConfiguration) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 2 with CacheConfiguration

use of org.xdi.service.cache.CacheConfiguration in project oxTrust by GluuFederation.

the class ApplicationFactory method getCacheConfiguration.

@Produces
@ApplicationScoped
public CacheConfiguration getCacheConfiguration() {
    CacheConfiguration cacheConfiguration = applianceService.getAppliance().getCacheConfiguration();
    if (cacheConfiguration == null || cacheConfiguration.getCacheProviderType() == null) {
        log.error("Failed to read cache configuration from LDAP. Please check appliance oxCacheConfiguration attribute " + "that must contain cache configuration JSON represented by CacheConfiguration.class. Applieance DN: " + applianceService.getAppliance().getDn());
        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;
}
Also used : InMemoryConfiguration(org.xdi.service.cache.InMemoryConfiguration) CacheConfiguration(org.xdi.service.cache.CacheConfiguration) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

ApplicationScoped (javax.enterprise.context.ApplicationScoped)2 Produces (javax.enterprise.inject.Produces)2 CacheConfiguration (org.xdi.service.cache.CacheConfiguration)2 InMemoryConfiguration (org.xdi.service.cache.InMemoryConfiguration)2