CREvent
This class represents an event sent between controller and responder clients
Contstructor
- CREvent(config)
-
Parameters
- config
- CRConfig object, required
- Configuration parameters and methods
Properties
- eventType
- String, default = ""
- Event type
- eventSubType
- String, default = ""
- Optional subtype, providing explanatory information not affecting event handling
- eventParams
- Array, default = []
- Array of strings or values that will be correctly converted when default JavaScript string conversion is applied
- The strings must not contain the $eventDataSplitChar ("," by default)
- buffered
- Boolean, default = false
- If true, the event will be saved if the client is offline and sent (if possible) when it becomes online
- logged
- Boolean, default = false
- If true the event will always be logged by the eventSender, even if not sent
- interceptable
- Boolean, default = true
- If true, the event can be rejected or modified by functions at eventSender and eventReceiver
- sendCt
- Number, default = NaN
- Calendar time in millisecs indicating when the event was sent by the sender client
- receiveCt
- Number, default = NaN
- Calendar time in millisecs indicating when the event was received by the target client
- senderClientId
- String, default = ""
- Id of the sender client app
- senderClientRole
- String, default = ""
- Role of the sender client, not transmitted to the target client
- senderAccessToken
- String, default = ""
- Access token of the sender client, not transmitted to the target client
- recipientClientId
- String, default = ""
- Id of the client to which the event is sent
- readyToSend
- Boolean, readOnly
- True if the event contains the required properties and credentials to be sent
Methods
- updateContent(eventType, eventSubType = "", eventParams = [])
- Updates the event with content properties transmitted to the receiver client app
Parameters
- eventType
- String, required
- Event type
- eventSubType
- String, default = ""
- Optional subtype, providing information that does not affect event handling
- eventParams
- Array, default = []
- Array of strings or values that will be correctly converted when default JavaScript string conversion is applied
- The strings must not contain the $eventDataSplitChar ("," by default)
- updateAuthInfo(senderClientId, senderClientRole, senderAccessToken)
- Updates the event with properties required for authentication
Parameters
- senderClientId
- String, required
- Identifies a client app
- senderClientRole
- String, required
- Role of the sender client, not transmitted to the target client
- senderAccessToken
- String, required
- Access token of the sender client, not transmitted to the target client
- initWithOtherCrEvent(otherEvent)
- Initiates the event with eventType, eventSubType and eventParams from another CREvent
Parameters
- otherEvent
- CREvent, required
- send()
- Sends the event if it contains the required properties and credentials to be sent
- Credentials are evaluated at the server