public static class LDConfig.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder()
Creates a builder with all configuration parameters set to the default
|
Modifier and Type | Method and Description |
---|---|
LDConfig.Builder |
allAttributesPrivate(boolean allPrivate)
Deprecated.
|
LDConfig.Builder |
baseURI(java.net.URI baseURI)
|
LDConfig |
build()
Builds the configured
LDConfig object. |
LDConfig.Builder |
capacity(int capacity)
Deprecated.
|
LDConfig.Builder |
connectTimeout(int connectTimeout)
Deprecated.
|
LDConfig.Builder |
connectTimeoutMillis(int connectTimeoutMillis)
Deprecated.
|
LDConfig.Builder |
dataSource(UpdateProcessorFactory factory)
Sets the implementation of the component that receives feature flag data from LaunchDarkly,
using a factory object.
|
LDConfig.Builder |
dataStore(FeatureStoreFactory factory)
Sets the implementation of the data store to be used for holding feature flags and
related data received from LaunchDarkly, using a factory object.
|
LDConfig.Builder |
diagnosticOptOut(boolean diagnosticOptOut)
Set to true to opt out of sending diagnostics data.
|
LDConfig.Builder |
eventProcessorFactory(EventProcessorFactory factory)
Deprecated.
|
LDConfig.Builder |
events(EventProcessorFactory factory)
Sets the implementation of
EventProcessor to be used for processing analytics events. |
LDConfig.Builder |
eventsURI(java.net.URI eventsURI)
Deprecated.
Use @link
Components.sendEvents() wtih EventProcessorBuilder.baseURI(URI) . |
LDConfig.Builder |
featureStore(FeatureStore store)
Deprecated.
Please use
featureStoreFactory(FeatureStoreFactory) . |
LDConfig.Builder |
featureStoreFactory(FeatureStoreFactory factory)
Deprecated.
|
LDConfig.Builder |
flushInterval(int flushInterval)
Deprecated.
|
LDConfig.Builder |
http(HttpConfigurationFactory factory)
Sets the SDK's networking configuration, using a factory object.
|
LDConfig.Builder |
inlineUsersInEvents(boolean inlineUsersInEvents)
Deprecated.
|
LDConfig.Builder |
offline(boolean offline)
Set whether this client is offline.
|
LDConfig.Builder |
pollingIntervalMillis(long pollingIntervalMillis)
Deprecated.
|
LDConfig.Builder |
privateAttributeNames(java.lang.String... names)
Deprecated.
|
LDConfig.Builder |
proxyHost(java.lang.String host)
Deprecated.
|
LDConfig.Builder |
proxyPassword(java.lang.String password)
|
LDConfig.Builder |
proxyPort(int port)
Deprecated.
|
LDConfig.Builder |
proxyUsername(java.lang.String username)
|
LDConfig.Builder |
reconnectTimeMs(long reconnectTimeMs)
|
LDConfig.Builder |
samplingInterval(int samplingInterval)
Deprecated.
This feature will be removed in a future version of the SDK.
|
LDConfig.Builder |
sendEvents(boolean sendEvents)
Deprecated.
|
LDConfig.Builder |
socketTimeout(int socketTimeout)
Deprecated.
|
LDConfig.Builder |
socketTimeoutMillis(int socketTimeoutMillis)
Deprecated.
|
LDConfig.Builder |
sslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.X509TrustManager trustManager)
|
LDConfig.Builder |
startWaitMillis(long startWaitMillis)
Set how long the constructor will block awaiting a successful connection to LaunchDarkly.
|
LDConfig.Builder |
stream(boolean stream)
Deprecated.
|
LDConfig.Builder |
streamURI(java.net.URI streamURI)
Deprecated.
|
LDConfig.Builder |
updateProcessorFactory(UpdateProcessorFactory factory)
Deprecated.
|
LDConfig.Builder |
useLdd(boolean useLdd)
Deprecated.
|
LDConfig.Builder |
userKeysCapacity(int capacity)
Deprecated.
|
LDConfig.Builder |
userKeysFlushInterval(int flushInterval)
Deprecated.
|
LDConfig.Builder |
wrapperName(java.lang.String wrapperName)
Deprecated.
|
LDConfig.Builder |
wrapperVersion(java.lang.String wrapperVersion)
Deprecated.
|
public Builder()
@Deprecated public LDConfig.Builder baseURI(java.net.URI baseURI)
Components.streamingDataSource()
with StreamingDataSourceBuilder.pollingBaseURI(URI)
,
or Components.pollingDataSource()
with PollingDataSourceBuilder.baseURI(URI)
.
This method has no effect if you have used dataSource(UpdateProcessorFactory)
to
specify polling or streaming options, which is the preferred method.
baseURI
- the base URL of the LaunchDarkly server for this configuration.@Deprecated public LDConfig.Builder eventsURI(java.net.URI eventsURI)
Components.sendEvents()
wtih EventProcessorBuilder.baseURI(URI)
.eventsURI
- the events URL of the LaunchDarkly server for this configuration@Deprecated public LDConfig.Builder streamURI(java.net.URI streamURI)
Components.streamingDataSource()
with StreamingDataSourceBuilder.pollingBaseURI(URI)
.
This method has no effect if you have used dataSource(UpdateProcessorFactory)
to
specify polling or streaming options, which is the preferred method.
streamURI
- the base URL of the LaunchDarkly streaming serverpublic LDConfig.Builder dataStore(FeatureStoreFactory factory)
Components.inMemoryDataStore()
; for database integrations, use
Components.persistentDataStore(com.launchdarkly.client.interfaces.PersistentDataStoreFactory)
.
Note that the interface is still called FeatureStoreFactory
, but in a future version
it will be renamed to DataStoreFactory
.
factory
- the factory object@Deprecated public LDConfig.Builder featureStore(FeatureStore store)
featureStoreFactory(FeatureStoreFactory)
.FeatureStore
to be used for holding feature flags and
related data received from LaunchDarkly. The default is InMemoryFeatureStore
, but
you may use RedisFeatureStore
or a custom implementation.store
- the feature store implementation@Deprecated public LDConfig.Builder featureStoreFactory(FeatureStoreFactory factory)
dataStore(FeatureStoreFactory)
.dataStore(FeatureStoreFactory)
.factory
- the factory objectpublic LDConfig.Builder events(EventProcessorFactory factory)
EventProcessor
to be used for processing analytics events.
The default is Components.sendEvents()
, but you may choose to use a custom implementation
(for instance, a test fixture), or disable events with Components.noEvents()
.
factory
- a builder/factory object for event configuration@Deprecated public LDConfig.Builder eventProcessorFactory(EventProcessorFactory factory)
events(EventProcessorFactory)
.events(EventProcessorFactory)
.factory
- the factory objectpublic LDConfig.Builder dataSource(UpdateProcessorFactory factory)
The default is Components.streamingDataSource()
. You may instead use
Components.pollingDataSource()
, or a test fixture such as
FileData.dataSource()
. See those methods
for details on how to configure them.
Note that the interface is still named UpdateProcessorFactory
, but in a future version
it will be renamed to DataSourceFactory
.
factory
- the factory object@Deprecated public LDConfig.Builder updateProcessorFactory(UpdateProcessorFactory factory)
dataSource(UpdateProcessorFactory)
.dataSource(UpdateProcessorFactory)
.factory
- the factory object@Deprecated public LDConfig.Builder stream(boolean stream)
Components.streamingDataSource()
or Components.pollingDataSource()
.By default, streaming is enabled. It should only be disabled on the advice of LaunchDarkly support.
This method has no effect if you have specified a data source with dataSource(UpdateProcessorFactory)
,
which is the preferred method.
stream
- whether streaming mode should be enabledpublic LDConfig.Builder http(HttpConfigurationFactory factory)
Components.httpConfiguration()
, which has methods
for setting individual HTTP-related properties.factory
- the factory objectComponents.httpConfiguration()
@Deprecated public LDConfig.Builder connectTimeout(int connectTimeout)
Components.httpConfiguration()
with HttpConfigurationBuilder.connectTimeoutMillis(int)
.connectTimeout
- the connection timeout in seconds@Deprecated public LDConfig.Builder socketTimeout(int socketTimeout)
Components.httpConfiguration()
with HttpConfigurationBuilder.socketTimeoutMillis(int)
.socketTimeout
- the socket timeout in seconds@Deprecated public LDConfig.Builder connectTimeoutMillis(int connectTimeoutMillis)
Components.httpConfiguration()
with HttpConfigurationBuilder.connectTimeoutMillis(int)
.connectTimeoutMillis
- the connection timeout in milliseconds@Deprecated public LDConfig.Builder socketTimeoutMillis(int socketTimeoutMillis)
Components.httpConfiguration()
with HttpConfigurationBuilder.socketTimeoutMillis(int)
.socketTimeoutMillis
- the socket timeout in milliseconds@Deprecated public LDConfig.Builder flushInterval(int flushInterval)
Components.sendEvents()
with EventProcessorBuilder.flushIntervalSeconds(int)
.flushInterval
- the flush interval in seconds@Deprecated public LDConfig.Builder capacity(int capacity)
Components.sendEvents()
with EventProcessorBuilder.capacity(int)
.capacity
- the capacity of the event buffer@Deprecated public LDConfig.Builder proxyHost(java.lang.String host)
Components.httpConfiguration()
with HttpConfigurationBuilder.proxyHostAndPort(String, int)
.proxyPort(int)
is specified, this will default to localhost
.
If neither proxyHost(String)
nor proxyPort(int)
are specified,
a proxy will not be used, and LDClient
will connect to LaunchDarkly directly.
host
- the proxy hostname@Deprecated public LDConfig.Builder proxyPort(int port)
Components.httpConfiguration()
with HttpConfigurationBuilder.proxyHostAndPort(String, int)
.port
- the proxy port@Deprecated public LDConfig.Builder proxyUsername(java.lang.String username)
Components.httpConfiguration()
with HttpConfigurationBuilder.proxyAuth(com.launchdarkly.client.interfaces.HttpAuthentication)
and Components.httpBasicAuthentication(String, String)
.username
- the proxy username@Deprecated public LDConfig.Builder proxyPassword(java.lang.String password)
Components.httpConfiguration()
with HttpConfigurationBuilder.proxyAuth(com.launchdarkly.client.interfaces.HttpAuthentication)
and Components.httpBasicAuthentication(String, String)
.password
- the proxy password@Deprecated public LDConfig.Builder sslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.X509TrustManager trustManager)
Components.httpConfiguration()
with HttpConfigurationBuilder.sslSocketFactory(SSLSocketFactory, X509TrustManager)
.sslSocketFactory
- the SSL socket factorytrustManager
- the trust manager@Deprecated public LDConfig.Builder useLdd(boolean useLdd)
Components.externalUpdatesOnly()
.
See Components.externalUpdatesOnly()
for the preferred way to do this.
useLdd
- true to use the relay in daemon mode; false to use streaming or pollingpublic LDConfig.Builder offline(boolean offline)
In offline mode, the SDK will not make network connections to LaunchDarkly for any purpose. Feature flag data will only be available if it already exists in the data store, and analytics events will not be sent.
This is equivalent to calling dataSource(Components.externalUpdatesOnly())
and
events(Components.noEvents())
. It overrides any other values you may have set for
dataSource(UpdateProcessorFactory)
or events(EventProcessorFactory)
.
offline
- when set to true no calls to LaunchDarkly will be made@Deprecated public LDConfig.Builder allAttributesPrivate(boolean allPrivate)
Components.sendEvents()
with EventProcessorBuilder.allAttributesPrivate(boolean)
.allPrivate
- true if all user attributes should be private@Deprecated public LDConfig.Builder sendEvents(boolean sendEvents)
Components.noEvents()
.sendEvents
- when set to false, no events will be sent to LaunchDarkly@Deprecated public LDConfig.Builder pollingIntervalMillis(long pollingIntervalMillis)
Components.pollingDataSource()
and PollingDataSourceBuilder.pollIntervalMillis(long)
.Values less than the default of 30000 will be set to the default.
This method has no effect if you have not disabled streaming mode, or if you have specified
a non-polling data source with dataSource(UpdateProcessorFactory)
.
pollingIntervalMillis
- rule update polling interval in millisecondspublic LDConfig.Builder startWaitMillis(long startWaitMillis)
startWaitMillis
- milliseconds to wait@Deprecated public LDConfig.Builder samplingInterval(int samplingInterval)
samplingInterval
chance events will be will be sent.
Example: if you want 5% sampling rate, set samplingInterval
to 20.
samplingInterval
- the sampling interval@Deprecated public LDConfig.Builder reconnectTimeMs(long reconnectTimeMs)
Components.streamingDataSource()
and StreamingDataSourceBuilder.initialReconnectDelayMillis(long)
.
This method has no effect if you have disabled streaming mode, or if you have specified a
non-streaming data source with dataSource(UpdateProcessorFactory)
.
reconnectTimeMs
- the reconnect time base value in milliseconds@Deprecated public LDConfig.Builder privateAttributeNames(java.lang.String... names)
Components.sendEvents()
with EventProcessorBuilder.privateAttributeNames(String...)
.names
- a set of names that will be removed from user data set to LaunchDarkly@Deprecated public LDConfig.Builder userKeysCapacity(int capacity)
Components.sendEvents()
with EventProcessorBuilder.userKeysCapacity(int)
.capacity
- the maximum number of user keys to remember@Deprecated public LDConfig.Builder userKeysFlushInterval(int flushInterval)
Components.sendEvents()
with EventProcessorBuilder.userKeysFlushIntervalSeconds(int)
.flushInterval
- the flush interval in seconds@Deprecated public LDConfig.Builder inlineUsersInEvents(boolean inlineUsersInEvents)
Components.sendEvents()
with EventProcessorBuilder.inlineUsersInEvents(boolean)
.inlineUsersInEvents
- true if you want full user details in each eventpublic LDConfig.Builder diagnosticOptOut(boolean diagnosticOptOut)
Unless diagnosticOptOut
is set to true, the client will send some diagnostics data to the
LaunchDarkly servers in order to assist in the development of future SDK improvements. These diagnostics
consist of an initial payload containing some details of SDK in use, the SDK's configuration, and the platform
the SDK is being run on; as well as payloads sent periodically with information on irregular occurrences such
as dropped events.
diagnosticOptOut
- true if you want to opt out of sending any diagnostics dataEventProcessorBuilder.diagnosticRecordingIntervalSeconds(int)
@Deprecated public LDConfig.Builder wrapperName(java.lang.String wrapperName)
Components.httpConfiguration()
with HttpConfigurationBuilder.wrapper(String, String)
.wrapperName
- an identifying name for the wrapper library@Deprecated public LDConfig.Builder wrapperVersion(java.lang.String wrapperVersion)
Components.httpConfiguration()
with HttpConfigurationBuilder.wrapper(String, String)
.wrapperVersion
- version string for the wrapper library