Class FBConfig.Builder

java.lang.Object
co.featbit.server.FBConfig.Builder
Enclosing class:
FBConfig

public static class FBConfig.Builder extends Object
Builder to create advanced configuration options, calls can be chained.

  FBConfig config = new FBConfig.Builder()
                      .streamingURL("your streaming URI")
                      .eventURL("your event URI")
                     .startWaitTime(Duration.ZERO)
                     .offline(false)
                     .build()
 
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • dataStorageFactory

      public FBConfig.Builder dataStorageFactory(DataStorageFactory dataStorageFactory)
      Sets the implementation of the data storage to be used for holding feature flags and related data received from LaunchDarkly, using a factory object. The default isFactory.inMemoryDataStorageFactory()
      Parameters:
      dataStorageFactory - a DataStorageFactory instance
      Returns:
      the builder
    • dataSynchronizerFactory

      public FBConfig.Builder dataSynchronizerFactory(DataSynchronizerFactory dataSynchronizerFactory)
      Sets the implementation of the DataSynchronizer that receives feature flag data from feature flag center, using a factory object. Depending on the implementation, the factory may be a builder that allows you to set other configuration options as well. The default isFactory.dataSynchronizerFactory()
      Parameters:
      dataSynchronizerFactory - an DataSynchronizerFactory instance
      Returns:
      the builder
    • httpConfigFactory

      public FBConfig.Builder httpConfigFactory(HttpConfigFactory httpConfigFactory)
      Sets the SDK's networking configuration, using a factory object. Depending on the implementation, the factory may be a builder that allows you to set other configuration options as well. This object by default is a configuration builder obtained from Factory.httpConfigFactory(),
      Parameters:
      httpConfigFactory - a HttpConfigFactory
      Returns:
      the builder
    • insightProcessorFactory

      public FBConfig.Builder insightProcessorFactory(InsightProcessorFactory insightProcessorFactory)
      Sets the implementation of InsightProcessor to be used for processing analytics events, using a factory object. Depending on the implementation, the factory may be a builder that allows you to set other configuration options as well. The default isFactory.insightProcessorFactory()
      Parameters:
      insightProcessorFactory - an InsightProcessorFactory
      Returns:
      the builder
    • offline

      public FBConfig.Builder offline(boolean offline)
      Set whether SDK is offline.
      Parameters:
      offline - when set to true no connection to feature flag center
      Returns:
      the builder
    • startWaitTime

      public FBConfig.Builder startWaitTime(Duration startWaitTime)
      Set how long the constructor will block awaiting a successful data sync. Setting this to a zero or negative duration will not block and cause the constructor to return immediately.
      Parameters:
      startWaitTime - maximum time to wait; null to use the default
      Returns:
      the builder
    • streamingURL

      public FBConfig.Builder streamingURL(String streamingURL)
      URL of your feature management platform to synchronise feature flags, user segments, etc.
      Parameters:
      streamingURL - streaming url
      Returns:
      the builder
    • eventURL

      public FBConfig.Builder eventURL(String eventURL)
      URL of your feature management platform to send analytics events
      Parameters:
      eventURL - event url
      Returns:
      the builder
    • build

      public FBConfig build()
      Builds the configured FBConfig
      Returns:
      a FBConfig instance