Inherits from TICDSOperation : NSOperation
Declared in TICDSDocumentRegistrationOperation.h

Overview

The TICDSDocumentRegistrationOperation class describes a generic operation used by the TICoreDataSync framework to register a document for future synchronization.

The operation carries out the following tasks:

  1. Subclass checks whether the documentIdentifier directory exists on the remote.
    1. If not, ask the document sync manager whether to continue registering this document, and if not, bail, otherwise:
      1. Subclass creates the documentIdentifier directory on the remote, along with the general directory hierarchy.
      2. Subclass saves the documentInfo.plist file at the root of the document hierarchy, encrypting it if necessary.
      3. Continue by creating hierarchy for this client to synchronize this document.
    2. If document has been registered before, subclass checks whether this client has synchronized this document before.
      1. If so, registration is complete.
      2. If not, continue by creating client’s directories for this document.
  2. Subclass checks whether the client’s directory exists inside SyncChanges.
    1. If so, registration is complete.
    2. If not, continue by creating client’s directories for this document.
  3. Subclass creates a directory for this client in this document’s SyncChanges and SyncCommands directories.

Operations are typically created automatically by the relevant sync manager.

%warning%
Warning: You must use one of the subclasses of TICDSDocumentRegistrationOperation.

Tasks

Designated Initializer

Methods Overridden by Subclasses

Callbacks

Properties

Properties

clientDescription

The client description.

@property (copy) NSString *clientDescription

Declared In

TICDSDocumentRegistrationOperation.h

clientHasPreviouslySynchronizedThisDocument

Used to keep track of whether the document has previously been synchronized by this client.

@property (assign) BOOL clientHasPreviouslySynchronizedThisDocument

Declared In

TICDSDocumentRegistrationOperation.h

documentDescription

The document description (typically a filename).

@property (copy) NSString *documentDescription

Declared In

TICDSDocumentRegistrationOperation.h

documentIdentifier

The document identifier.

@property (copy) NSString *documentIdentifier

Declared In

TICDSDocumentRegistrationOperation.h

documentUserInfo

The user info.

@property (strong) NSDictionary *documentUserInfo

Declared In

TICDSDocumentRegistrationOperation.h

documentWasDeleted

Used to indicate whether the reason a document doesn’t exist is because it was deleted.

@property (assign) BOOL documentWasDeleted

Declared In

TICDSDocumentRegistrationOperation.h

integrityKey

The integrity key provided either by the client to check existing data matches integrity, or set during registration for new documents.

@property (copy) NSString *integrityKey

Declared In

TICDSDocumentRegistrationOperation.h

paused

Used to indicate whether the operation is currently paused awaiting input from the operation delegate, or in turn the document sync manager delegate.

@property (assign, getter=isPaused) BOOL paused

Declared In

TICDSDocumentRegistrationOperation.h

shouldCreateDocumentFileStructure

Used by the TICDSDocumentSyncManager to indicate whether to create the remote document file structure after finding out it doesn’t exist.

@property (assign) BOOL shouldCreateDocumentFileStructure

Declared In

TICDSDocumentRegistrationOperation.h

Instance Methods

addDeviceInfoPlistToDocumentDeletedClientsForClientWithIdentifier:

Copy the specified client’s deviceInfo.plist file into the DeletedClients directory for this document, but name the copied file using the client’s identifier (identifier.plist).

- (void)addDeviceInfoPlistToDocumentDeletedClientsForClientWithIdentifier:(NSString *)anIdentifier

Parameters

anIdentifier

The identifier of the client.

Discussion

This method must call `` to indicate whether the file was copied successfully.

Declared In

TICDSDocumentRegistrationOperation.h

addedDeviceInfoPlistToDocumentDeletedClientsForClientWithIdentifier:withSuccess:

Indicate whether the deviceInfo.plist file was copied as identifier.plist to the DeletedClients directory for this document.

- (void)addedDeviceInfoPlistToDocumentDeletedClientsForClientWithIdentifier:(NSString *)anIdentifier withSuccess:(BOOL)success

Parameters

success

YES if the file was copied, otherwise NO.

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

checkWhetherClientDirectoryExistsInRemoteDocumentSyncChangesDirectory

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

- (void)checkWhetherClientDirectoryExistsInRemoteDocumentSyncChangesDirectory

Discussion

This method must call discoveredStatusOfClientDirectoryInRemoteDocumentSyncChangesDirectory: to indicate the status.

Declared In

TICDSDocumentRegistrationOperation.h

checkWhetherClientWasDeletedFromRemoteDocument

Check whether this client has previously been deleted from synchronizing with this document.

- (void)checkWhetherClientWasDeletedFromRemoteDocument

Discussion

This method must call discoveredDeletionStatusOfClient: to indicate the status.

Declared In

TICDSDocumentRegistrationOperation.h

checkWhetherRemoteDocumentDirectoryExists

Check whether a remote directory exists for this document.

- (void)checkWhetherRemoteDocumentDirectoryExists

Discussion

This method must call discoveredStatusOfRemoteDocumentDirectory: to indicate the status.

Declared In

TICDSDocumentRegistrationOperation.h

checkWhetherRemoteDocumentWasDeleted

Check whether the document was previously deleted (i.e., whether an identifier.plist file exists in the DeletedDocuments directory.

- (void)checkWhetherRemoteDocumentWasDeleted

Discussion

This method must call discoveredDeletionStatusOfRemoteDocument: to indicate the status.

Declared In

TICDSDocumentRegistrationOperation.h

createClientDirectoriesInRemoteDocumentDirectories

Create directories for this client inside the SyncChanges and SyncCommands directories for this client.

- (void)createClientDirectoriesInRemoteDocumentDirectories

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

createRemoteDocumentDirectoryStructure

Create remote document directory structure.

- (void)createRemoteDocumentDirectoryStructure

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

createdClientDirectoriesInRemoteDocumentDirectoriesWithSuccess:

Indicate whether the creation of the client directories was successful.

- (void)createdClientDirectoriesInRemoteDocumentDirectoriesWithSuccess:(BOOL)success

Parameters

success

YES if the directory structure was created, otherwise NO.

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

createdRemoteDocumentDirectoryStructureWithSuccess:

Indicate whether the creation of the remote document directory structure was successful.

- (void)createdRemoteDocumentDirectoryStructureWithSuccess:(BOOL)success

Parameters

success

YES if the directory structure was created, otherwise NO.

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

deleteClientIdentifierFileFromDeletedClientsDirectory

Delete the client’s file from the document’s DeletedClients directory.

- (void)deleteClientIdentifierFileFromDeletedClientsDirectory

Discussion

This method must call blah: when finished.

Declared In

TICDSDocumentRegistrationOperation.h

deleteDocumentInfoPlistFromDeletedDocumentsDirectory

Delete the identifier.plist file for this document from the DeletedDocuments directory.

- (void)deleteDocumentInfoPlistFromDeletedDocumentsDirectory

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

deletedClientIdentifierFileFromDeletedClientsDirectoryWithSuccess:

Indicate whether the client’s file in the document’s RecentSyncs directory was deleted successfully.

- (void)deletedClientIdentifierFileFromDeletedClientsDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the identifier.plist file was deleted, otherwise NO.

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

deletedDocumentInfoPlistFromDeletedDocumentsDirectoryWithSuccess:

Indicate whether the identifier.plist file for this document was removed from the DeletedDocuments directory.

- (void)deletedDocumentInfoPlistFromDeletedDocumentsDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the identifier.plist file was deleted, otherwise NO.

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

discoveredDeletionStatusOfClient:

Indicate whether the client has been deleted from synchronizing with this document.

- (void)discoveredDeletionStatusOfClient:(TICDSRemoteFileStructureDeletionResponseType)status

Parameters

status

The deletion status: deleted, not deleted, or error (see TICDSTypesAndEnums.h for possible values).

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

discoveredDeletionStatusOfRemoteDocument:

Indicate whether the document was previously deleted.

- (void)discoveredDeletionStatusOfRemoteDocument:(TICDSRemoteFileStructureDeletionResponseType)status

Parameters

status

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

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

discoveredStatusOfClientDirectoryInRemoteDocumentSyncChangesDirectory:

Indicate the status of this client’s directory inside the remote document SyncChanges directory.

- (void)discoveredStatusOfClientDirectoryInRemoteDocumentSyncChangesDirectory:(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

TICDSDocumentRegistrationOperation.h

discoveredStatusOfRemoteDocumentDirectory:

Indicate the status of the remote document directory.

- (void)discoveredStatusOfRemoteDocumentDirectory:(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

TICDSDocumentRegistrationOperation.h

fetchListOfIdentifiersOfAllRegisteredClientsForThisApplication

Fetch a list of all clients registered to synchronize with this application.

- (void)fetchListOfIdentifiersOfAllRegisteredClientsForThisApplication

Discussion

This list is used to add identifiers to this document’s DeletedClients directory so that if those clients try to sync, they’ll realize the document has previously been deleted.

This method must call `` when finished.

Declared In

TICDSDocumentRegistrationOperation.h

fetchRemoteIntegrityKey

Fetch the integrity key for this document.

- (void)fetchRemoteIntegrityKey

Discussion

This method must call fetchedRemoteIntegrityKey: to provide the key.

Declared In

TICDSDocumentRegistrationOperation.h

fetchedListOfIdentifiersOfAllRegisteredClientsForThisApplication:

Pass back the assembled NSArray of client identifiers registered to synchronize with the application.

- (void)fetchedListOfIdentifiersOfAllRegisteredClientsForThisApplication:(NSArray *)anArray

Parameters

anArray

The array of client identifiers, or nil if an error occurred.

Discussion

If an error occurred, call setError: first, then specify nil for anArray.

Declared In

TICDSDocumentRegistrationOperation.h

fetchedRemoteIntegrityKey:

Pass back the remote integrity key for this document.

- (void)fetchedRemoteIntegrityKey:(NSString *)aKey

Parameters

aKey

The remote integrity key, or nil if an error occurred.

Discussion

If an error occurred, call setError: first, then specify nil for aKey.

Declared In

TICDSDocumentRegistrationOperation.h

initWithDelegate:

Initialize a document registration operation using a delegate that supports the TICDSDocumentRegistrationOperationDelegate protocol.

- (id)initWithDelegate:(NSObject<TICDSDocumentRegistrationOperationDelegate> *)aDelegate

Parameters

aDelegate

The delegate to use for this operation.

Return Value

An initialized document registration operation.

Declared In

TICDSDocumentRegistrationOperation.h

saveIntegrityKey:

Save a file with the integrity key as its name to this document’s IntegrityKey directory.

- (void)saveIntegrityKey:(NSString *)aKey

Parameters

aKey

The integrity key to save.

Discussion

This method must call savedIntegrityKeyWithSuccess: to indicate whether the save was successful.

Declared In

TICDSDocumentRegistrationOperation.h

saveRemoteDocumentInfoPlistFromDictionary:

Save the dictionary to a documentInfo.plist file in this document’s directory.

- (void)saveRemoteDocumentInfoPlistFromDictionary:(NSDictionary *)aDictionary

Parameters

aDictionary

The dictionary to save as the documentInfo.plist.

Discussion

This method must call savedRemoteDocumentInfoPlistWithSuccess: to indicate whether the save was successful.

Declared In

TICDSDocumentRegistrationOperation.h

savedIntegrityKeyWithSuccess:

Indicate whether the integrity key file was saved successfully.

- (void)savedIntegrityKeyWithSuccess:(BOOL)success

Parameters

success

YES if the integrity key file was saved, otherwise NO.

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h

savedRemoteDocumentInfoPlistWithSuccess:

Indicate whether the documentInfo.plist file was saved successfully.

- (void)savedRemoteDocumentInfoPlistWithSuccess:(BOOL)success

Parameters

success

YES if the documentInfo.plist file was saved, otherwise NO.

Discussion

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

Declared In

TICDSDocumentRegistrationOperation.h