DEPRECATED: Diffusion iOS Classic API  5.9.4
 All Data Structures Files Functions Variables Enumerations Enumerator Properties Macros Pages
DFClientDelegate.h
1 /*
2  * DFClientDelegate.h
3  *
4  * Created by Darren Hudson on 24/05/2009 - Diffusion 5.9.4_01
5  * Copyright © 2009, 2015 Push Technology Ltd. All rights reserved.
6  *
7  * This is the protocol definition for the DFClient delegate
8  */
9 #import "DFPingMessage.h"
10 #import "DFTopicMessage.h"
11 #import "DFServerDetails.h"
12 
13 /**
14  Protocol implemented by classes wishing to receive notification from Diffusion.
15  Notification primarily of new messages and the state of the connection to the server.
16  */
18 
19 /**
20  * This method will be called when the DFClient trys to connect, if the connection is made then isConnected will be YES.
21  * It will not be called with a value NO for isConnected if onConnectionFailedWithError: has been implemented.
22  * @param isConnected
23  */
24 - (void) onConnection:(BOOL) isConnected;
25 
26 /**
27  * This method will be called when a message has been received from the Diffusion Server.
28  * This method will be called as well as any TopicListeners that might match the topic.
29  */
30 - (void) onMessage:(DFTopicMessage *) message;
31 
32 /**
33  * This method will be called on receipt of the ping request
34  * @see DFClient
35  * @param message PingMessage
36  */
37 - (void) onPing:(DFPingMessage *) message;
38 
39 /**
40  * This method will be called if the server didn't respond to an Ack Message in time
41  * @see TopicMessage
42  */
43 - (void) onMessageNotAcknowledged:(DFTopicMessage *) message;
44 
45 /**
46  The list of DFServerDetails object has been exhausted, and no connection can be placed.
47  Once this method is called the set of DFServerDetails is reset and further connections can be placed. In most simple scenarios where
48  there is only one DFServerDetails object in the DFConnectionDetails object it should suffice to call method [client connect] here.
49  @param client DFClient that has exhausted its set of DFServerDetails object from the DFClientDetails object.
50  */
51 -(void)onConnectionSequenceExhausted:(DFClient*)client;
52 
53 @optional
54 
55 /**
56  * This method will be called, if implemented, for all failed connections.
57  * In which case the following messages will no longer be sent:
58  * - onConnection:NO
59  * - onLostConnection
60  * - onAbort
61  * - onServerRejectedConnection
62  */
63 -(void) onConnectionFailedWithError:(NSError *)error;
64 
65 /**
66  * This method will be called when the DFClient has lost connection to the Diffusion Server.
67  * It will not be called if onConnectionFailedWithError: has been implemented.
68  */
69 - (void) onLostConnection;
70 
71 /**
72  * This method will be called when the Diffusion Server has terminated the connection (barred).
73  * It will not be called if onConnectionFailedWithError: has been implemented.
74  */
75 - (void) onAbort;
76 
77 /**
78  * This method will be called after a send credentials message, and the server rejected the credentials.
79  * It will not be called if onConnectionFailedWithError: has been implemented.
80  * @see DFClient
81  */
83 
84 /**
85  Conveys news from the Diffusion server that the named topic no longer exists
86  */
87 -(void)onTopicRemoved:(NSString*) topicName;
88 
89 /**
90  The given DFServerDetails object has been selected for connection.
91  @param details Details object that has been chosen.
92  @param client DFClient that has chosen this DFServerDetails
93  */
94 -(void)onConnectionDetailsAcquired:(DFServerDetails*)details forClient:(DFClient*)client;
95 
96 @end