public interface DataSourceStatusProvider
DataSource.
An implementation of this interface is returned by LDClientInterface.getDataSourceStatusProvider().
Application code never needs to implement this interface.
| Modifier and Type | Interface and Description |
|---|---|
static class |
DataSourceStatusProvider.ErrorInfo
A description of an error condition that the data source encountered,
|
static class |
DataSourceStatusProvider.ErrorKind
An enumeration describing the general type of an error reported in
DataSourceStatusProvider.ErrorInfo. |
static class |
DataSourceStatusProvider.State
An enumeration of possible values for
DataSourceStatusProvider.Status.getState(). |
static class |
DataSourceStatusProvider.Status
Information about the data source's status and about the last status change.
|
static interface |
DataSourceStatusProvider.StatusListener
Interface for receiving status change notifications.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStatusListener(DataSourceStatusProvider.StatusListener listener)
Subscribes for notifications of status changes.
|
DataSourceStatusProvider.Status |
getStatus()
Returns the current status of the data source.
|
void |
removeStatusListener(DataSourceStatusProvider.StatusListener listener)
Unsubscribes from notifications of status changes.
|
DataSourceStatusProvider.Status getStatus()
All of the built-in data source implementations are guaranteed to update this status whenever they successfully initialize, encounter an error, or recover after an error.
For a custom data source implementation, it is the responsibility of the data source to report its
status via DataSourceUpdates; if it does not do so, the status will always be reported as
DataSourceStatusProvider.State.INITIALIZING.
void addStatusListener(DataSourceStatusProvider.StatusListener listener)
The listener will be notified whenever any property of the status has changed. See DataSourceStatusProvider.Status for an
explanation of the meaning of each property and what could cause it to change.
Notifications will be dispatched on a worker thread. It is the listener's responsibility to return as soon as possible so as not to block subsequent notifications.
listener - the listener to addvoid removeStatusListener(DataSourceStatusProvider.StatusListener listener)
listener - the listener to remove; if no such listener was added, this does nothing