use of org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties in project cas by apereo.
the class RedisTicketRegistryConfiguration method ticketRegistry.
@Bean
@RefreshScope
public TicketRegistry ticketRegistry() {
final RedisTicketRegistryProperties redis = casProperties.getTicket().getRegistry().getRedis();
final RedisTicketRegistry r = new RedisTicketRegistry(ticketRedisTemplate());
r.setCipherExecutor(Beans.newTicketRegistryCipherExecutor(redis.getCrypto()));
return r;
}
use of org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties in project cas by apereo.
the class RedisTicketRegistryConfiguration method jedisPoolConfig.
private JedisPoolConfig jedisPoolConfig() {
final RedisTicketRegistryProperties redis = casProperties.getTicket().getRegistry().getRedis();
final JedisPoolConfig config = new JedisPoolConfig();
final RedisTicketRegistryProperties.Pool props = redis.getPool();
config.setMaxTotal(props.getMaxActive());
config.setMaxIdle(props.getMaxIdle());
config.setMinIdle(props.getMinIdle());
config.setMaxWaitMillis(props.getMaxWait());
return config;
}
use of org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties in project cas by apereo.
the class RedisTicketRegistryConfiguration method redisConnectionFactory.
@Bean
@RefreshScope
public RedisConnectionFactory redisConnectionFactory() {
final RedisTicketRegistryProperties redis = casProperties.getTicket().getRegistry().getRedis();
final JedisPoolConfig poolConfig = redis.getPool() != null ? jedisPoolConfig() : new JedisPoolConfig();
final JedisConnectionFactory factory = new JedisConnectionFactory(poolConfig);
factory.setHostName(redis.getHost());
factory.setPort(redis.getPort());
if (redis.getPassword() != null) {
factory.setPassword(redis.getPassword());
}
factory.setDatabase(redis.getDatabase());
if (redis.getTimeout() > 0) {
factory.setTimeout(redis.getTimeout());
}
return factory;
}
Aggregations