Search in sources :

Example 1 with RedisObjectFactory

use of org.apereo.cas.redis.core.RedisObjectFactory in project cas by apereo.

the class RedisServiceRegistryConfiguration method redisConnectionFactory.

@Bean
@RefreshScope
public RedisConnectionFactory redisConnectionFactory() {
    final RedisServiceRegistryProperties redis = casProperties.getServiceRegistry().getRedis();
    final RedisObjectFactory obj = new RedisObjectFactory();
    return obj.newRedisConnectionFactory(redis);
}
Also used : RedisServiceRegistryProperties(org.apereo.cas.configuration.model.support.redis.RedisServiceRegistryProperties) RedisObjectFactory(org.apereo.cas.redis.core.RedisObjectFactory) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 2 with RedisObjectFactory

use of org.apereo.cas.redis.core.RedisObjectFactory in project cas by apereo.

the class RedisTicketRegistryConfiguration method redisTicketConnectionFactory.

@ConditionalOnMissingBean(name = "redisTicketConnectionFactory")
@Bean
public RedisConnectionFactory redisTicketConnectionFactory() {
    final RedisTicketRegistryProperties redis = casProperties.getTicket().getRegistry().getRedis();
    final RedisObjectFactory obj = new RedisObjectFactory();
    return obj.newRedisConnectionFactory(redis);
}
Also used : RedisTicketRegistryProperties(org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties) RedisObjectFactory(org.apereo.cas.redis.core.RedisObjectFactory) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with RedisObjectFactory

use of org.apereo.cas.redis.core.RedisObjectFactory in project cas by apereo.

the class CasMetricsRepositoryConfiguration method redisMetricWriter.

@ConditionalOnProperty(prefix = "cas.metrics.redis", name = "prefix")
@Bean
@ExportMetricWriter
public MetricWriter redisMetricWriter() {
    final MetricsProperties.Redis redis = casProperties.getMetrics().getRedis();
    final RedisObjectFactory factory = new RedisObjectFactory();
    final RedisConnectionFactory connectionFactory = factory.newRedisConnectionFactory(redis);
    return new RedisMetricRepository(connectionFactory, redis.getPrefix(), redis.getKey());
}
Also used : MetricsProperties(org.apereo.cas.configuration.model.core.metrics.MetricsProperties) RedisObjectFactory(org.apereo.cas.redis.core.RedisObjectFactory) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) RedisMetricRepository(org.springframework.boot.actuate.metrics.repository.redis.RedisMetricRepository) ExportMetricWriter(org.springframework.boot.actuate.autoconfigure.ExportMetricWriter) ConditionalOnProperty(org.springframework.boot.autoconfigure.condition.ConditionalOnProperty) Bean(org.springframework.context.annotation.Bean)

Aggregations

RedisObjectFactory (org.apereo.cas.redis.core.RedisObjectFactory)3 Bean (org.springframework.context.annotation.Bean)3 MetricsProperties (org.apereo.cas.configuration.model.core.metrics.MetricsProperties)1 RedisServiceRegistryProperties (org.apereo.cas.configuration.model.support.redis.RedisServiceRegistryProperties)1 RedisTicketRegistryProperties (org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties)1 ExportMetricWriter (org.springframework.boot.actuate.autoconfigure.ExportMetricWriter)1 RedisMetricRepository (org.springframework.boot.actuate.metrics.repository.redis.RedisMetricRepository)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 ConditionalOnProperty (org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 RedisConnectionFactory (org.springframework.data.redis.connection.RedisConnectionFactory)1