SFSyncState Class Reference

Inherits from NSObject
Conforms to NSCopying
Declared in SFSyncState.h

  syncId

@property (nonatomic, readonly) NSInteger syncId

  name

@property (nonatomic, strong, readonly) NSString *name

  type

@property (nonatomic, readonly) SFSyncStateSyncType type

  soupName

@property (nonatomic, strong, readonly) NSString *soupName

  target

@property (nonatomic, strong, readonly) SFSyncTarget *target

  options

@property (nonatomic, strong, readonly) SFSyncOptions *options

  status

@property (nonatomic) SFSyncStateStatus status

  progress

@property (nonatomic) NSInteger progress

  totalSize

@property (nonatomic) NSInteger totalSize

  mergeMode

@property (nonatomic) SFSyncStateMergeMode mergeMode

  maxTimeStamp

@property (nonatomic) long long maxTimeStamp

  startTime

@property (nonatomic, readonly) NSInteger startTime

  endTime

@property (nonatomic, readonly) NSInteger endTime

  error

@property (nonatomic) NSString *error

+ setupSyncsSoupIfNeeded:

Setup soup that keeps track of sync operations

+ (void)setupSyncsSoupIfNeeded:(SFSmartStore *)store

Declared In

SFSyncState.h

+ cleanupSyncsSoupIfNeeded:

Cleanup syncs soup if needed At startup, no sync could be running already If a sync is in the running state, we change it to stopped

+ (void)cleanupSyncsSoupIfNeeded:(SFSmartStore *)store

Declared In

SFSyncState.h

+ newSyncDownWithOptions:target:soupName:name:store:

Factory methods

+ (nullable SFSyncState *)newSyncDownWithOptions:(SFSyncOptions *)options target:(SFSyncDownTarget *)target soupName:(NSString *)soupName name:(nullable NSString *)name store:(SFSmartStore *)store

Declared In

SFSyncState.h

+ newSyncUpWithOptions:target:soupName:name:store:

+ (nullable SFSyncState *)newSyncUpWithOptions:(SFSyncOptions *)options target:(SFSyncUpTarget *)target soupName:(NSString *)soupName name:(nullable NSString *)name store:(SFSmartStore *)store

+ newSyncUpWithOptions:soupName:store:

+ (nullable SFSyncState *)newSyncUpWithOptions:(SFSyncOptions *)options soupName:(NSString *)soupName store:(SFSmartStore *)store

+ byId:store:

Methods to save/retrieve/delete from smartstore

+ (nullable SFSyncState *)byId:(NSNumber *)syncId store:(SFSmartStore *)store

Declared In

SFSyncState.h

+ byName:store:

+ (nullable SFSyncState *)byName:(NSString *)name store:(SFSmartStore *)store

– save:

- (void)save:(SFSmartStore *)store

+ deleteById:store:

+ (void)deleteById:(NSNumber *)syncId store:(SFSmartStore *)store

+ deleteByName:store:

+ (void)deleteByName:(NSString *)name store:(SFSmartStore *)store

+ getSyncsWithStatus:status:

+ (NSArray<SFSyncState*> *)getSyncsWithStatus:(SFSmartStore *)store status:(SFSyncStateStatus)status

+ newFromDict:

Methods to translate to/from dictionary

+ (nullable SFSyncState *)newFromDict:(NSDictionary *)dict

Declared In

SFSyncState.h

– asDict

- (NSDictionary *)asDict

– isDone

Method for easy status check

- (BOOL)isDone

Declared In

SFSyncState.h

– hasFailed

- (BOOL)hasFailed

– isRunning

- (BOOL)isRunning

– isStopped

- (BOOL)isStopped

+ syncTypeFromString:

Enum to/from string helper methods

+ (SFSyncStateSyncType)syncTypeFromString:(NSString *)syncType

Declared In

SFSyncState.h

+ syncTypeToString:

+ (NSString *)syncTypeToString:(SFSyncStateSyncType)syncType

+ syncStatusFromString:

+ (SFSyncStateStatus)syncStatusFromString:(nullable NSString *)syncStatus

+ syncStatusToString:

+ (NSString *)syncStatusToString:(SFSyncStateStatus)syncStatus

+ mergeModeFromString:

+ (SFSyncStateMergeMode)mergeModeFromString:(NSString *)mergeMode

+ mergeModeToString:

+ (NSString *)mergeModeToString:(SFSyncStateMergeMode)mergeMode