Constructor
new DataUpdateManager()
Methods
addUpdateAction(updateId, action, groupIdopt)
Adds an update action for the specified Update and/or Group id. At least one of the id's must be provided.
Parameters:
| Name |
Type |
Attributes |
Description |
updateId |
string
|
|
The identifier of the update event. |
action |
function
|
|
The action to call when the update event fires. |
groupId |
string
|
<optional>
|
The group to which the update belongs. |
clearSubscriptions()
Removes all client subscriptions.
getSubscription(updateId, client, groupIdopt) → {Subscription|null}
Returns the client subscription for the specified update event.
Parameters:
| Name |
Type |
Attributes |
Description |
updateId |
string
|
|
The identifier of the update event. |
client |
componyx.bindary.Client
|
|
The client. |
groupId |
string
|
<optional>
|
The group to which the update belongs. |
Returns:
The subscription for the specified update event and client.
-
Type
-
Subscription
|
null
hasSubscription(updateId, client, groupIdopt) → {boolean}
Checks if the client is subscribed to the specified update event.
Parameters:
| Name |
Type |
Attributes |
Description |
updateId |
string
|
|
The identifier of the update event. |
client |
componyx.bindary.Client
|
|
The client. |
groupId |
string
|
<optional>
|
The group to which the update belongs. |
Returns:
A boolean value indicating if the client is subscribed to the specified update event.
-
Type
-
boolean
subscribe(updateId, client, groupIdopt, argsopt)
Subscribes a client for an update event.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
updateId |
string
|
|
|
The identifier of the update event. |
client |
componyx.bindary.Client
|
|
|
The client. |
groupId |
string
|
<optional>
|
|
The group to which the update belongs. |
args |
object
|
null
|
<optional>
|
null
|
Arguments to bind to the subscription. |
subscriptions(updateId, groupIdopt) → {Array.<Subscription>}
Returns the subscribed clients for the specified update event.
Parameters:
| Name |
Type |
Attributes |
Description |
updateId |
string
|
|
The identifier of the update event. |
groupId |
string
|
<optional>
|
The group to which the update belongs. |
Returns:
-
Type
-
Array.<Subscription>
unsubscribe(updateId, groupIdopt, startsWithSearchopt)
Removes all client subscriptions for the specified update event.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
updateId |
string
|
|
|
The identifier of the update event. |
groupId |
string
|
<optional>
|
|
The group to which the update belongs. |
startsWithSearch |
boolean
|
<optional>
|
true
|
A value indicating if subscriptions which start with the
specified update identifier are removed. |
unsubscribeClient(client, groupIdopt)
Removes all subscriptions of the specified client.
Parameters:
| Name |
Type |
Attributes |
Description |
client |
componyx.bindary.Client
|
|
The client. |
groupId |
string
|
<optional>
|
The group for which the client subscriptions must be removed. |
unsubscribeClientFromEvent(updateId, client, groupIdopt, startsWithSearchopt)
Removes the client subscription for the specified update event.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
updateId |
string
|
|
|
The identifier of the update event. |
client |
componyx.bindary.Client
|
|
|
The client. |
groupId |
string
|
<optional>
|
|
The group to which the update belongs. |
startsWithSearch |
boolean
|
<optional>
|
true
|
A value indicating if subscriptions of the specified client
which start with the specified update identifier are removed. |
(async) update(updateId, groupIdopt, argsopt)
Invokes the specified update event actions for all subscribers.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
updateId |
string
|
|
|
The identifier of the update event. |
groupId |
string
|
<optional>
|
|
The group to which the update belongs. |
args |
object
|
null
|
<optional>
|
null
|
An object to pass as second argument to the action method. |
(async) updateClient(client, groupIdopt, argsopt)
Calls all update event actions for the specified subscriber.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
client |
componyx.bindary.Client
|
|
|
The client. |
groupId |
string
|
<optional>
|
|
The group to which the update belongs. |
args |
object
|
null
|
<optional>
|
null
|
An object to pass as second argument to the action method. |
(async) updateClientEvent(updateId, client, groupIdopt, argsopt)
Invokes the specified update event for the specified subscriber.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
updateId |
string
|
|
|
The identifier of the update event. |
client |
componyx.bindary.Client
|
|
|
The client. |
groupId |
string
|
<optional>
|
|
The group to which the update belongs. |
args |
object
|
null
|
<optional>
|
null
|
An object to pass as second argument to the action method. |
(async) updateGroup(groupIdopt, argsopt)
Invokes all update event actions for all subscribers.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
groupId |
string
|
<optional>
|
|
The group to which the update belongs. |
args |
object
|
null
|
<optional>
|
null
|
An object to pass as second argument to the action method. |