Search in sources :

Example 1 with JedisConnectionFactory

use of org.springframework.data.redis.connection.jedis.JedisConnectionFactory in project spring-boot by spring-projects.

the class RedisTestServer method createConnectionFactory.

private JedisConnectionFactory createConnectionFactory() {
    JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
    connectionFactory.afterPropertiesSet();
    testConnection(connectionFactory);
    return connectionFactory;
}
Also used : JedisConnectionFactory(org.springframework.data.redis.connection.jedis.JedisConnectionFactory)

Example 2 with JedisConnectionFactory

use of org.springframework.data.redis.connection.jedis.JedisConnectionFactory in project spring-cloud-connectors by spring-cloud.

the class RedisConnectionFactoryCloudConfigTestHelper method assertConnectionProperties.

public static void assertConnectionProperties(RedisConnectionFactory connector, int timeout) {
    JedisConnectionFactory jedisConnector = (JedisConnectionFactory) connector;
    assertEquals(timeout, jedisConnector.getTimeout());
}
Also used : JedisConnectionFactory(org.springframework.data.redis.connection.jedis.JedisConnectionFactory)

Example 3 with JedisConnectionFactory

use of org.springframework.data.redis.connection.jedis.JedisConnectionFactory in project spring-security-oauth by spring-projects.

the class RedisTokenStorePrefixTests method setup.

@Before
public void setup() throws Exception {
    JedisShardInfo shardInfo = new JedisShardInfo("localhost");
    JedisConnectionFactory connectionFactory = new JedisConnectionFactory(shardInfo);
    tokenStore = new RedisTokenStore(connectionFactory);
    tokenStore.setPrefix("spring:oauth2:");
}
Also used : JedisConnectionFactory(org.springframework.data.redis.connection.jedis.JedisConnectionFactory) JedisShardInfo(redis.clients.jedis.JedisShardInfo) Before(org.junit.Before)

Example 4 with JedisConnectionFactory

use of org.springframework.data.redis.connection.jedis.JedisConnectionFactory in project spring-security-oauth by spring-projects.

the class RedisTokenStoreTests method setup.

@Before
public void setup() throws Exception {
    JedisShardInfo shardInfo = new JedisShardInfo("localhost");
    JedisConnectionFactory connectionFactory = new JedisConnectionFactory(shardInfo);
    tokenStore = new RedisTokenStore(connectionFactory);
}
Also used : JedisConnectionFactory(org.springframework.data.redis.connection.jedis.JedisConnectionFactory) JedisShardInfo(redis.clients.jedis.JedisShardInfo) Before(org.junit.Before)

Example 5 with JedisConnectionFactory

use of org.springframework.data.redis.connection.jedis.JedisConnectionFactory 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;
}
Also used : RedisTicketRegistryProperties(org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties) JedisConnectionFactory(org.springframework.data.redis.connection.jedis.JedisConnectionFactory) JedisPoolConfig(redis.clients.jedis.JedisPoolConfig) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

JedisConnectionFactory (org.springframework.data.redis.connection.jedis.JedisConnectionFactory)8 Before (org.junit.Before)2 Bean (org.springframework.context.annotation.Bean)2 JedisShardInfo (redis.clients.jedis.JedisShardInfo)2 RedisTicketRegistryProperties (org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 ServiceConnectorCreationException (org.springframework.cloud.service.ServiceConnectorCreationException)1 LettuceConnectionFactory (org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory)1 JedisPoolConfig (redis.clients.jedis.JedisPoolConfig)1