Interface UnlaunchClientBuilder
public interface UnlaunchClientBuilder
Implementations of this interface are mutable hence not thread-safe.
- Author:
- umermansoor
-
Method Summary
Modifier and Type Method Description UnlaunchClient
build()
UnlaunchClientBuilder
connectionTimeout(long timeout, java.util.concurrent.TimeUnit unit)
Sets the default connect timeout for HTTP connections.UnlaunchClientBuilder
enableLazyLoading()
UnlaunchClientBuilder
eventsFlushInterval(long interval, java.util.concurrent.TimeUnit unit)
This controls how frequently tracking events are sent to the server.UnlaunchClientBuilder
eventsQueueSize(int maxQueueSize)
The maximum number of events to keep in memory.UnlaunchClientBuilder
host(java.lang.String host)
Unlaunch server to connect to for downloading feature flags, submitting events, etc.UnlaunchClientBuilder
metricsFlushInterval(long interval, java.util.concurrent.TimeUnit unit)
The SDK periodically sends events like metrics and diagnostics data to our servers.UnlaunchClientBuilder
metricsQueueSize(int maxQueueSize)
The maximum number of metrics (impressions) to keep in memory.UnlaunchClientBuilder
offlineMode()
This is intended for testing purposes.UnlaunchClientBuilder
offlineModeWithLocalFeatures(java.lang.String yamlFeaturesFilePath)
This is intended for testing, including unit testing.UnlaunchClientBuilder
pollingInterval(long interval, java.util.concurrent.TimeUnit unit)
This is for controlling how often the SDK download flags from the servers if the data has changed.UnlaunchClientBuilder
readTimeout(long timeout, java.util.concurrent.TimeUnit unit)
Sets the default read timeout for HTTP connections.UnlaunchClientBuilder
sdkKey(java.lang.String sdkKey)
-
Method Details
-
build
UnlaunchClient build() -
sdkKey
-
offlineMode
UnlaunchClientBuilder offlineMode()This is intended for testing purposes. Starts the client is offline mode. All flag evaluations will returncontrol
variation and no data is sent to server.For more information read this.
- Returns:
-
offlineModeWithLocalFeatures
This is intended for testing, including unit testing. This allows you to pass a YAML file containing feature flags and the variations to return when they are evaluated. You can also control dynamic configuration and specify which values to return.For more information and a template,read this
- Parameters:
yamlFeaturesFilePath
-- Returns:
-
pollingInterval
This is for controlling how often the SDK download flags from the servers if the data has changed.The default interval is 60 seconds for production, and 20 seconds for non-production environments.
- Parameters:
interval
-unit
-- Returns:
UnlaunchClientBuilder
-
connectionTimeout
Sets the default connect timeout for HTTP connections.This is the time to establish the connection with remote Unlaunch servers.
The default value is 10 seconds. The minimum value allowed is 1 second.
- Parameters:
timeout
-unit
-- Returns:
UnlaunchClientBuilder
-
readTimeout
Sets the default read timeout for HTTP connections.Specifies the time to wait for data to arrive after establishing the connection.
The default value is 10 seconds. The minimum value allowed is 1 second.
- Parameters:
timeout
-unit
-- Returns:
UnlaunchClientBuilder
-
host
Unlaunch server to connect to for downloading feature flags, submitting events, etc.Use this if you are running Unlaunch backend service on-premise or are enterprise customer. The default value is https://api.unlaunch.io
- Parameters:
host
- - Unlaunch backend service to connect to- Returns:
UnlaunchClientBuilder
-
metricsFlushInterval
The SDK periodically sends events like metrics and diagnostics data to our servers. This controls how frequently this data is sent.When the SDK is shutdown using the
UnlaunchClient.shutdown()
, all buffered data is automatically sent.The default value is 30 seconds for production and 10 seconds for non-production environments.
- Parameters:
interval
-unit
-- Returns:
UnlaunchClientBuilder
-
eventsFlushInterval
This controls how frequently tracking events are sent to the server.When the SDK is shutdown using the
UnlaunchClient.shutdown()
, all buffered data is automatically sent.The default value is 60 seconds for production and 15 seconds for non-production environments.
- Parameters:
interval
-unit
-- Returns:
UnlaunchClientBuilder
-
eventsQueueSize
The maximum number of events to keep in memory.Events are sent to the server when either the queue size or events flush interval is reached, whichever comes first.
- Parameters:
maxQueueSize
-- Returns:
UnlaunchClientBuilder
-
metricsQueueSize
The maximum number of metrics (impressions) to keep in memory.Metrics are sent to the server when either the queue size or the flush interval is reached, whichever comes first.
- Parameters:
maxQueueSize
-- Returns:
UnlaunchClientBuilder
-
enableLazyLoading
UnlaunchClientBuilder enableLazyLoading()
-