/ fm / liveswitch / ClientStateLedger
Class: ClientStateLedger
fm.liveswitch.ClientStateLedger
Maintains a ledger of client state transitions with timestamps. Tracks and records the history of state changes for a specific client over time.
Table of contents
Constructors
Methods
Constructors
constructor
+ new ClientStateLedger(clientId
: string, externalId
: string): ClientStateLedger
Initializes a new instance of the ClientStateLedger class. Automatically records an initial "New" state.
Parameters:
Name | Type | Description |
---|---|---|
clientId |
string | The unique identifier for the client to track. |
externalId |
string | The external identifier for the client. Can be null. |
Returns: ClientStateLedger
Defined in: Generated/TypeScript/fm.liveswitch/ClientStateLedger.ts:18
Methods
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/ClientStateLedger.ts:10
recordClientState
▸ recordClientState(state
: ClientState): void
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.
Parameters:
Name | Type | Description |
---|---|---|
state |
ClientState | The new client state to record. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/ClientStateLedger.ts:52
toString
▸ toString(): string
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.
Returns: string
A JSON formatted string containing the complete state transition history and diagnostics. Returns "{}" if no states have been recorded.
Defined in: Generated/TypeScript/fm.liveswitch/ClientStateLedger.ts:74