Maintains a ledger of client state transitions with timestamps. More...
Public Member Functions | |
| ClientStateLedger (String clientId, String externalId) | |
| Initializes a new instance of the ClientStateLedger class. More... | |
| void | recordClientState (fm.liveswitch.ClientState state) |
| Records a new client state transition with the current timestamp. More... | |
| String | toString () |
| Provides a JSON string representation of all recorded state transitions. More... | |
Maintains a ledger of client state transitions with timestamps.
Tracks and records the history of state changes for a specific client over time.
| fm.liveswitch.ClientStateLedger.ClientStateLedger | ( | String | clientId, |
| String | externalId | ||
| ) |
Initializes a new instance of the ClientStateLedger class.
Automatically records an initial "New" state.
| clientId | The unique identifier for the client to track. |
| externalId | The external identifier for the client. Can be null. |
| void fm.liveswitch.ClientStateLedger.recordClientState | ( | fm.liveswitch.ClientState | state | ) |
Records a new client state transition with the current timestamp.
Adds a new record to the state history with both UTC time and millisecond precision timestamp.
| state | The new client state to record. |
| String fm.liveswitch.ClientStateLedger.toString | ( | ) |
Provides a JSON string representation of all recorded state transitions.
Includes client identification, state transition history with timestamps and elapsed times, and diagnostic information if the client never reached the registered state.