Class DataSourceBuildInputs

java.lang.Object
com.launchdarkly.sdk.android.subsystems.DataSourceBuildInputs

public class DataSourceBuildInputs extends Object
Build inputs (dependencies and configuration) provided to DataSourceBuilder.build(DataSourceBuildInputs) when constructing FDv2 initializers and synchronizers.

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 consolidates the parameters needed to construct data source components, providing a narrower contract than the full ClientContext.

See Also:
  • Constructor Details

    • DataSourceBuildInputs

      public DataSourceBuildInputs(LDContext evaluationContext, ServiceEndpoints serviceEndpoints, HttpConfiguration http, boolean evaluationReasons, SelectorSource selectorSource, ScheduledExecutorService sharedExecutor, @NonNull File cacheDir, LDLogger baseLogger)
      Constructs a DataSourceBuildInputs.
      Parameters:
      evaluationContext - the current evaluation context
      serviceEndpoints - the service endpoint URIs
      http - the HTTP configuration
      evaluationReasons - whether evaluation reasons are enabled
      selectorSource - the source for obtaining the current selector
      sharedExecutor - shared executor for scheduling tasks; owned and shut down by the calling data source, so components must not shut it down
      cacheDir - the platform's cache directory for HTTP-level caching
      baseLogger - the base logger instance
  • Method Details

    • getEvaluationContext

      public LDContext getEvaluationContext()
      Returns the current evaluation context.
      Returns:
      the evaluation context
    • getServiceEndpoints

      public ServiceEndpoints getServiceEndpoints()
      Returns the service endpoint URIs.
      Returns:
      the service endpoints
    • getHttp

      public HttpConfiguration getHttp()
      Returns the HTTP configuration.
      Returns:
      the HTTP configuration
    • isEvaluationReasons

      public boolean isEvaluationReasons()
      Returns whether evaluation reasons are enabled.
      Returns:
      true if evaluation reasons are enabled
    • getSelectorSource

      public SelectorSource getSelectorSource()
      Returns the selector source for obtaining the current FDv2 selector.
      Returns:
      the selector source
    • getSharedExecutor

      public ScheduledExecutorService getSharedExecutor()
      Returns the shared executor service for scheduling tasks.

      This executor is owned by the parent data source and will be shut down when the data source is closed. Components must not call shutdown() on it.

      Returns:
      the shared scheduled executor service
    • getCacheDir

      @NonNull public File getCacheDir()
      Returns the platform's cache directory for HTTP-level caching.
      Returns:
      the cache directory
    • getBaseLogger

      public LDLogger getBaseLogger()
      Returns the base logger instance.
      Returns:
      the base logger