Class DataSystemComponents
DataSystemBuilder.
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
Most factory methods return a declarative InitializerEntry
or SynchronizerEntry. Configure properties on the entry,
then pass it to ConnectionModeBuilder.initializers(com.launchdarkly.sdk.android.integrations.InitializerEntry[])
or ConnectionModeBuilder.synchronizers(com.launchdarkly.sdk.android.integrations.SynchronizerEntry[]).
Example:
LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
.mobileKey("my-key")
.dataSystem(
Components.dataSystem()
.customizeConnectionMode(ConnectionMode.STREAMING,
DataSystemComponents.customMode()
.initializers(DataSystemComponents.pollingInitializer())
.synchronizers(
DataSystemComponents.streamingSynchronizer()
.initialReconnectDelayMillis(500),
DataSystemComponents.pollingSynchronizer()
.pollIntervalMillis(300_000))))
.build();
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a builder for configuring automatic connection mode switching in response to platform events (foreground/background and network availability).static CacheInitializerEntryReturns an entry for the cache initializer used in default FDv2 pipelines.static ConnectionModeBuilderReturns a builder for configuring a custom data pipeline for a connection mode.static Map<ConnectionMode,ModeDefinition> Produces the default mode table used byDataSystemBuilder.buildModeTable(boolean).static PollingInitializerEntryReturns an entry for a polling initializer.static PollingSynchronizerEntryReturns an entry for a polling synchronizer.static StreamingSynchronizerEntryReturns an entry for a streaming synchronizer.
-
Method Details
-
pollingInitializer
Returns an entry for a polling initializer.A polling initializer makes a single poll request to obtain the initial feature flag data set.
- Returns:
- a polling initializer entry
-
cacheInitializer
Returns an entry for the cache initializer used in default FDv2 pipelines.- Returns:
- a cache initializer entry
-
pollingSynchronizer
Returns an entry for a polling synchronizer.A polling synchronizer periodically polls LaunchDarkly for feature flag updates. The poll interval can be configured via
PollingSynchronizerEntry.pollIntervalMillis(int).- Returns:
- a polling synchronizer entry
-
streamingSynchronizer
Returns an entry for a streaming synchronizer.A streaming synchronizer maintains a persistent connection to LaunchDarkly and receives real-time feature flag updates. The initial reconnect delay can be configured via
StreamingSynchronizerEntry.initialReconnectDelayMillis(int).- Returns:
- a streaming synchronizer entry
-
makeDefaultModeTable
Produces the default mode table used byDataSystemBuilder.buildModeTable(boolean). Defined here (rather than inDataSystemBuilder) because the FDv1 fallback synchronizer references package-private types that are not visible from theintegrationspackage.This method is public only for cross-package access within the SDK; it is not intended for use by application code.
-
automaticModeSwitching
Returns a builder for configuring automatic connection mode switching in response to platform events (foreground/background and network availability).Pass the result of
AutomaticModeSwitchingConfig.Builder.build()toDataSystemBuilder.automaticModeSwitching(AutomaticModeSwitchingConfig).Components.dataSystem() .automaticModeSwitching( DataSystemComponents.automaticModeSwitching() .lifecycle(false) .network(true) .build())For all-on or all-off behavior, you may use
AutomaticModeSwitchingConfig.enabled()orAutomaticModeSwitchingConfig.disabled()instead of this builder.- Returns:
- a builder for automatic mode switching (both lifecycle and network enabled by default)
- See Also:
-
customMode
Returns a builder for configuring a custom data pipeline for a connection mode.Use this to specify which initializers and synchronizers should run when the SDK is operating in a particular
ConnectionMode. Pass the result toDataSystemBuilder.customizeConnectionMode(ConnectionMode, ConnectionModeBuilder).LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled) .mobileKey("my-key") .dataSystem( Components.dataSystem() .customizeConnectionMode(ConnectionMode.BACKGROUND, DataSystemComponents.customMode() .synchronizers( DataSystemComponents.pollingSynchronizer() .pollIntervalMillis(21_600_000)))) .build();- Returns:
- a builder for configuring a custom connection mode pipeline
- See Also:
-