TWSOpenOptions Class Reference

Inherits from NSObject
Declared in TWSOpenOptions.h

Overview

Options object specifying the open mode and parameters for a Sync entity.

  sidOrUniqueName

The SID or uniqueName of the entity for the operation.

@property (readonly, nullable) NSString *sidOrUniqueName

Discussion

The SID or uniqueName of the entity for the operation.

Declared In

TWSOpenOptions.h

  strategy

The synchronization strategy for the resultant entity.

@property (readonly) TWSSynchronizationStrategy strategy

Discussion

The synchronization strategy for the resultant entity.

Declared In

TWSOpenOptions.h

  ttl

The specified time to live, default is TWSDurationInfinity.

@property (readonly) TWSDuration ttl

Discussion

The specified time to live, default is TWSDurationInfinity.

Declared In

TWSOpenOptions.h

+ createWithUniqueName:

Create a new entity with the uniqueName if provided, return an error if it exists already. If no uniqueName is specified, this operation will always succeed provided sufficient permissions.

+ (nonnull TWSOpenOptions *)createWithUniqueName:(nullable NSString *)uniqueName

Parameters

uniqueName

The optional unique name for the new entity or nil if no uniqueName is desired.

Return Value

The new TWSOpenOptions object.

Discussion

Create a new entity with the uniqueName if provided, return an error if it exists already. If no uniqueName is specified, this operation will always succeed provided sufficient permissions.

Declared In

TWSOpenOptions.h

+ withUniqueName:

Create a new or open an existing new entity with the uniqueName provided. This operation will always succeed provided sufficient permissions.

+ (nullable TWSOpenOptions *)withUniqueName:(nonnull NSString *)uniqueName

Parameters

uniqueName

The non-optional unique name to either retrieve or create if needed.

Return Value

The new TWSOpenOptions object.

Discussion

Create a new or open an existing new entity with the uniqueName provided. This operation will always succeed provided sufficient permissions.

Declared In

TWSOpenOptions.h

+ openWithSidOrUniqueName:

Open an existing new entity with the SID or uniqueName provided.

+ (nullable TWSOpenOptions *)openWithSidOrUniqueName:(nonnull NSString *)sidOrUniqueName

Parameters

sidOrUniqueName

The non-optional SID or unique name to retrieve.

Return Value

The new TWSOpenOptions object.

Discussion

Open an existing new entity with the SID or uniqueName provided.

Declared In

TWSOpenOptions.h

– synchronizationStrategy:

Optionally specifies the synchronization strategy in use for pre-fetching objects, the default is TWSSynchronizationStrategyDefault.

- (nonnull TWSOpenOptions *)synchronizationStrategy:(TWSSynchronizationStrategy)strategy

Parameters

strategy

The synchronization strategy to use, see TWSSynchronizationStrategy.

Return Value

The updated TWSOpenOptions object.

Discussion

Optionally specifies the synchronization strategy in use for pre-fetching objects, the default is TWSSynchronizationStrategyDefault.

Declared In

TWSOpenOptions.h

– ttl:

Optionally specifies the time to live for the Sync object in seconds.

- (nonnull TWSOpenOptions *)ttl:(TWSDuration)ttl

Parameters

ttl

Time to live in seconds from now or TWSDurationInfinity to indicate no expiry.

Return Value

The updated TWSOpenOptions object.

Discussion

Optionally specifies the time to live for the Sync object in seconds.

This TTL specifies the minimum time the object will live, sometime soon after this time the object will be deleted.

If time to live is not specified, object lives infinitely long.

TTL could be used in order to auto-recycle old unused objects, but it is not recommended to build some app logic like timers using ttl.

This setting works with all object types, however note that it is applicable only when creating an object. When (re)opening an existing object, new TTL is not applied, and instead an old setting is retained, in order to avoid unexpected read-only object change.

Declared In

TWSOpenOptions.h