public final class DataSystemModes
extends java.lang.Object
DataSystemBuilders.
This class is not stable, and not subject to any backwards compatibility guarantees or semantic versioning. It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
This implementation is non-static to allow for easy usage with "Components". Where we can return an instance of this object, and the user can chain into their desired configuration.
| Constructor and Description |
|---|
DataSystemModes() |
| Modifier and Type | Method and Description |
|---|---|
DataSystemBuilder |
custom()
Custom returns a builder suitable for creating a custom data acquisition strategy.
|
DataSystemBuilder |
daemon(ComponentConfigurer<DataStore> persistentStore)
Configures the SDK to read from a persistent store integration that is populated by Relay Proxy
or other SDKs.
|
DataSystemBuilder |
defaultMode()
Configure's LaunchDarkly's recommended flag data acquisition strategy.
|
DataSystemBuilder |
persistentStore(ComponentConfigurer<DataStore> persistentStore)
PersistentStore is similar to Default, with the addition of a persistent store integration.
|
DataSystemBuilder |
polling()
Configure the SDK to poll data instead of receiving real-time updates via a stream.
|
DataSystemBuilder |
streaming()
Configures the SDK to stream data without polling for the initial payload.
|
public DataSystemBuilder defaultMode()
Currently, it operates a two-phase method for getting data: first, it requests data from LaunchDarkly's global CDN. Then, it initiates a streaming connection to LaunchDarkly's Flag Delivery services to receive real-time updates. If the streaming connection is interrupted for an extended period of time, the SDK will automatically fall back to polling the global CDN for updates.
Example:
LDConfig config = new LDConfig.Builder("my-sdk-key")
.dataSystem(Components.dataSystem().defaultMode());
public DataSystemBuilder streaming()
This is not our recommended strategy, which is defaultMode(), but it may be
suitable for some situations.
This configuration will not automatically fall back to polling, but it can be instructed by LaunchDarkly to fall back to polling in certain situations.
Example:
LDConfig config = new LDConfig.Builder("my-sdk-key")
.dataSystem(Components.dataSystem().streaming());
public DataSystemBuilder polling()
This is not our recommended strategy, which is defaultMode(), but it may be
required for certain network configurations.
Example:
LDConfig config = new LDConfig.Builder("my-sdk-key")
.dataSystem(Components.dataSystem().polling());
public DataSystemBuilder daemon(ComponentConfigurer<DataStore> persistentStore)
Example:
LDConfig config = new LDConfig.Builder("my-sdk-key")
.dataSystem(Components.dataSystem().daemon(persistentStore));
persistentStore - the persistent store configurerpublic DataSystemBuilder persistentStore(ComponentConfigurer<DataStore> persistentStore)
Example:
LDConfig config = new LDConfig.Builder("my-sdk-key")
.dataSystem(Components.dataSystem()
.persistentStore(Components.persistentDataStore(SomeDatabaseName.dataStore())));
persistentStore - the persistent store configurerpublic DataSystemBuilder custom()
Example:
LDConfig config = new LDConfig.Builder("my-sdk-key")
.dataSystem(Components.dataSystem().custom()
.initializers(DataSystemComponents.pollingInitializer())
.synchronizers(DataSystemComponents.streamingSynchronizer(), DataSystemComponents.pollingSynchronizer())
.fDv1FallbackSynchronizer(DataSystemComponents.fDv1Polling()));