public static final class DataSourceStatusProvider.Status
extends java.lang.Object
Constructor and Description |
---|
Status(DataSourceStatusProvider.State state,
java.time.Instant stateSince,
DataSourceStatusProvider.ErrorInfo lastError)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
DataSourceStatusProvider.ErrorInfo |
getLastError()
Returns information about the last error that the data source encountered, if any.
|
DataSourceStatusProvider.State |
getState()
Returns an enumerated value representing the overall current state of the data source.
|
java.time.Instant |
getStateSince()
Returns the date/time that the value of
getState() most recently changed. |
int |
hashCode() |
java.lang.String |
toString() |
public Status(DataSourceStatusProvider.State state, java.time.Instant stateSince, DataSourceStatusProvider.ErrorInfo lastError)
state
- the basic state as an enumerationstateSince
- timestamp of the last state transitionlastError
- a description of the last error, or null if no errors have occurred since startuppublic DataSourceStatusProvider.State getState()
public java.time.Instant getStateSince()
getState()
most recently changed.
The meaning of this depends on the current state:
DataSourceStatusProvider.State.INITIALIZING
, it is the time that the SDK started initializing.
DataSourceStatusProvider.State.VALID
, it is the time that the data source most recently entered a valid
state, after previously having been either DataSourceStatusProvider.State.INITIALIZING
or DataSourceStatusProvider.State.INTERRUPTED
.
DataSourceStatusProvider.State.INTERRUPTED
, it is the time that the data source most recently entered an
error state, after previously having been DataSourceStatusProvider.State.VALID
.
DataSourceStatusProvider.State.OFF
, it is the time that the data source encountered an unrecoverable error
or that the SDK was explicitly shut down.
public DataSourceStatusProvider.ErrorInfo getLastError()
This property should be updated whenever the data source encounters a problem, even if it does
not cause getState()
to change. For instance, if a stream connection fails and the
state changes to DataSourceStatusProvider.State.INTERRUPTED
, and then subsequent attempts to restart the
connection also fail, the state will remain DataSourceStatusProvider.State.INTERRUPTED
but the error information
will be updated each time-- and the last error will still be reported in this property even if
the state later becomes DataSourceStatusProvider.State.VALID
.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object