@Deprecated public final class RedisFeatureStoreBuilder extends java.lang.Object implements FeatureStoreFactory, DiagnosticDescription
The replacement for this class is RedisDataStoreBuilder
.
This class is retained for backward compatibility and will be removed in a future version.
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_CACHE_TIME_SECONDS
Deprecated.
|
static java.lang.String |
DEFAULT_PREFIX
Deprecated.
The default value for
prefix(String) . |
static java.net.URI |
DEFAULT_URI
Deprecated.
The default value for the Redis URI:
redis://localhost:6379 |
Constructor and Description |
---|
RedisFeatureStoreBuilder(java.lang.String scheme,
java.lang.String host,
int port,
long cacheTimeSecs)
Deprecated.
Please use
Components.redisFeatureStore(java.net.URI) . |
RedisFeatureStoreBuilder(java.net.URI uri,
long cacheTimeSecs)
Deprecated.
Please use
Components.redisFeatureStore(java.net.URI) . |
Modifier and Type | Method and Description |
---|---|
RedisFeatureStoreBuilder |
asyncRefresh(boolean enabled)
|
RedisFeatureStore |
build()
Deprecated.
Build a
RedisFeatureStore based on the currently configured builder object. |
RedisFeatureStoreBuilder |
cacheTime(long cacheTime,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
|
RedisFeatureStoreBuilder |
caching(FeatureStoreCacheConfig caching)
Deprecated.
Specifies whether local caching should be enabled and if so, sets the cache properties.
|
RedisFeatureStoreBuilder |
connectTimeout(int connectTimeout,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Optional override which sets the connection timeout for the underlying Jedis pool which otherwise defaults to
Protocol.DEFAULT_TIMEOUT |
RedisFeatureStore |
createFeatureStore()
Deprecated.
Synonym for
build() . |
RedisFeatureStoreBuilder |
database(java.lang.Integer database)
Deprecated.
Specifies the database number to use.
|
LDValue |
describeConfiguration(LDConfig config)
Deprecated.
Used internally by the SDK to inspect the configuration.
|
RedisFeatureStoreBuilder |
password(java.lang.String password)
Deprecated.
Specifies a password that will be sent to Redis in an AUTH command.
|
RedisFeatureStoreBuilder |
poolConfig(redis.clients.jedis.JedisPoolConfig poolConfig)
Deprecated.
Optional override if you wish to specify your own configuration to the underlying Jedis pool.
|
RedisFeatureStoreBuilder |
prefix(java.lang.String prefix)
Deprecated.
Optionally configures the namespace prefix for all keys stored in Redis.
|
RedisFeatureStoreBuilder |
refreshStaleValues(boolean enabled)
|
RedisFeatureStoreBuilder |
socketTimeout(int socketTimeout,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Optional override which sets the connection timeout for the underlying Jedis pool which otherwise defaults to
Protocol.DEFAULT_TIMEOUT |
RedisFeatureStoreBuilder |
tls(boolean tls)
Deprecated.
Optionally enables TLS for secure connections to Redis.
|
public static final java.net.URI DEFAULT_URI
redis://localhost:6379
public static final java.lang.String DEFAULT_PREFIX
prefix(String)
.public static final long DEFAULT_CACHE_TIME_SECONDS
FeatureStoreCacheConfig.DEFAULT
.cacheTime(long, TimeUnit)
(in seconds).public RedisFeatureStoreBuilder(java.net.URI uri, long cacheTimeSecs)
Components.redisFeatureStore(java.net.URI)
.RedisFeatureStore
.uri
- the uri of the Redis resource to connect to.cacheTimeSecs
- the cache time in seconds. See cacheTime(long, TimeUnit)
for more information.public RedisFeatureStoreBuilder(java.lang.String scheme, java.lang.String host, int port, long cacheTimeSecs) throws java.net.URISyntaxException
Components.redisFeatureStore(java.net.URI)
.RedisFeatureStore
.scheme
- the URI scheme to usehost
- the hostname to connect toport
- the port to connect tocacheTimeSecs
- the cache time in seconds. See cacheTime(long, TimeUnit)
for more information.java.net.URISyntaxException
- if the URI is not validpublic RedisFeatureStoreBuilder database(java.lang.Integer database)
The database number can also be specified in the Redis URI, in the form redis://host:port/NUMBER
. Any
non-null value that you set with database(Integer)
will override the URI.
database
- the database number, or null to fall back to the URI or the defaultpublic RedisFeatureStoreBuilder password(java.lang.String password)
It is also possible to include a password in the Redis URI, in the form redis://:PASSWORD@host:port
. Any
password that you set with password(String)
will override the URI.
password
- the passwordpublic RedisFeatureStoreBuilder tls(boolean tls)
This is equivalent to specifying a Redis URI that begins with rediss:
rather than redis:
.
Note that not all Redis server distributions support TLS.
tls
- true to enable TLSpublic RedisFeatureStoreBuilder caching(FeatureStoreCacheConfig caching)
FeatureStoreCacheConfig.DEFAULT
. To disable it, pass
FeatureStoreCacheConfig.disabled()
to this method.caching
- a FeatureStoreCacheConfig
object specifying caching parameterspublic RedisFeatureStoreBuilder refreshStaleValues(boolean enabled)
caching(FeatureStoreCacheConfig)
and
FeatureStoreCacheConfig.staleValuesPolicy(com.launchdarkly.client.FeatureStoreCacheConfig.StaleValuesPolicy)
.FeatureStoreCacheConfig.StaleValuesPolicy.REFRESH
or FeatureStoreCacheConfig.StaleValuesPolicy.REFRESH_ASYNC
.enabled
- turns on lazy refresh of cached valuespublic RedisFeatureStoreBuilder asyncRefresh(boolean enabled)
caching(FeatureStoreCacheConfig)
and
FeatureStoreCacheConfig.staleValuesPolicy(com.launchdarkly.client.FeatureStoreCacheConfig.StaleValuesPolicy)
.FeatureStoreCacheConfig.StaleValuesPolicy.REFRESH_ASYNC
.enabled
- turns on asynchronous refresh of cached values (only if refreshStaleValues(boolean)
is also true)public RedisFeatureStoreBuilder prefix(java.lang.String prefix)
prefix
- the namespace prefixpublic RedisFeatureStoreBuilder cacheTime(long cacheTime, java.util.concurrent.TimeUnit timeUnit)
caching(FeatureStoreCacheConfig)
and FeatureStoreCacheConfig.ttl(long, TimeUnit)
.FeatureStoreCacheConfig.DEFAULT
.cacheTime
- the time value to cache for, or 0 to disable local cachingtimeUnit
- the time unit for the time valuepublic RedisFeatureStoreBuilder poolConfig(redis.clients.jedis.JedisPoolConfig poolConfig)
poolConfig
- the Jedis pool configuration.public RedisFeatureStoreBuilder connectTimeout(int connectTimeout, java.util.concurrent.TimeUnit timeUnit)
Protocol.DEFAULT_TIMEOUT
connectTimeout
- the timeouttimeUnit
- the time unit for the timeoutpublic RedisFeatureStoreBuilder socketTimeout(int socketTimeout, java.util.concurrent.TimeUnit timeUnit)
Protocol.DEFAULT_TIMEOUT
socketTimeout
- the socket timeouttimeUnit
- the time unit for the timeoutpublic RedisFeatureStore build()
RedisFeatureStore
based on the currently configured builder object.RedisFeatureStore
configured by this builder.public RedisFeatureStore createFeatureStore()
build()
.createFeatureStore
in interface FeatureStoreFactory
RedisFeatureStore
configured by this builder.public LDValue describeConfiguration(LDConfig config)
DiagnosticDescription
describeConfiguration
in interface DiagnosticDescription
config
- the full configuration, in case this component depends on properties outside itselfLDValue
or null