Avaya Client Services API Reference (iOS)
|
This class defines an interface that client applications use to perform data retrieval operations for both static and dynamic collections of objects within the SDK. More...
#import <CSDataRetrievalWatcher.h>
Inherits NSObject.
Instance Methods | |
(void) | - addDelegate: |
Adds a delegate to be notified of progress in retrieving a data collection. More... | |
(void) | - removeDelegate: |
Removes a delegate from the watcher object. More... | |
(void) | - cancel |
Cancels the current data retrieval operation if one is in progress. More... | |
Properties | |
NSUInteger | requestId |
The unique request ID associated with this data retrieval. More... | |
BOOL | cancelled |
Has the data retrieval operation been cancelled? More... | |
BOOL | completed |
Has the data retrieval completed? More... | |
NSArray * | snapshot |
Returns a snapshot of the objects currently in the collection being watched by this object. More... | |
This class defines an interface that client applications use to perform data retrieval operations for both static and dynamic collections of objects within the SDK.
An instance of this watcher class is created by the client application for use in methods that initiate some form of data retrieval operation that runs asynchronously and updates a collection of objects. It can be used in cases where a static collection of objects is being retrieved (e.g. search results, etc) or for dynamically updated collections that are retrieved and then subsequently updated as events occur within the system (e.g. the active participants in a conference call).
Following creation of a CSDataRetrievalWatcher object, and before the object is used in a method call, the application should install a CSDataRetrievalWatcherDelegate on the object. This allows the application's delegate to be wired up prior to initiating the action that will perform the data retrieval.
For static collections, the dataRetrievalWatcher:contentsDidChange:changedItems message will be sent as objects are added to the collection during the retrieval. Once the static collection has been completely retrieved, the dataRetrievalWatcherDidComplete message will be sent indicating that the retrieval is complete. Following this, no additional messages will be sent.
For dynamic collections, the dataRetrievalWatcher:contentsDidChange:changedItems message will be sent as objects are added to the collection during the initial retrieval. It will also be sent whenever any of the objects already in the collection are changed or removed. Once the initial retrieval of the dynamic collection has been completed, the dataRetrievalWatcherDidComplete message will be sent indicating that the initial retrieval is complete. Following this, the dataRetrievalWatcher:contentsDidChange:changedItems message will be sent whenever any changes to the collection occur.
- (void) addDelegate: | (id< CSDataRetrievalWatcherDelegate >) | delegate |
Adds a delegate to be notified of progress in retrieving a data collection.
delegate | The delegate to be added. |
- (void) cancel |
Cancels the current data retrieval operation if one is in progress.
After this, the cancellation will be reported asynchronously to listeners.
- (void) removeDelegate: | (id< CSDataRetrievalWatcherDelegate >) | delegate |
Removes a delegate from the watcher object.
delegate | The delegate to be removed. |
|
readnonatomicassign |
Has the data retrieval operation been cancelled?
YES
if the data retrieval was cancelled, NO
otherwise.
|
readnonatomicassign |
Has the data retrieval completed?
When data retrieval has been completed, the snapshot property will contain the complete data collection.
If this watcher object is watching a dynamic collection, additional dataRetrievalWatcher:contentsDidChange:changedItems messages may be received via the installed delegates as the collection is changed following the retrieval.
YES
if the data retrieval has been completed, NO
otherwise.
|
readnonatomicassign |
The unique request ID associated with this data retrieval.
If the request has not been initiated or is not outstanding, the value will be 0.
|
readnonatomiccopy |
Returns a snapshot of the objects currently in the collection being watched by this object.
Note that the returned array is a snapshot in time and is not dynamically updated as the collection changes. Notifications that the collection has changed are received through the installed delegates via the dataRetrievalWatcher:contentsDidChange:changedItems message.