Class ConnectionModeBuilder

java.lang.Object
com.launchdarkly.sdk.android.integrations.ConnectionModeBuilder

public class ConnectionModeBuilder extends Object
Configures the data pipeline (initializers and synchronizers) for a single ConnectionMode.

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

Initializers are one-shot data sources that run in order at startup to obtain an initial set of feature flag data. The SDK tries each initializer in sequence until one succeeds.

Synchronizers are long-lived data sources that keep the feature flag data up to date after initialization. The SDK uses the first synchronizer and falls back to subsequent ones if it encounters errors.

Obtain an instance from DataSystemComponents.customMode(), configure it, and pass it to DataSystemBuilder.customizeConnectionMode(ConnectionMode, ConnectionModeBuilder):


     DataSystemComponents.customMode()
         .initializers(DataSystemComponents.pollingInitializer())
         .synchronizers(
             DataSystemComponents.streamingSynchronizer(),
             DataSystemComponents.pollingSynchronizer())
 
See Also:
  • Constructor Details

    • ConnectionModeBuilder

      public ConnectionModeBuilder()
  • Method Details

    • initializers

      @SafeVarargs public final ConnectionModeBuilder initializers(@NonNull InitializerEntry... initializers)
      Sets the initializers for this connection mode.

      Initializers run in order. The SDK advances to the next initializer if one fails or returns partial data. Any previously configured initializers are replaced.

      Use factory methods in DataSystemComponents to obtain entry instances:

      
           builder.initializers(DataSystemComponents.pollingInitializer())
       
      Parameters:
      initializers - the initializer entries, in priority order
      Returns:
      this builder
    • synchronizers

      @SafeVarargs public final ConnectionModeBuilder synchronizers(@NonNull SynchronizerEntry... synchronizers)
      Sets the synchronizers for this connection mode.

      Synchronizers keep data up to date after initialization. The SDK uses the first synchronizer and falls back to subsequent ones on error. Any previously configured synchronizers are replaced.

      Use factory methods in DataSystemComponents to obtain entry instances:

      
           builder.synchronizers(
               DataSystemComponents.streamingSynchronizer(),
               DataSystemComponents.pollingSynchronizer())
       
      Parameters:
      synchronizers - the synchronizer entries, in priority order
      Returns:
      this builder
    • getInitializerEntries

      @NonNull public List<InitializerEntry> getInitializerEntries()
      Returns the configured initializer entries as an unmodifiable list.
      Returns:
      the initializer entries
    • getSynchronizerEntries

      @NonNull public List<SynchronizerEntry> getSynchronizerEntries()
      Returns the configured synchronizer entries as an unmodifiable list.
      Returns:
      the synchronizer entries