Interface DataSource
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
public interface DataSource extends java.io.Closeable
Interface for an object that receives updates to feature flags, user segments, and anything else that might come from LaunchDarkly, and passes them to aDataStore
.The standard implementations are:
-
Components.streamingDataSource()
(the default), which maintains a streaming connection to LaunchDarkly; -
Components.pollingDataSource()
, which polls for updates at regular intervals; -
Components.externalUpdatesOnly()
, which does nothing (on the assumption that another process will update the data store); -
FileData
, which reads flag data from the filesystem.
- Since:
- 5.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Tells the component to shut down and release any resources it is using.boolean
isInitialized()
Returns true once the client has been initialized and will never return false again.java.util.concurrent.Future<java.lang.Void>
start()
Starts the client.
-
-
-
Method Detail
-
start
java.util.concurrent.Future<java.lang.Void> start()
Starts the client.- Returns:
Future
's completion status indicates the client has been initialized.
-
isInitialized
boolean isInitialized()
Returns true once the client has been initialized and will never return false again.- Returns:
- true if the client has been initialized
-
close
void close() throws java.io.IOException
Tells the component to shut down and release any resources it is using.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
- if there is an error while closing
-
-