Contains all the information related to an update of the field values for an item.
More...
Contains all the information related to an update of the field values for an item.
It reports all the new values of the fields.
COMMAND LSSubscription
If the involved LSSubscription is a COMMAND LSSubscription, then the values for the current update are meant as relative to the same key.
Moreover, if the involved LSSubscription has a two-level behavior enabled, then each update may be associated with either a first-level or a second-level item. In this case, the reported fields are always the union of the first-level and second-level fields and each single update can only change either the first-level or the second-level fields (but for the "command" field, which is first-level and is always set to "UPDATE" upon a second-level update); note that the second-level field values are always nil until the first second-level update occurs). When the two-level behavior is enabled, in all methods where a field name has to be supplied, the following convention should be followed:
-
The field name can always be used, both for the first-level and the second-level fields. In case of name conflict, the first-level field is meant.
-
The field position can always be used; however, the field positions for the second-level fields start at the highest position of the first-level field list + 1. If a field schema had been specified for either first-level or second-level Subscriptions, then client-side knowledge of the first-level schema length would be required.
- (NSDictionary*) changedFields |
|
readnonatomicassign |
Values for each field changed with the last server update.
The related field name is used as key for the values in the map.
Note that if the LSSubscription mode of the involved Subscription is COMMAND, then changed fields are meant as relative to the previous update for the same key. On such tables if a DELETE command is received, all the fields, excluding the key field, will be present as changed, with nil value. All of this is also true on tables that have the two-level behavior enabled, but in case of DELETE commands second-level fields will not be iterated.
- Exceptions
-
NSException | if the LSSubscription was initialized using a field schema. |
- (NSDictionary*) changedFieldsByPositions |
|
readnonatomicassign |
Values for each field changed with the last server update.
The 1-based field position within the field schema or field list is used as key for the values in the map.
Note that if the LSSubscription mode of the involved Subscription is COMMAND, then changed fields are meant as relative to the previous update for the same key. On such tables if a DELETE command is received, all the fields, excluding the key field, will be present as changed, with nil value. All of this is also true on tables that have the two-level behavior enabled, but in case of DELETE commands second-level fields will not be iterated.
Tells whether the current update belongs to the item snapshot (which carries the current item state at the time of Subscription).
Snapshot events are sent only if snapshot information was requested for the items through LSSubscription::requestedSnapshot and precede the real time events. Snapshot informations take different forms in different subscription modes and can be spanned across zero, one or several update events. In particular:
-
if the item is subscribed to with the RAW subscription mode, then no snapshot is sent by the Server;
-
if the item is subscribed to with the MERGE subscription mode, then the snapshot consists of exactly one event, carrying the current value for all fields;
-
if the item is subscribed to with the DISTINCT subscription mode, then the snapshot consists of some of the most recent updates; these updates are as many as specified through LSSubscription::requestedSnapshot, unless fewer are available;
-
if the item is subscribed to with the COMMAND subscription mode, then the snapshot consists of an "ADD" event for each key that is currently present.
Note that, in case of two-level behavior, snapshot-related updates for both the first-level item (which is in COMMAND mode) and any second-level items (which are in MERGE mode) are qualified with this flag.
- Returns
- YES if the current update event belongs to the item snapshot; NO otherwise.