DEPRECATED: Diffusion iOS Classic API  5.9.4
 All Data Structures Files Functions Variables Enumerations Enumerator Properties Macros Pages
DFClient Class Reference

The main access to the Diffusion Client. More...

#import <DFClient.h>

Inheritance diagram for DFClient:
Collaboration diagram for DFClient:

Instance Methods

(void) - close
 Close the connection.
 
(void) - connect
 Connect to Diffusion using the pre supplied ConnectionDetails.
 
(void) - reconnect
 Reconnect to Diffusion and attempt to reestablish use of the previous session (if there is one)
 
(NSString *) - ping
 sends a ping to the connected Diffusion Server, this will result in a onPing(PingMessage) to be sent to the DFClientDelegate
 
(void) - send:message:
 send a message to the Diffusion Server for the given topic
 
(void) - sendTopicMessage:
 send a TopicMessage to Diffusion
 
(void) - subscribe:
 
(void) - unsubscribe:
 
(void) - sendCredentials:
 
(void) - addTopicListener:
 
(void) - removeTopicListener:
 
(void) - removeAllTopicListeners
 Remove all topic listeners.
 
(NSArray *) - topicListeners
 Get a read-only copy of the set of DFTopicListenerDelegate objects.
 
(void) - fetch:
 Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.
 
(BOOL) - fetch:error:
 Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.
 
(void) - fetch:withCorrelation:
 Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.
 
(BOOL) - fetch:withCorrelation:error:
 Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.
 
(void) - acknowledge:
 Send a message acknowledgement back to the server.
 
(DFServiceTopicHandler *) - createServiceTopicHandlerWithMessage:andDelegate:
 Create a new DFServiceTopicHandler.
 
(DFServiceTopicHandler *) - createServiceTopicHandlerWithMessage:andDelegate:error:
 Create a new DFServiceTopicHandler.
 
(DFPagedTopicHandler *) - createPagedTopicHandlerWithMessage:andDelegate:
 Creates a handler object for a 'paged' Topic.
 
(DFPagedTopicHandler *) - createPagedTopicHandlerWithMessage:andDelegate:error:
 Creates a handler object for a 'paged' Topic.
 
(DFTopicNotifyTopicHandler *) - createTopicNotifyTopicHandlerWithMessage:andDelegate:
 Creates a handler object for a 'Topic Notify' Topic.
 
(DFTopicNotifyTopicHandler *) - createTopicNotifyTopicHandlerWithMessage:andDelegate:error:
 Creates a handler object for a 'Topic Notify' Topic.
 

Class Methods

(NSMutableDictionary *) + sslOptions
 Dictionary of optional values used when establishing SSL/TLS encrypted connections.
 

Properties

BOOL isConnected
 YES if the client is connected to a Diffusion Server.
 
BOOL isReconnected
 YES if the client is reconnected to a Diffusion Server.
 
BOOL isDebugging
 YES if the client should output debug diagnostics while interacting with Diffusion.
 
NSString * clientID
 After the client has connected to Diffusion this contains the unique Client ID.
 
DFConnectionDetailsconnectionDetails
 The DFConnectionDetails object that this client will use to connect to Diffusion.
 
int clientProtocolVersion
 the protocol version for this client
 
NSObject< DFClientDelegate > * delegate
 Delegate object to notify when interacting with Diffusion.
 
NSTimeInterval lastInteraction
 Returns the time (in seconds since the epoch) of the last interaction (send or receive) with the server.
 

Detailed Description

The main access to the Diffusion Client.

An example would be to create a ConnectionDetails object and then call the connect method A DiffusionDelegate must be set on the ConnectionDetails object to receive any messages

Method Documentation

- (void) acknowledge: (DFTopicMessage *)  message

Send a message acknowledgement back to the server.

This will be required if autoAck is set to NO

Parameters
messagemessage to acknowledge
- (void) addTopicListener: (__weak NSObject< DFTopicListenerDelegate > *)  delegate
Parameters
delegateadd a DFTopicListenerDelegate, if the delegate topic matches the message topic, then onMessage function is called. Idiomatic of Objective C this delegate is not retained.
- (DFPagedTopicHandler*) createPagedTopicHandlerWithMessage: (DFTopicMessage *)  message
andDelegate: (__weak NSObject< DFPagedTopicDelegate > *)  delegate 

Creates a handler object for a 'paged' Topic.

Since
4.1
Parameters
messagethe load message received from the Topic.
delegatean object that is to receive all notifications from the topic. Idiomatic of Objective C, this object is not retained.
Returns
the handler which may be used to send requests to the Topic.
Exceptions
DFExceptionif the connected server implements less than protocol level 4
Deprecated:
in favor of [createPagedTopicHandlerWithMessage:andDelegate:]
- (DFPagedTopicHandler*) createPagedTopicHandlerWithMessage: (DFTopicMessage *)  message
andDelegate: (__weak NSObject< DFPagedTopicDelegate > *)  delegate
error: (NSError *__autoreleasing *)  error 

Creates a handler object for a 'paged' Topic.

Parameters
messagethe load message received from the Topic.
delegatean object that is to receive all notifications from the topic. Idiomatic of Objective C, this object is not retained.
errorpopulated in cases of error
Returns
the handler which may be used to send requests to the Topic, or nil in case of error
Since
4.6
- (DFServiceTopicHandler*) createServiceTopicHandlerWithMessage: (DFTopicMessage *)  message
andDelegate: (__weak NSObject< DFServiceTopicDelegate > *)  delegate 

Create a new DFServiceTopicHandler.

Since
4.1
Parameters
messagea service-topic-load message
delegatean object that implements the DFServiceTopicDelegate protocol. Idiomatic of Objective C, this object is not retained.
Returns
a newly created DFServiceTopicHandler or nil in case of error
Exceptions
DFExceptionif the connected server implements less than protocol level 4
Deprecated:
in favor of [createServiceTopicHandlerWithMessage:andDelegate:error]
- (DFServiceTopicHandler*) createServiceTopicHandlerWithMessage: (DFTopicMessage *)  message
andDelegate: (__weak NSObject< DFServiceTopicDelegate > *)  delegate
error: (NSError *__autoreleasing *)  error 

Create a new DFServiceTopicHandler.

Parameters
messagea service-topic-load message
delegatean object that implements the DFServiceTopicDelegate protocol. Idiomatic of Objective C, this object is not retained.
errorpopulated in cases of error
Returns
a newly created DFServiceTopicHandler or nil in case of error
Since
4.6
- (DFTopicNotifyTopicHandler*) createTopicNotifyTopicHandlerWithMessage: (DFTopicMessage *)  message
andDelegate: (__weak NSObject< DFTopicNotifyTopicDelegate > *)  delegate 

Creates a handler object for a 'Topic Notify' Topic.

Parameters
messagethe load message received from the Topic.
delegatean object that is to receive all notifications from the Topic. Idiomatic of Objective C, this object is not retained.
Returns
the handler which may be used to send requests to the Topic.
Exceptions
DFExceptionif unable to create the handler.
Since
4.5
Deprecated:
in favor of [createTopicNotifyTopicHandlerWithMessage:andDelegate:error:]
- (DFTopicNotifyTopicHandler*) createTopicNotifyTopicHandlerWithMessage: (DFTopicMessage *)  message
andDelegate: (__weak NSObject< DFTopicNotifyTopicDelegate > *)  delegate
error: (NSError *__autoreleasing *)  error 

Creates a handler object for a 'Topic Notify' Topic.

Parameters
messagethe load message received from the Topic.
delegatean object that is to receive all notifications from the Topic. Idiomatic of Objective C, this object is not retained.
errorpopulated in cases of error
Returns
the handler which may be used to send requests to the Topic, or nil in case of error.
Since
4.6
- (void) fetch: (NSString *)  topicSet

Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.

Parameters
topicSetName of the topic to fetch
Exceptions
DFExceptionif the connected server implements less than protocol level 3
Deprecated:
in favor of [fetch:error:]
- (BOOL) fetch: (NSString *)  topicSet
error: (NSError *__autoreleasing *)  error 

Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.

Parameters
topicSetName of the topic to fetch
errorset if the connected server implements less than protocol level 3
Returns
NO if the call failed
- (void) fetch: (NSString *)  topicSet
withCorrelation: (NSArray *)  headers 

Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.

Parameters
topicSetName of the topic to fetch
headersNSArray of NSString that will be relayed back from the server to aid request correlation
Exceptions
DFExceptionif the connected server implements less than protocol level 3
Deprecated:
in favor of [fetch:withCorrelation:error:]
- (BOOL) fetch: (NSString *)  topicSet
withCorrelation: (NSArray *)  headers
error: (NSError *__autoreleasing *)  error 

Issue a fetch request to the Diffusion server, for the given set of comma delimeted topic-names.

Parameters
topicSetName of the topic to fetch
headersNSArray of NSString that will be relayed back from the server to aid request correlation
errorset if the connected server implements less than protocol level 3;
Returns
NO if the call failed
- (NSString *) ping

sends a ping to the connected Diffusion Server, this will result in a onPing(PingMessage) to be sent to the DFClientDelegate

Returns
the timestamp string used
- (void) removeTopicListener: (NSObject< DFTopicListenerDelegate > *)  delegate
Parameters
delegateremove a DFTopicListenerDelegate
- (void) send: (NSString *)  topic
message: (NSString *)  message 

send a message to the Diffusion Server for the given topic

Parameters
topicthe message topic
messagethe message
- (void) sendCredentials: (DFCredentials *)  credentials
Parameters
credentialssend credentials to the server
- (void) sendTopicMessage: (DFTopicMessage *)  aTopicMessage

send a TopicMessage to Diffusion

Parameters
aTopicMessagethe TopicMessage to send
+ (NSMutableDictionary*) sslOptions

Dictionary of optional values used when establishing SSL/TLS encrypted connections.

Make the iOS device overlook self signed certificates with this, for example... [[DFClient sslOptions] setObject:[NSNumber numberWithBool:YES] forKey:(NSString*)kCFStreamSSLAllowsAnyRoot];

- (void) subscribe: (NSString *)  topicSet
Parameters
topicSetthe topicSet to subscribe to
- (void) unsubscribe: (NSString *)  topicSet
Parameters
topicSetthe topicSet to unsubscribe to

Property Documentation

- (NSTimeInterval) lastInteraction
readnonatomicassign

Returns the time (in seconds since the epoch) of the last interaction (send or receive) with the server.

Can be 0 if no interaction


The documentation for this class was generated from the following file: