DEPRECATED: Diffusion iOS Classic API  5.9.4
 All Data Structures Files Functions Variables Enumerations Enumerator Properties Macros Pages
DFTopicMessage.h
1 /*
2  * TopicMessage.h
3  *
4  * Created by dhudson on 22/05/2009 - Diffusion 5.9.4_01
5  * Copyright (c) 2013 Push Technology Ltd. All rights reserved.
6  *
7  */
8 
9 /**
10  The class for data messages that are created for a specific topic.
11  */
12 @interface DFTopicMessage: NSObject
13 
14 @property(nonatomic, strong) NSArray *userHeaders; /**< The user headers found on this message, as an array of NSString objects */
15 @property(weak, nonatomic,readonly) NSArray *records; /**< Tokenises the message payload by &lt;RD&gt;, and returns the result as an array of NSString objects */
16 @property(nonatomic, strong) NSString *topic; /**< The topic of the message */
17 @property(weak, nonatomic, readonly) NSData *asBytes; /**< the message content */
18 @property(weak, nonatomic, readonly) NSString *asString; /**< the message content as a UTF8 string */
19 @property(nonatomic,readonly) long numberOfRecords; /**< the number of records held in this message */
20 
21 @property(weak, nonatomic, readonly) NSString *ackID; /**< the Ack ID for this message, nil if not set */
22 @property(nonatomic, assign) int ackTimeout; /**< The timeout in seconds */
23 
24 /**
25  An encoding method to use for this message.
26  Valid encoding values currently limited to DIFFUSION_MESSAGE_ENCODING_NONE_ENCODING, DIFFUSION_MESSAGE_ENCODING_ENCRYPTED_ENCODING or DIFFUSION_MESSAGE_ENCODING_COMPRESSED_ENCODING
27  */
28 @property(nonatomic, assign) int encoding;
29 
30 @property(nonatomic,readonly) BOOL needsAcknowledge DEPRECATED_ATTRIBUTE; /**< @deprecated in favor of isAckPending. */
31 @property(nonatomic,readonly) BOOL isAckPending; /**< YES if this iOS client implementation needs to acknowledge receipt, and has not yet. */
32 @property(nonatomic,readonly) BOOL isAckRequired; /**< YES, if the server needs to acknowledge receipt, once this message is transmitted */
33 @property(nonatomic,readonly) BOOL isInitialLoad; /**< YES if the message is an initialTopicLoad message */
34 @property(nonatomic,readonly) BOOL isDelta; /**< YES if the message is a delta message */
35 @property(nonatomic,readonly) BOOL isAckMessage; /**< YES if this message requires acknowlegement from the client */
36 @property(nonatomic,readonly) BOOL isServiceLoad; /**< YES if this message is a service-topic-load */
37 @property(nonatomic,readonly) BOOL isPagedLoad; /**< YES if a load message on a 'paged' Topic */
38 @property(nonatomic,readonly) BOOL isTopicNotifyLoad; /**< YES if a load message on a 'topic notify' Topic */
39 /**
40  Initialiase a TopicMessage object
41  @param topic Topic for this message
42  @param message Content of the message
43  @return A newly initialiased object ready for sending
44  */
45 -(id)initWithTopic:(NSString *)topic andData:(NSData *)message;
46 
47 /**
48  Initialiase a TopicMessage object
49  @param topic Topic for this message
50  @param message String content of the message
51  @return A newly initialiased object ready for sending
52  */
53 -(id)initWithTopic:(NSString *)topic andString:(NSString *)message;
54 
55 
56 
57 /* writable only within this package */
58 
59 
60 
61 /**
62  * getAckRequired
63  * @return YES if an Ack is required from the server once this message is transmitted.
64  * @deprecated in favor of property isAckRequired
65  */
66 -(BOOL)getAckRequired __attribute__((deprecated));
67 
68 /**
69  * Set the server-acknowledgement timeout, once this message is transmitted.
70  * @param timeout in seconds
71  * @return a newly generated AckID
72  */
73 -(NSString *)setAckRequired:(int) timeout;
74 
75 /**
76  * @return the number of records held in this message
77  * @deprecated in favor of property numberOfRecords
78  */
79 -(long)getNumberOfRecords __attribute__((deprecated));
80 
81 /**
82  Fetch the given record as an NSArray of NSData*
83  @param index
84  @return An NSArray* holding the fields
85  */
86 -(NSArray *)getFields:(int)index;
87 
88 @end