DEPRECATED: Diffusion iOS Classic API  5.9.4
 All Data Structures Files Functions Variables Enumerations Enumerator Properties Macros Pages
DFTopicNotifyTopicHandler.h
1 //
2 // DFTopicNotifyTopicHandler.h
3 // DiffusionTransport
4 //
5 // Created by Martin Cowie on 23/05/2013 - Diffusion 5.9.4_01
6 // Copyright (c) 2013 Push Technology Ltd. All rights reserved.
7 //
8 
9 #import "DFTopicListenerDelegate.h"
10 #import "DFCommon.h"
11 
12 // Fwd declarations
14 @class DFClient;
15 @class DFTopicMessage;
17 
18 /**
19  * A Topic Notify Topic Handler.
20  * <P>
21  * This is an object which is used to send commands to a 'Topic Notify' Topic.
22  * (see TopicNotifyTopicData). The handler simplifies the use of such a
23  * Topic and avoids having to format messages to send to the Topic or parse
24  * messages received from it.
25  * <P>
26  * Such a handler is created using
27  * [DFClient createTopicNotifyTopicHandlerWithMessage:level:andDelegate:]
28  * and all notifications from the Topic will be routed through the supplied
29  * delegate.
30  * <P>
31  * When such a handler is in use then messages received on the Topic will not
32  * be delivered via normal listener mechanisms but will be parsed and notified
33  * to the DFTopicNotifyTopicDelegate specified.
34  * <P>
35  * When the handler is created the Notification Level
36  * required is specified. This indicates how much detail is required when each
37  * Topic addition is notified.
38  * <P>
39  * After creating the handler you can use it to specify the range of topics
40  * that notifications are required for. This is done using the
41  * select:forTopicSet: method which may be used to add,
42  * replace, remove or clear selections.
43  *
44  */
46 
47 
48 /**
49  * This can be used to set the notification details required.
50  * <P>
51  * If this is not called then the default will be DTM_MINIMUM with no deletions or updates
52  * notified.
53  * <P>
54  * This will send a message to the server requesting a change in the
55  * notification level and therefore should ideally be called before any call
56  * to DFTopicNotifyTopicHandler::select:forTopicSet: otherwise the effect will be
57  * delayed.
58  *
59  * @param addLevel the required notification level for add notifications
60  * @param notifyRemoval YES to request notifications of topic removals
61  * @param notifyUpdate YES to request notifications of updates to those
62  * topic properties that can be changed after the topic as been created.
63  * @since 4.6
64  */
65 -(void)setNotification:(DFNotificationLevel)addLevel
66  removal:(BOOL)notifyRemoval
67  andUpdate:(BOOL)notifyUpdate;
68 
69 -(void)select:(DFSelectionMode)mode forTopicSet:(NSString*)topicSet;
70 
71 /**
72  * This can be used to get the notification level from that initially specified.
73  */
74 @property(readonly,nonatomic) DFNotificationLevel notificationLevel;
75 
76 /**
77  * Indicates whether notifying topic removals.
78  */
79 @property(readonly,nonatomic) BOOL notifiesUpdate;
80 
81 /**
82  * Indicates whether notifying topic property updates.
83  */
84 @property(readonly,nonatomic) BOOL notifiesRemoval;
85 
86 
87 /**
88  * Returns the client connection.
89  */
90 @property(weak,readonly,nonatomic) DFClient *connection;
91 
92 @end