Diffusion Apple API  6.9.0
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Files Functions Variables Enumerations Enumerator Properties Pages
Instance Methods | List of all members
PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2) Category Reference

Introduction

Extension adding support to the Topic Update feature for updating topics with record values.

Since
6.3

Instance Methods

(void) - setWithPath:toRecordValue:completionHandler:
 
(void) - setWithPath:toRecordValue:constraint:completionHandler:
 
(void) - addWithPath:specification:andSetToRecordValue:completionHandler:
 
(void) - addWithPath:specification:andSetToRecordValue:constraint:completionHandler:
 
(PTDiffusionRecordV2UpdateStream *) - recordUpdateStreamWithPath:
 
(PTDiffusionRecordV2UpdateStream *) - recordUpdateStreamWithPath:constraint:
 
(PTDiffusionRecordV2UpdateStream *) - recordUpdateStreamWithPath:specification:
 
(PTDiffusionRecordV2UpdateStream *) - recordUpdateStreamWithPath:specification:constraint:
 

Method Documentation

- (void) addWithPath: (NSString *)  path
specification: (PTDiffusionTopicSpecification *)  specification
andSetToRecordValue: (PTDiffusionRecordV2 *)  value
completionHandler: (PTDiffusionTopicCreationResult *_Nullable)  result
(NSError *_Nullable error)  completionHandler 

Ensures a topic exists and sets it to a record 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:toRecordValue:completionHandler:.

Parameters
pathThe path of the topic.
valueThe value.
specificationThe required specification of the topic.
completionHandlerBlock 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.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes).
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.

- (void) addWithPath: (NSString *)  path
specification: (PTDiffusionTopicSpecification *)  specification
andSetToRecordValue: (PTDiffusionRecordV2 *)  value
constraint: (PTDiffusionUpdateConstraint *)  constraint
completionHandler: (PTDiffusionTopicCreationResult *_Nullable)  result
(NSError *_Nullable error)  completionHandler 

Ensures a topic exists and sets it to a record 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:toRecordValue:constraint:completionHandler:.

Parameters
pathThe path of the topic.
specificationThe required specification of the topic.
valueThe value.
constraintThe constraint that must be satisfied for the topic to be updated.
completionHandlerBlock 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.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes).
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.

- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: (NSString *)  path

Creates an update stream to use for updating a specific topic with record 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.

Parameters
pathThe path of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.

- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: (NSString *)  path
constraint: (PTDiffusionUpdateConstraint *)  constraint 

Creates an update stream to use for updating a specific topic with record 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.

Parameters
pathThe path of the topic.
constraintThe constraint that must be satisfied for the update stream to be validated.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.

- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: (NSString *)  path
specification: (PTDiffusionTopicSpecification *)  specification 

Creates an update stream to use for creating and updating a specific topic with record 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.

Parameters
pathThe path of the topic.
specificationThe required specification of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes).
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.

- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: (NSString *)  path
specification: (PTDiffusionTopicSpecification *)  specification
constraint: (PTDiffusionUpdateConstraint *)  constraint 

Creates an update stream to use for creating and updating a specific topic with record 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.

Parameters
pathThe path of the topic.
specificationThe required specification of the topic.
constraintThe constraint that must be satisfied for the update stream to be validated.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes).
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.

- (void) setWithPath: (NSString *)  path
toRecordValue: (PTDiffusionRecordV2 *)  value
completionHandler: (NSError *_Nullable error)  completionHandler 

Sets a topic to a specified record value.

Parameters
pathThe path of the topic.
valueThe value.
completionHandlerBlock 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.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.

- (void) setWithPath: (NSString *)  path
toRecordValue: (PTDiffusionRecordV2 *)  value
constraint: (PTDiffusionUpdateConstraint *)  constraint
completionHandler: (NSError *_Nullable error)  completionHandler 

Sets a topic to a specified record value if a constraint is satisfied.

Parameters
pathThe path of the topic.
valueThe value.
constraintThe constraint that must be satisfied for the topic to be updated.
completionHandlerBlock 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.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.3

Extends class PTDiffusionTopicUpdateFeature.