Methods
(async) addClientToContextGroup(addClientToContextGroupOptions, clientIdentity) → {Promise.<void>}
Helper function for InteropBroker.joinContextGroup. Does the work of actually adding the client to the Context Group. Used by Platform Windows.
Parameters:
Name | Type | Description |
---|---|---|
addClientToContextGroupOptions |
AddClientToContextGroupOptions | Contains the contextGroupId |
clientIdentity |
ClientIdentity | Identity of the client sender. |
Returns:
- Type
- Promise.<void>
getAllClientsInContextGroup(getAllClientsInContextGroupOptions) → {Promise.<Array.<ClientIdentity>>}
Gets all clients for a context group. Used by Platform Windows.
Parameters:
Name | Type | Description |
---|---|---|
getAllClientsInContextGroupOptions |
GetAllClientsInContextGroupOptions | Contains contextGroupId, the context group you wish to get clients for. |
Returns:
- Type
- Promise.<Array.<ClientIdentity>>
getContextGroups() → {Promise.<Array.<ContextGroupInfo>>}
Returns the Interop-Broker-defined context groups available for an entity to join. Because this function is used in the rest of the Interop Broker to fetch the Context Groups, overriding this allows you to customize the Context Groups for the Interop Broker. However, we recommend customizing the context groups through configuration instead. Used by Platform Windows.
Returns:
- Type
- Promise.<Array.<ContextGroupInfo>>
getInfoForContextGroup(getInfoForContextGroupOptions) → {Promise.<ContextGroupInfo>}
Gets display info for a context group Used by Platform Windows.
Parameters:
Name | Type | Description |
---|---|---|
getInfoForContextGroupOptions |
GetInfoForContextGroupOptions | Contains contextGroupId, the context group you wish to get display info for. |
Returns:
- Type
- Promise.<ContextGroupInfo>
(async) isActionAuthorized(_action, _payload, _identity)
Called before every action to check if this entity should be allowed to take the action. Return false to prevent the action
Parameters:
Name | Type | Description |
---|---|---|
_action |
the string action to authorize in camel case |
|
_payload |
the data being sent for this action |
|
_identity |
the connection attempting to dispatch this action |
(async) isConnectionAuthorized(_id, _connectionPayload)
Can be used to completely prevent a connection. Return false to prevent connections. Allows all connections by default.
Parameters:
Name | Type | Description |
---|---|---|
_id |
the identity tryinc to connect |
|
_connectionPayload |
optional payload to use in custom implementations, will be undefined by default |
(async) joinContextGroup(joinContextGroupOptions, senderIdentity) → {Promise.<void>}
Join all connections at the given identity (or just one if endpointId provided) to context group contextGroupId
.
If no target is specified, it adds the sender to the context group.
joinContextGroup is responsible for checking connections at the incoming identity. It calls InteropBroker.addClientToContextGroup to actually group the client.
Used by Platform Windows.
Parameters:
Name | Type | Description |
---|---|---|
joinContextGroupOptions |
JoinContextGroupOptions | Id of the Context Group and identity of the entity to join to the group. |
senderIdentity |
ClientIdentity | Identity of the client sender. |
Returns:
- Type
- Promise.<void>
(async) removeClientFromContextGroup() → {Promise.<void>}
Helper function for InteropBroker.removeFromContextGroup. Does the work of actually removing the client from the Context Group. Used by Platform Windows.
Properties:
Name | Type | Description |
---|---|---|
clientIdentity |
ClientIdentity | Identity of the client sender. |
Returns:
- Type
- Promise.<void>
(async) removeFromContextGroup(removeFromContextGroupOptions, senderIdentity) → {Promise.<void>}
Removes the specified target from a context group. If no target is specified, it removes the sender from their context group. removeFromContextGroup is responsible for checking connections at the incoming identity. It calls InteropBroker.removeClientFromContextGroup to actually ungroup the client. Used by Platform Windows.
Parameters:
Name | Type | Description |
---|---|---|
removeFromContextGroupOptions |
RemoveFromContextGroupOptions | Contains the target identity to remove. |
senderIdentity |
ClientIdentity | Identity of the client sender. |
Returns:
- Type
- Promise.<void>
setContext(setContextOptions, clientIdentity) → {void}
Sets a context for the context group of the incoming current entity.
Parameters:
Name | Type | Description |
---|---|---|
setContextOptions |
SetContextOptions | New context to set. |
clientIdentity |
ClientIdentity | Identity of the client sender. |
Returns:
- Type
- void