TICDSDocumentRegistrationOperation Class Reference
| 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:
- Subclass checks whether the
documentIdentifierdirectory exists on the remote.- If not, ask the document sync manager whether to continue registering this document, and if not, bail, otherwise:
- Subclass creates the
documentIdentifierdirectory on the remote, along with the general directory hierarchy. - Subclass saves the
documentInfo.plistfile at the root of the document hierarchy, encrypting it if necessary. - Continue by creating hierarchy for this client to synchronize this document.
- Subclass creates the
- If document has been registered before, subclass checks whether this client has synchronized this document before.
- If so, registration is complete.
- If not, continue by creating client’s directories for this document.
- If not, ask the document sync manager whether to continue registering this document, and if not, bail, otherwise:
- Subclass checks whether the client’s directory exists inside
SyncChanges.- If so, registration is complete.
- If not, continue by creating client’s directories for this document.
- Subclass creates a directory for this client in this document’s
SyncChangesandSyncCommandsdirectories.
Operations are typically created automatically by the relevant sync manager.
You must use one of the subclasses of TICDSDocumentRegistrationOperation.
Tasks
Designated Initializer
-
– initWithDelegate:Initialize a document registration operation using a delegate that supports the
TICDSDocumentRegistrationOperationDelegateprotocol.
Methods Overridden by Subclasses
-
– checkWhetherRemoteDocumentDirectoryExistsCheck whether a remote directory exists for this document.
-
– checkWhetherRemoteDocumentWasDeletedCheck whether the document was previously deleted (i.e., whether an
identifier.plistfile exists in theDeletedDocumentsdirectory. -
– createRemoteDocumentDirectoryStructureCreate remote document directory structure.
-
– saveRemoteDocumentInfoPlistFromDictionary:Save the dictionary to a
documentInfo.plistfile in this document’s directory. -
– saveIntegrityKey:Save a file with the integrity key as its name to this document’s
IntegrityKeydirectory. -
– fetchListOfIdentifiersOfAllRegisteredClientsForThisApplicationFetch a list of all clients registered to synchronize with this application.
-
– addDeviceInfoPlistToDocumentDeletedClientsForClientWithIdentifier:Copy the specified client’s
deviceInfo.plistfile into theDeletedClientsdirectory for this document, but name the copied file using the client’s identifier (identifier.plist). -
– deleteDocumentInfoPlistFromDeletedDocumentsDirectoryDelete the
identifier.plistfile for this document from theDeletedDocumentsdirectory. -
– checkWhetherClientDirectoryExistsInRemoteDocumentSyncChangesDirectoryCheck whether a directory exists for this client inside the document’s
SyncChangesdirectory. -
– fetchRemoteIntegrityKeyFetch the integrity key for this document.
-
– checkWhetherClientWasDeletedFromRemoteDocumentCheck whether this client has previously been deleted from synchronizing with this document.
-
– deleteClientIdentifierFileFromDeletedClientsDirectoryDelete the client’s file from the document’s
DeletedClientsdirectory. -
– createClientDirectoriesInRemoteDocumentDirectoriesCreate directories for this client inside the
SyncChangesandSyncCommandsdirectories for this client.
Callbacks
-
– discoveredStatusOfRemoteDocumentDirectory:Indicate the status of the remote document directory.
-
– discoveredDeletionStatusOfRemoteDocument:Indicate whether the document was previously deleted.
-
– createdRemoteDocumentDirectoryStructureWithSuccess:Indicate whether the creation of the remote document directory structure was successful.
-
– savedRemoteDocumentInfoPlistWithSuccess:Indicate whether the
documentInfo.plistfile was saved successfully. -
– savedIntegrityKeyWithSuccess:Indicate whether the integrity key file was saved successfully.
-
– fetchedListOfIdentifiersOfAllRegisteredClientsForThisApplication:Pass back the assembled
NSArrayof client identifiers registered to synchronize with the application. -
– addedDeviceInfoPlistToDocumentDeletedClientsForClientWithIdentifier:withSuccess:Indicate whether the
deviceInfo.plistfile was copied asidentifier.plistto theDeletedClientsdirectory for this document. -
– deletedDocumentInfoPlistFromDeletedDocumentsDirectoryWithSuccess:Indicate whether the
identifier.plistfile for this document was removed from theDeletedDocumentsdirectory. -
– discoveredStatusOfClientDirectoryInRemoteDocumentSyncChangesDirectory:Indicate the status of this client’s directory inside the remote document
SyncChangesdirectory. -
– fetchedRemoteIntegrityKey:Pass back the remote integrity key for this document.
-
– discoveredDeletionStatusOfClient:Indicate whether the client has been deleted from synchronizing with this document.
-
– deletedClientIdentifierFileFromDeletedClientsDirectoryWithSuccess:Indicate whether the client’s file in the document’s
RecentSyncsdirectory was deleted successfully. -
– createdClientDirectoriesInRemoteDocumentDirectoriesWithSuccess:Indicate whether the creation of the client directories was successful.
Properties
-
pausedUsed to indicate whether the operation is currently paused awaiting input from the operation delegate, or in turn the document sync manager delegate.
property -
documentWasDeletedUsed to indicate whether the reason a document doesn’t exist is because it was deleted.
property -
shouldCreateDocumentFileStructureUsed by the
propertyTICDSDocumentSyncManagerto indicate whether to create the remote document file structure after finding out it doesn’t exist. -
clientHasPreviouslySynchronizedThisDocumentUsed to keep track of whether the document has previously been synchronized by this client.
property -
documentIdentifierThe document identifier.
property -
documentDescriptionThe document description (typically a filename).
property -
clientDescriptionThe client description.
property -
documentUserInfoThe user info.
property -
integrityKeyThe integrity key provided either by the client to check existing data matches integrity, or set during registration for new documents.
property
Properties
clientDescription
The client description.
@property (retain) NSString *clientDescriptionDeclared In
TICDSDocumentRegistrationOperation.hclientHasPreviouslySynchronizedThisDocument
Used to keep track of whether the document has previously been synchronized by this client.
@property (assign) BOOL clientHasPreviouslySynchronizedThisDocumentDeclared In
TICDSDocumentRegistrationOperation.hdocumentDescription
The document description (typically a filename).
@property (retain) NSString *documentDescriptionDeclared In
TICDSDocumentRegistrationOperation.hdocumentIdentifier
The document identifier.
@property (retain) NSString *documentIdentifierDeclared In
TICDSDocumentRegistrationOperation.hdocumentUserInfo
The user info.
@property (retain) NSDictionary *documentUserInfoDeclared In
TICDSDocumentRegistrationOperation.hdocumentWasDeleted
Used to indicate whether the reason a document doesn’t exist is because it was deleted.
@property (assign) BOOL documentWasDeletedDeclared In
TICDSDocumentRegistrationOperation.hintegrityKey
The integrity key provided either by the client to check existing data matches integrity, or set during registration for new documents.
@property (retain) NSString *integrityKeyDeclared In
TICDSDocumentRegistrationOperation.hpaused
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 pausedDeclared In
TICDSDocumentRegistrationOperation.hshouldCreateDocumentFileStructure
Used by the TICDSDocumentSyncManager to indicate whether to create the remote document file structure after finding out it doesn’t exist.
@property (assign) BOOL shouldCreateDocumentFileStructureDeclared In
TICDSDocumentRegistrationOperation.hInstance 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 *)anIdentifierParameters
- anIdentifier
The identifier of the client.
Discussion
This method must call `` to indicate whether the file was copied successfully.
Declared In
TICDSDocumentRegistrationOperation.haddedDeviceInfoPlistToDocumentDeletedClientsForClientWithIdentifier: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)successParameters
- success
YESif the file was copied, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSDocumentRegistrationOperation.hcheckWhetherClientDirectoryExistsInRemoteDocumentSyncChangesDirectory
Check whether a directory exists for this client inside the document’s SyncChanges directory.
- (void)checkWhetherClientDirectoryExistsInRemoteDocumentSyncChangesDirectoryDiscussion
This method must call discoveredStatusOfClientDirectoryInRemoteDocumentSyncChangesDirectory: to indicate the status.
Declared In
TICDSDocumentRegistrationOperation.hcheckWhetherClientWasDeletedFromRemoteDocument
Check whether this client has previously been deleted from synchronizing with this document.
- (void)checkWhetherClientWasDeletedFromRemoteDocumentDiscussion
This method must call discoveredDeletionStatusOfClient: to indicate the status.
Declared In
TICDSDocumentRegistrationOperation.hcheckWhetherRemoteDocumentDirectoryExists
Check whether a remote directory exists for this document.
- (void)checkWhetherRemoteDocumentDirectoryExistsDiscussion
This method must call discoveredStatusOfRemoteDocumentDirectory: to indicate the status.
Declared In
TICDSDocumentRegistrationOperation.hcheckWhetherRemoteDocumentWasDeleted
Check whether the document was previously deleted (i.e., whether an identifier.plist file exists in the DeletedDocuments directory.
- (void)checkWhetherRemoteDocumentWasDeletedDiscussion
This method must call discoveredDeletionStatusOfRemoteDocument: to indicate the status.
Declared In
TICDSDocumentRegistrationOperation.hcreateClientDirectoriesInRemoteDocumentDirectories
Create directories for this client inside the SyncChanges and SyncCommands directories for this client.
- (void)createClientDirectoriesInRemoteDocumentDirectoriesDiscussion
This method must call createdClientDirectoriesInRemoteDocumentDirectoriesWithSuccess: to indicate whether the creation was successful.
Declared In
TICDSDocumentRegistrationOperation.hcreateRemoteDocumentDirectoryStructure
Create remote document directory structure.
- (void)createRemoteDocumentDirectoryStructureDiscussion
This method must call createdRemoteDocumentDirectoryStructureWithSuccess: to indicate whether the creation was successful.
Declared In
TICDSDocumentRegistrationOperation.hcreatedClientDirectoriesInRemoteDocumentDirectoriesWithSuccess:
Indicate whether the creation of the client directories was successful.
- (void)createdClientDirectoriesInRemoteDocumentDirectoriesWithSuccess:(BOOL)successParameters
- success
YESif the directory structure was created, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSDocumentRegistrationOperation.hcreatedRemoteDocumentDirectoryStructureWithSuccess:
Indicate whether the creation of the remote document directory structure was successful.
- (void)createdRemoteDocumentDirectoryStructureWithSuccess:(BOOL)successParameters
- success
YESif the directory structure was created, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSDocumentRegistrationOperation.hdeleteClientIdentifierFileFromDeletedClientsDirectory
Delete the client’s file from the document’s DeletedClients directory.
- (void)deleteClientIdentifierFileFromDeletedClientsDirectoryDiscussion
This method must call blah: when finished.
Declared In
TICDSDocumentRegistrationOperation.hdeleteDocumentInfoPlistFromDeletedDocumentsDirectory
Delete the identifier.plist file for this document from the DeletedDocuments directory.
- (void)deleteDocumentInfoPlistFromDeletedDocumentsDirectoryDiscussion
This method must call deletedDocumentInfoPlistFromDeletedDocumentsDirectoryWithSuccess: to indicate whether the deletion was successful.
Declared In
TICDSDocumentRegistrationOperation.hdeletedClientIdentifierFileFromDeletedClientsDirectoryWithSuccess:
Indicate whether the client’s file in the document’s RecentSyncs directory was deleted successfully.
- (void)deletedClientIdentifierFileFromDeletedClientsDirectoryWithSuccess:(BOOL)successParameters
- success
YESif theidentifier.plistfile was deleted, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSDocumentRegistrationOperation.hdeletedDocumentInfoPlistFromDeletedDocumentsDirectoryWithSuccess:
Indicate whether the identifier.plist file for this document was removed from the DeletedDocuments directory.
- (void)deletedDocumentInfoPlistFromDeletedDocumentsDirectoryWithSuccess:(BOOL)successParameters
- success
YESif theidentifier.plistfile was deleted, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSDocumentRegistrationOperation.hdiscoveredDeletionStatusOfClient:
Indicate whether the client has been deleted from synchronizing with this document.
- (void)discoveredDeletionStatusOfClient:(TICDSRemoteFileStructureDeletionResponseType)statusParameters
- status
The deletion status: deleted, not deleted, or error (see
TICDSTypesAndEnums.hfor possible values).
Discussion
If an error occurred, call setError: first, then specify TICDSRemoteFileStructureDeletionResponseTypeError for status.
Declared In
TICDSDocumentRegistrationOperation.hdiscoveredDeletionStatusOfRemoteDocument:
Indicate whether the document was previously deleted.
- (void)discoveredDeletionStatusOfRemoteDocument:(TICDSRemoteFileStructureDeletionResponseType)statusParameters
- status
The status of the directory: was not deleted, was deleted, or error (see
TICDSTypesAndEnums.hfor possible values).
Discussion
If an error occurred, call setError: first, then specify TICDSRemoteFileStructureDeletionResponseTypeError for status.
Declared In
TICDSDocumentRegistrationOperation.hdiscoveredStatusOfClientDirectoryInRemoteDocumentSyncChangesDirectory:
Indicate the status of this client’s directory inside the remote document SyncChanges directory.
- (void)discoveredStatusOfClientDirectoryInRemoteDocumentSyncChangesDirectory:(TICDSRemoteFileStructureExistsResponseType)statusParameters
- status
The status of the directory: does exist, does not exist, or error (see
TICDSTypesAndEnums.hfor possible values).
Discussion
If an error occurred, call setError: first, then specify TICDSRemoteFileStructureExistsResponseTypeError for status.
Declared In
TICDSDocumentRegistrationOperation.hdiscoveredStatusOfRemoteDocumentDirectory:
Indicate the status of the remote document directory.
- (void)discoveredStatusOfRemoteDocumentDirectory:(TICDSRemoteFileStructureExistsResponseType)statusParameters
- status
The status of the directory: does exist, does not exist, or error (see
TICDSTypesAndEnums.hfor possible values).
Discussion
If an error occurred, call setError: first, then specify TICDSRemoteFileStructureExistsResponseTypeError for status.
Declared In
TICDSDocumentRegistrationOperation.hfetchListOfIdentifiersOfAllRegisteredClientsForThisApplication
Fetch a list of all clients registered to synchronize with this application.
- (void)fetchListOfIdentifiersOfAllRegisteredClientsForThisApplicationDiscussion
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.hfetchRemoteIntegrityKey
Fetch the integrity key for this document.
- (void)fetchRemoteIntegrityKeyDiscussion
This method must call fetchedRemoteIntegrityKey: to provide the key.
Declared In
TICDSDocumentRegistrationOperation.hfetchedListOfIdentifiersOfAllRegisteredClientsForThisApplication:
Pass back the assembled NSArray of client identifiers registered to synchronize with the application.
- (void)fetchedListOfIdentifiersOfAllRegisteredClientsForThisApplication:(NSArray *)anArrayParameters
- anArray
The array of client identifiers, or
nilif an error occurred.
Discussion
If an error occurred, call setError: first, then specify nil for anArray.
Declared In
TICDSDocumentRegistrationOperation.hfetchedRemoteIntegrityKey:
Pass back the remote integrity key for this document.
- (void)fetchedRemoteIntegrityKey:(NSString *)aKeyParameters
- aKey
The remote integrity key, or
nilif an error occurred.
Discussion
If an error occurred, call setError: first, then specify nil for aKey.
Declared In
TICDSDocumentRegistrationOperation.hinitWithDelegate:
Initialize a document registration operation using a delegate that supports the TICDSDocumentRegistrationOperationDelegate protocol.
- (id)initWithDelegate:(NSObject<TICDSDocumentRegistrationOperationDelegate> *)aDelegateParameters
- aDelegate
The delegate to use for this operation.
Return Value
An initialized document registration operation.
Declared In
TICDSDocumentRegistrationOperation.hsaveIntegrityKey:
Save a file with the integrity key as its name to this document’s IntegrityKey directory.
- (void)saveIntegrityKey:(NSString *)aKeyParameters
- aKey
The integrity key to save.
Discussion
This method must call savedIntegrityKeyWithSuccess: to indicate whether the save was successful.
Declared In
TICDSDocumentRegistrationOperation.hsaveRemoteDocumentInfoPlistFromDictionary:
Save the dictionary to a documentInfo.plist file in this document’s directory.
- (void)saveRemoteDocumentInfoPlistFromDictionary:(NSDictionary *)aDictionaryParameters
- 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.hsavedIntegrityKeyWithSuccess:
Indicate whether the integrity key file was saved successfully.
- (void)savedIntegrityKeyWithSuccess:(BOOL)successParameters
- success
YESif the integrity key file was saved, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSDocumentRegistrationOperation.hsavedRemoteDocumentInfoPlistWithSuccess:
Indicate whether the documentInfo.plist file was saved successfully.
- (void)savedRemoteDocumentInfoPlistWithSuccess:(BOOL)successParameters
- success
YESif thedocumentInfo.plistfile was saved, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSDocumentRegistrationOperation.h