/** * Sets the pool configuration for this factory. * * @param poolConfig the poolConfig to set. * @deprecated since 2.0, configure {@link JedisPoolConfig} using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setPoolConfig(JedisPoolConfig poolConfig) { getMutableConfiguration().setPoolConfig(poolConfig); }
/** * Sets the client name used by this connection factory. Defaults to none which does not set a client name. * * @param clientName the client name. * @since 1.8 * @deprecated since 2.0, configure the client name using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setClientName(String clientName) { this.getMutableConfiguration().setClientName(clientName); }
/** * Sets whether to use SSL. * * @param useSsl {@literal true} to use SSL. * @since 1.8 * @deprecated since 2.0, configure the SSL usage with {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setUseSsl(boolean useSsl) { getMutableConfiguration().setUseSsl(useSsl); }
/** * Sets the timeout. * * @param timeout the timeout to set. * @deprecated since 2.0, configure the timeout using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setTimeout(int timeout) { getMutableConfiguration().setReadTimeout(Duration.ofMillis(timeout)); getMutableConfiguration().setConnectTimeout(Duration.ofMillis(timeout)); }
/** * Sets the shard info for this factory. * * @param shardInfo the shardInfo to set. * @deprecated since 2.0, configure the individual properties from {@link JedisShardInfo} using * {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setShardInfo(JedisShardInfo shardInfo) { this.shardInfo = shardInfo; this.providedShardInfo = true; getMutableConfiguration().setShardInfo(shardInfo); }
/** * Turns on or off the use of connection pooling. * * @param usePool the usePool to set. * @deprecated since 2.0, configure pooling usage with {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. * @throws IllegalStateException if configured to use sentinel and {@code usePool} is {@literal false} as Jedis * requires pooling for Redis sentinel use. */ @Deprecated public void setUsePool(boolean usePool) { if (isRedisSentinelAware() && !usePool) { throw new IllegalStateException("Jedis requires pooling for Redis Sentinel use!"); } getMutableConfiguration().setUsePooling(usePool); }
public void afterPropertiesSet() { if (shardInfo == null && clientConfiguration instanceof MutableJedisClientConfiguration) { providedShardInfo = false; shardInfo = new JedisShardInfo(getHostName(), getPort(), isUseSsl(), // clientConfiguration.getSslSocketFactory().orElse(null), // clientConfiguration.getSslParameters().orElse(null), // clientConfiguration.getHostnameVerifier().orElse(null)); getRedisPassword().map(String::new).ifPresent(shardInfo::setPassword); int readTimeout = getReadTimeout(); if (readTimeout > 0) { shardInfo.setSoTimeout(readTimeout); } getMutableConfiguration().setShardInfo(shardInfo); } if (getUsePool() && !isRedisClusterAware()) { this.pool = createPool(); } if (isRedisClusterAware()) { this.cluster = createCluster(); } }
/** * Sets the timeout. * * @param timeout the timeout to set. * @deprecated since 2.0, configure the timeout using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setTimeout(int timeout) { getMutableConfiguration().setReadTimeout(Duration.ofMillis(timeout)); getMutableConfiguration().setConnectTimeout(Duration.ofMillis(timeout)); }
/** * Sets whether to use SSL. * * @param useSsl {@literal true} to use SSL. * @since 1.8 * @deprecated since 2.0, configure the SSL usage with {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setUseSsl(boolean useSsl) { getMutableConfiguration().setUseSsl(useSsl); }
/** * Sets the client name used by this connection factory. Defaults to none which does not set a client name. * * @param clientName the client name. * @since 1.8 * @deprecated since 2.0, configure the client name using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setClientName(String clientName) { this.getMutableConfiguration().setClientName(clientName); }
/** * Sets the timeout. * * @param timeout the timeout to set. * @deprecated since 2.0, configure the timeout using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setTimeout(int timeout) { getMutableConfiguration().setReadTimeout(Duration.ofMillis(timeout)); getMutableConfiguration().setConnectTimeout(Duration.ofMillis(timeout)); }
/** * Sets the pool configuration for this factory. * * @param poolConfig the poolConfig to set. * @deprecated since 2.0, configure {@link JedisPoolConfig} using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setPoolConfig(JedisPoolConfig poolConfig) { getMutableConfiguration().setPoolConfig(poolConfig); }
/** * Sets the pool configuration for this factory. * * @param poolConfig the poolConfig to set. * @deprecated since 2.0, configure {@link JedisPoolConfig} using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setPoolConfig(JedisPoolConfig poolConfig) { getMutableConfiguration().setPoolConfig(poolConfig); }
/** * Sets whether to use SSL. * * @param useSsl {@literal true} to use SSL. * @since 1.8 * @deprecated since 2.0, configure the SSL usage with {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setUseSsl(boolean useSsl) { getMutableConfiguration().setUseSsl(useSsl); }
/** * Sets the client name used by this connection factory. Defaults to none which does not set a client name. * * @param clientName the client name. * @since 1.8 * @deprecated since 2.0, configure the client name using {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setClientName(String clientName) { this.getMutableConfiguration().setClientName(clientName); }
/** * Sets the shard info for this factory. * * @param shardInfo the shardInfo to set. * @deprecated since 2.0, configure the individual properties from {@link JedisShardInfo} using * {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setShardInfo(JedisShardInfo shardInfo) { this.shardInfo = shardInfo; this.providedShardInfo = true; getMutableConfiguration().setShardInfo(shardInfo); }
/** * Sets the shard info for this factory. * * @param shardInfo the shardInfo to set. * @deprecated since 2.0, configure the individual properties from {@link JedisShardInfo} using * {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. */ @Deprecated public void setShardInfo(JedisShardInfo shardInfo) { this.shardInfo = shardInfo; this.providedShardInfo = true; getMutableConfiguration().setShardInfo(shardInfo); }
/** * Turns on or off the use of connection pooling. * * @param usePool the usePool to set. * @deprecated since 2.0, configure pooling usage with {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. * @throws IllegalStateException if configured to use sentinel and {@code usePool} is {@literal false} as Jedis * requires pooling for Redis sentinel use. */ @Deprecated public void setUsePool(boolean usePool) { if (isRedisSentinelAware() && !usePool) { throw new IllegalStateException("Jedis requires pooling for Redis Sentinel use!"); } getMutableConfiguration().setUsePooling(usePool); }
/** * Turns on or off the use of connection pooling. * * @param usePool the usePool to set. * @deprecated since 2.0, configure pooling usage with {@link JedisClientConfiguration}. * @throws IllegalStateException if {@link JedisClientConfiguration} is immutable. * @throws IllegalStateException if configured to use sentinel and {@code usePool} is {@literal false} as Jedis * requires pooling for Redis sentinel use. */ @Deprecated public void setUsePool(boolean usePool) { if (isRedisSentinelAware() && !usePool) { throw new IllegalStateException("Jedis requires pooling for Redis Sentinel use!"); } getMutableConfiguration().setUsePooling(usePool); }
public void afterPropertiesSet() { if (shardInfo == null && clientConfiguration instanceof MutableJedisClientConfiguration) { providedShardInfo = false; shardInfo = new JedisShardInfo(getHostName(), getPort(), isUseSsl(), // clientConfiguration.getSslSocketFactory().orElse(null), // clientConfiguration.getSslParameters().orElse(null), // clientConfiguration.getHostnameVerifier().orElse(null)); getRedisPassword().map(String::new).ifPresent(shardInfo::setPassword); int readTimeout = getReadTimeout(); if (readTimeout > 0) { shardInfo.setSoTimeout(readTimeout); } getMutableConfiguration().setShardInfo(shardInfo); } if (getUsePool() && !isRedisClusterAware()) { this.pool = createPool(); } if (isRedisClusterAware()) { this.cluster = createCluster(); } }