Diffusion Apple API
6.10.4
Unified Client Library for iOS, tvOS and OS X / macOS
|
Extension adding support to the Topic Update feature for updating topics with JSON values.
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToJSONValue: | (PTDiffusionJSON *) | value | |
completionHandler: | (PTDiffusionTopicCreationResult *_Nullable) | result | |
(NSError *_Nullable error) | completionHandler | ||
Ensures a topic exists and sets it to a JSON value.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of the topic. |
completionHandler | Block to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is nil or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
Extends class PTDiffusionTopicUpdateFeature.
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToJSONValue: | (PTDiffusionJSON *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (PTDiffusionTopicCreationResult *_Nullable) | result | |
(NSError *_Nullable error) | completionHandler | ||
Ensures a topic exists and sets it to a JSON value if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
completionHandler | Block to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is nil or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
Extends class PTDiffusionTopicUpdateFeature.
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path |
Creates an update stream to use for updating a specific topic with JSON values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
NSInvalidArgumentException | If path is nil . |
Extends class PTDiffusionTopicUpdateFeature.
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for updating a specific topic with JSON values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If either argument is nil . |
Extends class PTDiffusionTopicUpdateFeature.
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
Creates an update stream to use for creating and updating a specific topic with JSON values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
NSInvalidArgumentException | If any argument is nil or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
Extends class PTDiffusionTopicUpdateFeature.
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for creating and updating a specific topic with JSON values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is nil or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
Extends class PTDiffusionTopicUpdateFeature.
- (void) setWithPath: | (NSString *) | path | |
toJSONValue: | (PTDiffusionJSON *) | value | |
completionHandler: | (NSError *_Nullable error) | completionHandler | |
Sets a topic to a specified JSON value.
path | The path of the topic. |
value | The value. |
completionHandler | Block to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is nil . |
Extends class PTDiffusionTopicUpdateFeature.
- (void) setWithPath: | (NSString *) | path | |
toJSONValue: | (PTDiffusionJSON *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (NSError *_Nullable error) | completionHandler | |
Sets a topic to a specified JSON value if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
completionHandler | Block to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is nil . |
Extends class PTDiffusionTopicUpdateFeature.