Class DataSourceStatusProvider.Status
- java.lang.Object
-
- com.launchdarkly.sdk.server.interfaces.DataSourceStatusProvider.Status
-
- Enclosing interface:
- DataSourceStatusProvider
public static final class DataSourceStatusProvider.Status extends java.lang.Object
Information about the data source's status and about the last status change.
-
-
Constructor Summary
Constructors Constructor Description Status(DataSourceStatusProvider.State state, java.time.Instant stateSince, DataSourceStatusProvider.ErrorInfo lastError)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 ofgetState()
most recently changed.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Status
public Status(DataSourceStatusProvider.State state, java.time.Instant stateSince, DataSourceStatusProvider.ErrorInfo lastError)
Constructs a new instance.- Parameters:
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 startup
-
-
Method Detail
-
getState
public DataSourceStatusProvider.State getState()
Returns an enumerated value representing the overall current state of the data source.- Returns:
- the basic state
-
getStateSince
public java.time.Instant getStateSince()
Returns the date/time that the value ofgetState()
most recently changed.The meaning of this depends on the current state:
- For
DataSourceStatusProvider.State.INITIALIZING
, it is the time that the SDK started initializing. - For
DataSourceStatusProvider.State.VALID
, it is the time that the data source most recently entered a valid state, after previously having been eitherDataSourceStatusProvider.State.INITIALIZING
orDataSourceStatusProvider.State.INTERRUPTED
. - For
DataSourceStatusProvider.State.INTERRUPTED
, it is the time that the data source most recently entered an error state, after previously having beenDataSourceStatusProvider.State.VALID
. - For
DataSourceStatusProvider.State.OFF
, it is the time that the data source encountered an unrecoverable error or that the SDK was explicitly shut down.
- Returns:
- the timestamp of the last state change
- For
-
getLastError
public DataSourceStatusProvider.ErrorInfo getLastError()
Returns information about the last error that the data source encountered, if any.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 toDataSourceStatusProvider.State.INTERRUPTED
, and then subsequent attempts to restart the connection also fail, the state will remainDataSourceStatusProvider.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 becomesDataSourceStatusProvider.State.VALID
.- Returns:
- a description of the last error, or null if no errors have occurred since startup
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-