Inherits from TICDSOperation : NSOperation
Declared in TICDSWholeStoreUploadOperation.h

Overview

The TICDSWholeStoreUploadOperation class describes a generic operation used by the TICoreDataSync framework to upload the whole store for a document.

The operation carries out the following tasks:

  1. Check whether every object in the store to upload has the ticdsSyncID attribute set.
  2. If not, set any missing ticdsSyncID attributes.
  3. Check whether a directory exists for this client inside the WholeStore directory inside the document’s TemporaryFiles directory.
  4. If so, delete it.
  5. Create a directory for this client inside the WholeStore directory inside the document’s TemporaryFiles directory.
  6. Upload the whole store file to this temporary directory.
  7. Upload the applied sync change sets file that goes with this whole store to this temporary directory.
  8. Check whether a directory exists for this client inside the document’s WholeStore directory.
  9. If so, delete it.
  10. Copy the temporary directory the non-temporary location.

Operations are typically created automatically by the relevant sync manager.

You must use one of the subclasses of TICDSWholeStoreUploadOperation.

Tasks

Methods Overridden by Subclasses

Properties

Properties

backgroundApplicationContext

The managed object context to use when checking for missing ticdsSyncIDs prior to upload.

@property (nonatomic, retain) NSManagedObjectContext *backgroundApplicationContext

Declared In

TICDSWholeStoreUploadOperation.h

localAppliedSyncChangeSetsFileLocation

The location of the applied sync change sets file to upload.

@property (retain) NSURL *localAppliedSyncChangeSetsFileLocation

Declared In

TICDSWholeStoreUploadOperation.h

localWholeStoreFileLocation

The location of the whole store file to upload.

@property (retain) NSURL *localWholeStoreFileLocation

Declared In

TICDSWholeStoreUploadOperation.h

primaryPersistentStoreCoordinator

The persistent store coordinator to use when creating the background context.

@property (retain) NSPersistentStoreCoordinator *primaryPersistentStoreCoordinator

Declared In

TICDSWholeStoreUploadOperation.h

Instance Methods

checkWhetherThisClientTemporaryWholeStoreDirectoryExists

Check whether a directory exists for this client inside the WholeStore directory inside the document’s TemporaryFiles directory.

- (void)checkWhetherThisClientTemporaryWholeStoreDirectoryExists

Discussion

This method must call discoveredStatusOfTemporaryWholeStoreDirectory: to indicate the status.

Declared In

TICDSWholeStoreUploadOperation.h

checkWhetherThisClientWholeStoreDirectoryExists

Check whether a directory exists for this client inside the document’s WholeStore directory.

- (void)checkWhetherThisClientWholeStoreDirectoryExists

Discussion

This method must call discoveredStatusOfThisClientWholeStoreDirectory: to indicate the status.

Declared In

TICDSWholeStoreUploadOperation.h

configureBackgroundApplicationContextForPersistentStoreCoordinator:

Configure a background context (for applying sync changes) using the same persistent store coordinator as the main application context.

- (void)configureBackgroundApplicationContextForPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)aPersistentStoreCoordinator

Parameters

aPersistentStoreCoordinator

The persistent store coordinator to use for the background context.

Declared In

TICDSWholeStoreUploadOperation.h

copiedThisClientTemporaryWholeStoreDirectoryToThisClientWholeStoreDirectoryWithSuccess:

Indicate whether the temporary WholeStore directory was copied to the non-temporary directory location successfully.

- (void)copiedThisClientTemporaryWholeStoreDirectoryToThisClientWholeStoreDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the directory was copied, otherwise NO.

Discussion

If not, call setError: first, then specify NO for success.

Declared In

TICDSWholeStoreUploadOperation.h

copyThisClientTemporaryWholeStoreDirectoryToThisClientWholeStoreDirectory

Copy the entire directory at /Documents/documentIdentifier/TemporaryFiles/WholeStore/ to /Documents/documentIdentifier/WholeStore/.

- (void)copyThisClientTemporaryWholeStoreDirectoryToThisClientWholeStoreDirectory

Declared In

TICDSWholeStoreUploadOperation.h

createThisClientTemporaryWholeStoreDirectory

Create this client’s directory inside the WholeStore directory inside this document’s TemporaryFiles directory.

- (void)createThisClientTemporaryWholeStoreDirectory

Discussion

This method must call createdThisClientTemporaryWholeStoreDirectoryWithSuccess: to indicate whether the creation was successful.

Declared In

TICDSWholeStoreUploadOperation.h

createdThisClientTemporaryWholeStoreDirectoryWithSuccess:

Indicate whether the creation of this client’s directory inside the WholeStore directory inside the document’s TemporaryFiles directory was successful.

- (void)createdThisClientTemporaryWholeStoreDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the directory was created, otherwise NO.

Discussion

If not, call setError: first, then specify NO for success.

Declared In

TICDSWholeStoreUploadOperation.h

deleteThisClientTemporaryWholeStoreDirectory

Delete the directory for this client inside the WholeStore directory inside the document’s TemporaryFiles directory.

- (void)deleteThisClientTemporaryWholeStoreDirectory

Discussion

This method must call deletedThisClientTemporaryWholeStoreDirectoryWithSuccess: to indicate whether the deletion was successful.

Declared In

TICDSWholeStoreUploadOperation.h

deleteThisClientWholeStoreDirectory

Delete the directory for this client inside this document’s WholeStore directory.

- (void)deleteThisClientWholeStoreDirectory

Discussion

This method must call deletedThisClientWholeStoreDirectoryWithSuccess: to indicate whether the deletion was successful.

Declared In

TICDSWholeStoreUploadOperation.h

deletedThisClientTemporaryWholeStoreDirectoryWithSuccess:

Indicate whether the deletion of this client’s directory inside the WholeStore directory inside the document’s TemporaryFiles directory was successful.

- (void)deletedThisClientTemporaryWholeStoreDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the directory was deleted, otherwise NO.

Discussion

If not, call setError: first, then specify NO for success.

Declared In

TICDSWholeStoreUploadOperation.h

deletedThisClientWholeStoreDirectoryWithSuccess:

Indicate whether the deletion of this client’s directory inside the document’s WholeStore directory was successful.

- (void)deletedThisClientWholeStoreDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the directory was deleted, otherwise NO.

Discussion

If not, call setError: first, then specify NO for success.

Declared In

TICDSWholeStoreUploadOperation.h

discoveredStatusOfThisClientWholeStoreDirectory:

Indicate the status of this client’s directory inside the WholeStore directory for this document.

- (void)discoveredStatusOfThisClientWholeStoreDirectory:(TICDSRemoteFileStructureExistsResponseType)status

Parameters

status

The status of the directory: does exist, does not exist, or error (see TICDSTypesAndEnums.h for possible values).

Discussion

If an error occurred, call setError: first, then specify TICDSRemoteFileStructureExistsResponseTypeError for status.

Declared In

TICDSWholeStoreUploadOperation.h

uploadLocalAppliedSyncChangeSetsFileToThisClientTemporaryWholeStoreDirectory

Upload the file at localAppliedSyncChangeSetsFileLocation to the remote path /Documents/documentIdentifier/TemporaryFiles/WholeStore/clientIdentifier/AppliedSyncChangeSets.ticdsync.

- (void)uploadLocalAppliedSyncChangeSetsFileToThisClientTemporaryWholeStoreDirectory

Declared In

TICDSWholeStoreUploadOperation.h

uploadLocalWholeStoreFileToThisClientTemporaryWholeStoreDirectory

Upload the store at localWholeStoreFileLocation to the remote path /Documents/documentIdentifier/TemporaryFiles/WholeStore/clientIdentifier/WholeStore.ticdsync.

- (void)uploadLocalWholeStoreFileToThisClientTemporaryWholeStoreDirectory

Discussion

This method must call uploadedWholeStoreFileToThisClientTemporaryWholeStoreDirectoryWithSuccess: when finished.

Declared In

TICDSWholeStoreUploadOperation.h

uploadedAppliedSyncChangeSetsFileToThisClientTemporaryWholeStoreDirectoryWithSuccess:

Indicate whether the upload of the applied sync change sets file was successful.

- (void)uploadedAppliedSyncChangeSetsFileToThisClientTemporaryWholeStoreDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the file was uploaded, otherwise NO.

Discussion

If not, call setError: first, then specify NO for success.

Declared In

TICDSWholeStoreUploadOperation.h

uploadedWholeStoreFileToThisClientTemporaryWholeStoreDirectoryWithSuccess:

Indicate whether the upload of the whole store file was successful.

- (void)uploadedWholeStoreFileToThisClientTemporaryWholeStoreDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the file was uploaded, otherwise NO.

Discussion

If not, call setError: first, then specify NO for success.

Declared In

TICDSWholeStoreUploadOperation.h