MQTTClient
an Objective-C Framework for MQTT
Instance Methods | Properties | List of all members
<MQTTPersistence> Protocol Reference

#import <MQTTPersistence.h>

Inheritance diagram for <MQTTPersistence>:
MQTTCoreDataPersistence MQTTInMemoryPersistence

Instance Methods

(NSUInteger) - windowSize:
 
(id< MQTTFlow >) - storeMessageForClientId:topic:data:retainFlag:qos:msgId:incomingFlag:commandType:deadline:
 
(void) - deleteFlow:
 
(void) - deleteAllFlowsForClientId:
 
(NSArray *) - allFlowsforClientId:incomingFlag:
 
(id< MQTTFlow >) - flowforClientId:incomingFlag:messageId:
 
(void) - sync
 

Properties

NSUInteger maxWindowSize
 
NSUInteger maxMessages
 
BOOL persistent
 
NSUInteger maxSize
 

Detailed Description

The MQTTPersistence protocol is an abstraction of persistence classes for MQTTSession

Method Documentation

◆ allFlowsforClientId:incomingFlag:()

- (NSArray *) allFlowsforClientId: (NSString *)  clientId
incomingFlag: (BOOL)  incomingFlag 

Retrieves all MQTTFlow elements of a clientId and direction

Parameters
clientIdwhos MQTTFlows should be retrieved
incomingFlagspecifies the wether incoming or outgoing flows should be retrieved
Returns
an NSArray of the retrieved MQTTFlow elements

◆ deleteAllFlowsForClientId:()

- (void) deleteAllFlowsForClientId: (NSString *)  clientId

Deletes all MQTTFlow elements of a clientId

Parameters
clientIdthe client Id identifying all MQTTFlows to be deleted

◆ deleteFlow:()

- (void) deleteFlow: (id< MQTTFlow >)  flow

Deletes an MQTTFlow element

Parameters
flowthe MQTTFlow to delete

◆ flowforClientId:incomingFlag:messageId:()

- (id<MQTTFlow>) flowforClientId: (NSString *)  clientId
incomingFlag: (BOOL)  incomingFlag
messageId: (UInt16)  messageId 

Retrieves an MQTTFlow element

Parameters
clientIdto which the MQTTFlow belongs to
incomingFlagspecifies the direction of the flow
messageIdspecifies the message Id of the flow
Returns
the retrieved MQTTFlow element or nil if the elememt was not found

◆ storeMessageForClientId:topic:data:retainFlag:qos:msgId:incomingFlag:commandType:deadline:()

- (id<MQTTFlow>) storeMessageForClientId: (NSString *)  clientId
topic: (NSString *)  topic
data: (NSData *)  data
retainFlag: (BOOL)  retainFlag
qos: (MQTTQosLevel)  qos
msgId: (UInt16)  msgId
incomingFlag: (BOOL)  incomingFlag
commandType: (UInt8)  commandType
deadline: (NSDate *)  deadline 

Stores one new message

Parameters
clientIdidentifying the session
topicthe topic of the message
datathe message's data
retainFlagthe retain flag of the message
qosthe quality of service of the message
msgIdthe id of the message or zero for qos zero
incomingFlagthe direction of the message
commandTypethe command of the message
deadlinethe deadline of the message for repetitions
Returns
the created MQTTFlow element or nil if the maxWindowSize has been exceeded

◆ sync()

- (void) sync

sync is called to allow the MQTTPersistence implemetation to save data permanently

◆ windowSize:()

- (NSUInteger) windowSize: (NSString *)  clientId

The current Window Size for outgoing inflight messages per clientID.

Parameters
clientIdidentifying the session
Returns
the current size of the outgoing inflight window

Property Documentation

◆ maxMessages

- (NSUInteger) maxMessages
readwritenonatomicassign

The maximum number of messages kept per clientID and direction. Defaults to 1024

◆ maxSize

- (NSUInteger) maxSize
readwritenonatomicassign

The maximum size of the storage used for persistence in total in bytes. Defaults to 1024*1024 bytes

◆ maxWindowSize

- (NSUInteger) maxWindowSize
readwritenonatomicassign

The maximum Window Size for outgoing inflight messages per clientID. Defaults to 16

◆ persistent

- (BOOL) persistent
readwritenonatomicassign

Indicates if the persistence implementation should make the information permannent. Defaults to NO


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