TICDSDocumentSyncManager Class Reference
| Inherits from | NSObject |
| Conforms to | TICDSDocumentRegistrationOperationDelegate TICDSSynchronizationOperationDelegate |
| Declared in | TICDSDocumentSyncManager.h |
Overview
TICDSDocumentSyncManager describes the generic behavior provided by a Document Sync Manager in the TICoreDataSync framework.
A Document Sync Manager is responsible for synchronization settings relating to a single document—you’ll need one for each document you wish to synchronize. If your application is a non-document-based application, you’ll still need a single document sync manager to represent your application’s data.
Don’t instantiate this class directly, but instead use one of the subclasses:
You must register the document sync manager before you can use it to synchronize the document, or perform any other tasks.
Tasks
One-Shot Document Registration
-
– registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:Register a document ready for synchronization.
Delayed Document Registration
-
– configureWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:Configure a document but don’t immediately register it.
-
– registerConfiguredDocumentSyncManagerRegister a document that has already been pre-configured.
General Registration
-
– continueRegistrationByCreatingRemoteFileStructure:Continue Registration.
-
– preConfigureWithDelegate:appSyncManager:documentIdentifier:Pre-configure a sync manager for a document that’s just been downloaded, but without carrying out full registration.
-
– addManagedObjectContext:Add an additional background managed object context to this document sync manager.
Whole Store Upload and Download
-
– initiateUploadOfWholeStoreStart the process manually to upload the entire store file for this document, along with the relevant
AppliedSyncChanges.ticdsyncfile. -
– initiateDownloadOfWholeStoreStart the process to download the entire store file for this document, along with the relevant
AppliedSyncChanges.ticdsyncfile.
Synchronization Process
-
– initiateSynchronizationStart synchronizing the document with the remote location.
-
– continueSynchronizationByResolvingConflictWithResolutionType:If a conflict is encountered during synchronization, your delegate will be notified with the
solveConflict:method. You must decide whether the remote or localSyncChangewins, and inform the document sync manager using this method to continue synchronization.
Vacuuming Unneeded Files
-
– initiateVacuumOfUnneededRemoteFilesInitiate a vacuum operation to clean up files hanging around on the remote that are no longer needed by any registered clients.
Information on Registered Clients
-
– requestInformationForAllRegisteredDevicesFetch a list of devices that are registered to synchronize with this client.
Deleting Clients from a Document
-
– deleteDocumentSynchronizationDataForClientWithIdentifier:Delete the files used by a client to synchronize with this document.
Methods Overridden by Subclasses
-
– documentRegistrationOperationReturns a document registration operation.
-
– wholeStoreUploadOperationReturns a whole store upload operation.
-
– wholeStoreDownloadOperationReturns a whole store download operation.
-
– synchronizationOperationReturns a synchronization operation.
-
– vacuumOperationReturns a vacuum operation.
-
– listOfDocumentRegisteredClientsOperationReturns a “list of registered clients for this document” operation.
-
– documentClientDeletionOperationReturns a “deletion of client synchronization data from a document” operation.
Managed Object Context Saving
-
– synchronizedMOCWillSave:Indicate that the synchronized managed object context is about to save.
-
– synchronizedMOCDidSave:Indicate that the synchronized managed object context completed a successful save.
-
– synchronizedMOCFailedToSave:withError:Indicate that the synchronized managed object context failed to save.
Properties
-
stateDocument Sync Manager State.
property -
shouldUseEncryptionUsed to indicate whether the document sync manager should use encryption for the remote files.
property -
mustUploadStoreAfterRegistrationUsed internally to indicate whether the document sync manager must upload the store after registration has completed.
property -
delegateThe Document Sync Manager Delegate.
property -
applicationSyncManagerThe Application Sync Manager responsible for this document.
property -
documentIdentifierThe Document Identifier used for registration.
property -
documentDescriptionThe Document Description used for registration.
property -
clientIdentifierThe Client Identifier used for registration.
property -
documentUserInfoThe User Info used for registration.
property -
fileManagerAn
propertyNSFileManagersuitable for use in document registration tasks. -
helperFileDirectoryLocationThe location of a directory used by the
propertyTICoreDataSyncframework to store local helper files for this document. -
syncChangesMOCsA dictionary containing the SyncChanges managed object contexts to use for each document managed object context.
property -
– syncChangesMocForDocumentMoc:Returns a SyncChanges managed object context for a given document managed object context.
-
primaryDocumentMOCThe document managed object context that was supplied at registration, and therefore treated as the primary context.
property -
coreDataFactoryThe
propertyTICoreDataFactoryobject used for SyncChange managed object contexts.
Operation Queues
-
registrationQueueThe operation queue used for registration operations.
property -
synchronizationQueueThe operation queue used for synchronization operations.
property -
otherTasksQueueThe operation queue used for other tasks.
property
Relative Paths
-
relativePathToClientDevicesDirectoryThe path to the
propertyClientDevicesdirectory, relative to the root of the remote file structure. -
relativePathToInformationDirectoryThe path to the
propertyInformationdirectory, relative to the root of the remote file structure. -
relativePathToInformationDeletedDocumentsDirectoryThe path to the
propertyDeletedDocumentsdirectory inside theInformationdirectory, relative to the root of the remote file structure. -
relativePathToDeletedDocumentsThisDocumentIdentifierPlistFileThe path to this document’s
propertyidentifier.plistfile inside theDeletedDocumentsdirectory, relative to the root of the remote file structure. -
relativePathToDocumentsDirectoryThe path to the
propertyDocumentsdirectory, relative to the root of the remote file structure. -
relativePathToThisDocumentDirectoryThe path to this document’s directory inside the
propertyDocumentsdirectory, relative to the root of the remote file structure. -
relativePathToThisDocumentDeletedClientsDirectoryThe path to this document’s
propertyDeletedClientsdirectory, relative to the root of the remote file structure. -
relativePathToThisDocumentSyncChangesDirectoryThe path to the
propertySyncChangesdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentSyncChangesThisClientDirectoryThe path to this client’s directory inside the
propertySyncChangesdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentSyncCommandsDirectoryThe path to the
propertySyncCommandsdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentSyncCommandsThisClientDirectoryThe path to this client’s directory inside the
propertySyncCommandsdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentWholeStoreDirectoryThe path to the
propertyWholeStoredirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentWholeStoreThisClientDirectoryThe path to this client’s directory inside the
propertyWholeStoredirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentTemporaryFilesDirectoryThe path to the
propertyTemporaryFilesdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentTemporaryWholeStoreDirectoryThe path to the
propertyWholeStoredirectory inside theTemporaryFilesdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryThe path to this client’s directory inside the
propertyWholeStoredirectory inside theTemporaryFilesdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryWholeStoreFileThe path to this client’s
propertyWholeStore.ticdsyncfile inside it’s directory inside theWholeStoredirectory inside theTemporaryFilesdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryAppliedSyncChangeSetsFileThe path to this client’s
propertyAppliedSyncChangeSets.ticdsyncfile inside it’s directory inside theWholeStoredirectory inside theTemporaryFilesdirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentWholeStoreThisClientDirectoryWholeStoreFileThe path to this client’s
propertyWholeStore.ticdsyncfile inside it’s directory inside theWholeStoredirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentWholeStoreThisClientDirectoryAppliedSyncChangeSetsFileThe path to this client’s
propertyAppliedSyncChangeSets.ticdsyncfile inside it’s directory inside theWholeStoredirectory for this document, relative to the root of the remote file structure. -
relativePathToThisDocumentRecentSyncsDirectoryThe path to this document’s
propertyRecentSyncsdirectory, relative to the root of the remote file structure. -
relativePathToThisDocumentRecentSyncsDirectoryThisClientFileThe path this client’s RecentSync file inside this document’s
propertyRecentSyncsdirectory, relative to the root of the remote file structure. -
localAppliedSyncChangesFilePathThe path to the
propertyAppliedSyncChanges.ticdsyncfile, located in thehelperFileDirectoryLocation. -
syncChangesBeingSynchronizedStorePathThe path to the
propertySyncChangesBeingSynchronized.syncchgfile, located in thehelperFileDirectoryLocation. -
unsynchronizedSyncChangesStorePathThe path to the
propertyUnsynchronizedSyncChanges.syncchgfile, located in thehelperFileDirectoryLocation. -
integrityKeyThe integrity key used to check whether the synchronization data matches what’s expected.
property
Properties
applicationSyncManager
The Application Sync Manager responsible for this document.
@property (nonatomic, retain) TICDSApplicationSyncManager *applicationSyncManagerDeclared In
TICDSDocumentSyncManager.hclientIdentifier
The Client Identifier used for registration.
@property (nonatomic, readonly, retain) NSString *clientIdentifierDiscussion
Set the identifier when registering with registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:.
Declared In
TICDSDocumentSyncManager.hcoreDataFactory
The TICoreDataFactory object used for SyncChange managed object contexts.
@property (nonatomic, retain) TICoreDataFactory *coreDataFactoryDeclared In
TICDSDocumentSyncManager.hdelegate
The Document Sync Manager Delegate.
@property (nonatomic, assign) id<TICDSDocumentSyncManagerDelegate> delegateDeclared In
TICDSDocumentSyncManager.hdocumentDescription
The Document Description used for registration.
@property (nonatomic, readonly, retain) NSString *documentDescriptionDiscussion
Set the identifier when registering with registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:.
Declared In
TICDSDocumentSyncManager.hdocumentIdentifier
The Document Identifier used for registration.
@property (nonatomic, readonly, retain) NSString *documentIdentifierDiscussion
Set the identifier when registering with registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:.
Declared In
TICDSDocumentSyncManager.hdocumentUserInfo
The User Info used for registration.
@property (nonatomic, readonly, retain) NSDictionary *documentUserInfoDiscussion
Set the user info when registering with registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:.
Declared In
TICDSDocumentSyncManager.hfileManager
An NSFileManager suitable for use in document registration tasks.
@property (nonatomic, readonly, retain) NSFileManager *fileManagerDeclared In
TICDSDocumentSyncManager.hhelperFileDirectoryLocation
The location of a directory used by the TICoreDataSync framework to store local helper files for this document.
@property (readonly, retain) NSURL *helperFileDirectoryLocationDiscussion
You typically set this property by implementing the TICDSDocumentSyncManagerDelegate method documentSyncManager:helperFileDirectoryURLForDocumentWithIdentifier:description:userInfo:.
By default, the framework will use the location ~/Library/Application Support/ApplicationName/Documents/documentIdentifier.
Declared In
TICDSDocumentSyncManager.hintegrityKey
The integrity key used to check whether the synchronization data matches what’s expected.
@property (nonatomic, retain) NSString *integrityKeyDeclared In
TICDSDocumentSyncManager.hlocalAppliedSyncChangesFilePath
The path to the AppliedSyncChanges.ticdsync file, located in the helperFileDirectoryLocation.
@property (nonatomic, readonly) NSString *localAppliedSyncChangesFilePathDeclared In
TICDSDocumentSyncManager.hmustUploadStoreAfterRegistration
Used internally to indicate whether the document sync manager must upload the store after registration has completed.
@property (nonatomic, assign) BOOL mustUploadStoreAfterRegistrationDiscussion
This will be YES if this is the first time this document has been registered.
Declared In
TICDSDocumentSyncManager.hotherTasksQueue
The operation queue used for other tasks.
@property (nonatomic, readonly, retain) NSOperationQueue *otherTasksQueueDiscussion
The queue is suspended until the document has registered successfully.
Declared In
TICDSDocumentSyncManager.hprimaryDocumentMOC
The document managed object context that was supplied at registration, and therefore treated as the primary context.
@property (nonatomic, retain) TICDSSynchronizedManagedObjectContext *primaryDocumentMOCDeclared In
TICDSDocumentSyncManager.hregistrationQueue
The operation queue used for registration operations.
@property (nonatomic, readonly, retain) NSOperationQueue *registrationQueueDeclared In
TICDSDocumentSyncManager.hrelativePathToClientDevicesDirectory
The path to the ClientDevices directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToClientDevicesDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToDeletedDocumentsThisDocumentIdentifierPlistFile
The path to this document’s identifier.plist file inside the DeletedDocuments directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToDeletedDocumentsThisDocumentIdentifierPlistFileDeclared In
TICDSDocumentSyncManager.hrelativePathToDocumentsDirectory
The path to the Documents directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToDocumentsDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToInformationDeletedDocumentsDirectory
The path to the DeletedDocuments directory inside the Information directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToInformationDeletedDocumentsDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToInformationDirectory
The path to the Information directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToInformationDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentDeletedClientsDirectory
The path to this document’s DeletedClients directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentDeletedClientsDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentDirectory
The path to this document’s directory inside the Documents directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentRecentSyncsDirectory
The path to this document’s RecentSyncs directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentRecentSyncsDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentRecentSyncsDirectoryThisClientFile
The path this client’s RecentSync file inside this document’s RecentSyncs directory, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentRecentSyncsDirectoryThisClientFileDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentSyncChangesDirectory
The path to the SyncChanges directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentSyncChangesDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentSyncChangesThisClientDirectory
The path to this client’s directory inside the SyncChanges directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentSyncChangesThisClientDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentSyncCommandsDirectory
The path to the SyncCommands directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentSyncCommandsDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentSyncCommandsThisClientDirectory
The path to this client’s directory inside the SyncCommands directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentSyncCommandsThisClientDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentTemporaryFilesDirectory
The path to the TemporaryFiles directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryFilesDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentTemporaryWholeStoreDirectory
The path to the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentTemporaryWholeStoreThisClientDirectory
The path to this client’s directory inside the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryAppliedSyncChangeSetsFile
The path to this client’s AppliedSyncChangeSets.ticdsync file inside it’s directory inside the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryAppliedSyncChangeSetsFileDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryWholeStoreFile
The path to this client’s WholeStore.ticdsync file inside it’s directory inside the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryWholeStoreFileDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentWholeStoreDirectory
The path to the WholeStore directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentWholeStoreThisClientDirectory
The path to this client’s directory inside the WholeStore directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreThisClientDirectoryDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentWholeStoreThisClientDirectoryAppliedSyncChangeSetsFile
The path to this client’s AppliedSyncChangeSets.ticdsync file inside it’s directory inside the WholeStore directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreThisClientDirectoryAppliedSyncChangeSetsFileDeclared In
TICDSDocumentSyncManager.hrelativePathToThisDocumentWholeStoreThisClientDirectoryWholeStoreFile
The path to this client’s WholeStore.ticdsync file inside it’s directory inside the WholeStore directory for this document, relative to the root of the remote file structure.
@property (nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreThisClientDirectoryWholeStoreFileDeclared In
TICDSDocumentSyncManager.hshouldUseEncryption
Used to indicate whether the document sync manager should use encryption for the remote files.
@property (nonatomic, assign) BOOL shouldUseEncryptionDiscussion
This value is set automatically by the application sync manager.
Declared In
TICDSDocumentSyncManager.hstate
Document Sync Manager State.
@property (nonatomic, assign) TICDSDocumentSyncManagerState stateDiscussion
The state of the document sync manager indicates whether it is ready to synchronize.
Possible values are defined in TICDSTypesAndEnums.h.
Declared In
TICDSDocumentSyncManager.hsyncChangesBeingSynchronizedStorePath
The path to the SyncChangesBeingSynchronized.syncchg file, located in the helperFileDirectoryLocation.
@property (nonatomic, readonly) NSString *syncChangesBeingSynchronizedStorePathDeclared In
TICDSDocumentSyncManager.hsyncChangesMOCs
A dictionary containing the SyncChanges managed object contexts to use for each document managed object context.
@property (retain) NSMutableDictionary *syncChangesMOCsDeclared In
TICDSDocumentSyncManager.hsynchronizationQueue
The operation queue used for synchronization operations.
@property (nonatomic, readonly, retain) NSOperationQueue *synchronizationQueueDiscussion
The queue supports only 1 operation at a time, and is suspended until the document has registered successfully.
Declared In
TICDSDocumentSyncManager.hunsynchronizedSyncChangesStorePath
The path to the UnsynchronizedSyncChanges.syncchg file, located in the helperFileDirectoryLocation.
@property (nonatomic, readonly) NSString *unsynchronizedSyncChangesStorePathDeclared In
TICDSDocumentSyncManager.hInstance Methods
addManagedObjectContext:
Add an additional background managed object context to this document sync manager.
- (void)addManagedObjectContext:(TICDSSynchronizedManagedObjectContext *)aContextParameters
- aContext
The additional managed object context to add.
Discussion
Use this method to add an additional managed object context in which changes should be tracked, for example a context used to add items in the background.
Declared In
TICDSDocumentSyncManager.hconfigureWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:
Configure a document but don’t immediately register it.
- (void)configureWithDelegate:(id<TICDSDocumentSyncManagerDelegate>)aDelegate appSyncManager:(TICDSApplicationSyncManager *)anAppSyncManager managedObjectContext:(TICDSSynchronizedManagedObjectContext *)aContext documentIdentifier:(NSString *)aDocumentIdentifier description:(NSString *)aDocumentDescription userInfo:(NSDictionary *)someUserInfoParameters
- aDelegate
The object you wish to be notified regarding document-related sync information; this object must conform to the
TICDSDocumentSyncManagerDelegateprotocol, which includes some required methods.
- anAppSyncManager
The application sync manager responsible for overseeing this document.
- aContext
The primary managed object context in your application; this must be an instance of
TICDSSynchronizedManagedObjectContextand not just a plainNSManagedObjectContext.
- aDocumentIdentifier
An identification string to identify this document uniquely. You would typically create a UUID string the first time this doc is registered and store this in e.g. the store metadata.
- aDocumentDescription
A human-readable string used to identify this document, e.g. the full name of the document.
- someUserInfo
A dictionary of information that will be saved throughout all future synchronizations. Because this information is saved in a plist, everything in the dictionary must be archivable using
NSKeyedArchiver.
Discussion
Use this method to configure the sync manager in environments where you may not have a permanent internet connection, such as an iOS device, or a desktop WebDAV client, etc.
This will configure everything necessary to track changes made by the user. When you wish to initiate a sync, or perform any other task, you’ll need to call the registerConfiguredDocumentSyncManager method first to initiate registration.
You must call this method before using the document sync manager for any other purpose.
Do not use this method of registration the very first time the user configures registration on a document, or the internal checks to update the sync attribute on any pre-existing managed objects will not be made.
Declared In
TICDSDocumentSyncManager.hcontinueRegistrationByCreatingRemoteFileStructure:
Continue Registration.
- (void)continueRegistrationByCreatingRemoteFileStructure:(BOOL)shouldCreateFileStructureParameters
- shouldCreateFileStructure
YESif the registration should continue and create the necessary remote file structure, orNOto cancel the registration.
Discussion
If this is the first time you have registered this document, or the remote file structure has been removed for some reason, your delegate will be notified with the documentSyncManager:didPauseRegistrationAsRemoteFileStructureDoesNotExistForDocumentWithIdentifier:description:userInfo: method. You must continue registration manually by calling this method, specifying whether or not the registration should continue by creating the remote file structure.
If you specify NO, registration will fail with an error.
Declared In
TICDSDocumentSyncManager.hcontinueSynchronizationByResolvingConflictWithResolutionType:
If a conflict is encountered during synchronization, your delegate will be notified with the solveConflict: method. You must decide whether the remote or local SyncChange wins, and inform the document sync manager using this method to continue synchronization.
- (void)continueSynchronizationByResolvingConflictWithResolutionType:(TICDSSyncConflictResolutionType)aTypeParameters
- aType
The type of conflict resolution; see
TICDSTypesAndEnums.hfor possible values.
Declared In
TICDSDocumentSyncManager.hdeleteDocumentSynchronizationDataForClientWithIdentifier:
Delete the files used by a client to synchronize with this document.
- (void)deleteDocumentSynchronizationDataForClientWithIdentifier:(NSString *)anIdentifierParameters
- anIdentifier
The unique synchronization identifier of the client to delete.
Discussion
This will automatically spawn a TICDSDocumentClientDeletionOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.
Declared In
TICDSDocumentSyncManager.hdocumentClientDeletionOperation
Returns a “deletion of client synchronization data from a document” operation.
- (TICDSDocumentClientDeletionOperation *)documentClientDeletionOperationReturn Value
A correctly-configured subclass of TICDSDocumentClientDeletionOperation.
Discussion
Subclasses of TICDSDocumentSyncManager use this method to return a correctly-configured operation for their particularly sync method.
Declared In
TICDSDocumentSyncManager.hdocumentRegistrationOperation
Returns a document registration operation.
- (TICDSDocumentRegistrationOperation *)documentRegistrationOperationReturn Value
A correctly-configured subclass of TICDSDocumentRegistrationOperation.
Discussion
Subclasses of TICDSDocumentSyncManager use this method to return a correctly-configured document registration operation for their particular sync method.
Declared In
TICDSDocumentSyncManager.hinitiateDownloadOfWholeStore
Start the process to download the entire store file for this document, along with the relevant AppliedSyncChanges.ticdsync file.
- (void)initiateDownloadOfWholeStoreDiscussion
This will automatically spawn a TICDSWholeStoreDownloadOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.
The location of the store file (and the applied sync changes file) will be requested from the delegate immediately after calling this method.
Declared In
TICDSDocumentSyncManager.hinitiateSynchronization
Start synchronizing the document with the remote location.
- (void)initiateSynchronizationDiscussion
This will automatically spawn a TICDSSynchronizationOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.
Declared In
TICDSDocumentSyncManager.hinitiateUploadOfWholeStore
Start the process manually to upload the entire store file for this document, along with the relevant AppliedSyncChanges.ticdsync file.
- (void)initiateUploadOfWholeStoreDiscussion
This will automatically spawn a TICDSWholeStoreUploadOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.
The location of the store file (and the applied sync changes file) will be requested from the delegate immediately after calling this method.
Declared In
TICDSDocumentSyncManager.hinitiateVacuumOfUnneededRemoteFiles
Initiate a vacuum operation to clean up files hanging around on the remote that are no longer needed by any registered clients.
- (void)initiateVacuumOfUnneededRemoteFilesDiscussion
This will automatically spawn a TICDSVacuumOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.
Declared In
TICDSDocumentSyncManager.hlistOfDocumentRegisteredClientsOperation
Returns a “list of registered clients for this document” operation.
- (TICDSListOfDocumentRegisteredClientsOperation *)listOfDocumentRegisteredClientsOperationReturn Value
A correctly-configured subclass of TICDSListOfDocumentRegisteredClientsOperation.
Discussion
Subclasses of TICDSDocumentSyncManager use this method to return a correctly-configured operation for their particularly sync method.
Declared In
TICDSDocumentSyncManager.hpreConfigureWithDelegate:appSyncManager:documentIdentifier:
Pre-configure a sync manager for a document that’s just been downloaded, but without carrying out full registration.
- (void)preConfigureWithDelegate:(id<TICDSDocumentSyncManagerDelegate>)aDelegate appSyncManager:(TICDSApplicationSyncManager *)anAppSyncManager documentIdentifier:(NSString *)aDocumentIdentifierParameters
- aDelegate
The object you wish to be notified regarding document-related sync information; this object must conform to the
TICDSDocumentSyncManagerDelegateprotocol, which includes some required methods.
- anAppSyncManager
The application sync manager responsible for overseeing this document.
- aDocumentIdentifier
An identification string to identify this document uniquely. You would typically create a UUID string the first time this doc is registered and store this in e.g. the store metadata.
Discussion
Use this method to provide basic configuration of the sync manager for a document that’s been downloaded by calling the TICDSApplicationSyncManager method requestDownloadOfDocumentWithIdentifier:toLocation:, normally in response to the TICDSApplicationSyncManager delegate method applicationSyncManager:preConfiguredDocumentSyncManagerForDownloadedDocumentWithIdentifier:atURL:.
This will setup the necessary helper file location and do any local configuration, but won’t register the document with the remote.
If an error occurs, the delegate will be informed via the applicationSyncManager:didFailToRegisterWithError: method.
This method is called automatically by registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:, so you should only call it when needed during the document download process, not during general document registration.
Declared In
TICDSDocumentSyncManager.hregisterConfiguredDocumentSyncManager
Register a document that has already been pre-configured.
- (void)registerConfiguredDocumentSyncManagerDiscussion
Use this method to register a document sync manager that you have already configured using the configureWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo: method.
Declared In
TICDSDocumentSyncManager.hregisterWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:
Register a document ready for synchronization.
- (void)registerWithDelegate:(id<TICDSDocumentSyncManagerDelegate>)aDelegate appSyncManager:(TICDSApplicationSyncManager *)anAppSyncManager managedObjectContext:(TICDSSynchronizedManagedObjectContext *)aContext documentIdentifier:(NSString *)aDocumentIdentifier description:(NSString *)aDocumentDescription userInfo:(NSDictionary *)someUserInfoParameters
- aDelegate
The object you wish to be notified regarding document-related sync information; this object must conform to the
TICDSDocumentSyncManagerDelegateprotocol, which includes some required methods.
- anAppSyncManager
The application sync manager responsible for overseeing this document.
- aContext
The primary managed object context in your application; this must be an instance of
TICDSSynchronizedManagedObjectContextand not just a plainNSManagedObjectContext.
- aDocumentIdentifier
An identification string to identify this document uniquely. You would typically create a UUID string the first time this doc is registered and store this in e.g. the store metadata.
- aDocumentDescription
A human-readable string used to identify this document, e.g. the full name of the document.
- someUserInfo
A dictionary of information that will be saved throughout all future synchronizations. Because this information is saved in a plist, everything in the dictionary must be archivable using
NSKeyedArchiver.
Discussion
Use this method to register the sync manager ready for document synchronization.
This will automatically spawn a TICDSDocumentRegistrationOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.
If this is the first time you have registered the document with this identifier, registration will automatically create the file structure necessary at the remote end for this and other clients to synchronize. See [TICDSUtilities remoteDocumentFileStructure] for the structure that will be created.
If you provide an application sync manager that isn’t yet ready to sync, the document registration task will be suspended until the application has finished registering.
If this is the first time you have registered this document, or the remote file structure has been removed for some reason, your delegate will be notified with the documentSyncManager:didPauseRegistrationAsRemoteFileStructureDoesNotExistForDocumentWithIdentifier:description:userInfo: method. You must continue registration manually by calling the continueRegistrationByCreatingRemoteFileStructure: method.
You must call this method before using the document sync manager for any other purpose.
Declared In
TICDSDocumentSyncManager.hrequestInformationForAllRegisteredDevices
Fetch a list of devices that are registered to synchronize with this client.
- (void)requestInformationForAllRegisteredDevicesDeclared In
TICDSDocumentSyncManager.hsyncChangesMocForDocumentMoc:
Returns a SyncChanges managed object context for a given document managed object context.
- (NSManagedObjectContext *)syncChangesMocForDocumentMoc:(TICDSSynchronizedManagedObjectContext *)aContextDeclared In
TICDSDocumentSyncManager.hsynchronizationOperation
Returns a synchronization operation.
- (TICDSSynchronizationOperation *)synchronizationOperationReturn Value
A correctly-configured subclass of TICDSSynchronizationOperation.
Discussion
Subclasses of TICDSDocumentSyncManager use this method to return a correctly-configured synchronization operation for their particular sync method.
Declared In
TICDSDocumentSyncManager.hsynchronizedMOCDidSave:
Indicate that the synchronized managed object context completed a successful save.
- (void)synchronizedMOCDidSave:(TICDSSynchronizedManagedObjectContext *)aMocParameters
- aMoc
The synchronized managed object context.
Discussion
This method is called automatically by TICDSSynchronizedManagedObjectContext when it has successfully completed a save:.
Declared In
TICDSDocumentSyncManager.hsynchronizedMOCFailedToSave:withError:
Indicate that the synchronized managed object context failed to save.
- (void)synchronizedMOCFailedToSave:(TICDSSynchronizedManagedObjectContext *)aMoc withError:(NSError *)anErrorParameters
- aMoc
The synchronized managed object context.
- anError
The relevant saving error.
Discussion
This method is called automatically by TICDSSynchronizedManagedObjectContext when it’s failed to save:.
Declared In
TICDSDocumentSyncManager.hsynchronizedMOCWillSave:
Indicate that the synchronized managed object context is about to save.
- (void)synchronizedMOCWillSave:(TICDSSynchronizedManagedObjectContext *)aMocParameters
- aMoc
The synchronized managed object context.
Discussion
This method is called automatically by TICDSSynchronizedManagedObjectContext when it’s about to initiate a save:.
Declared In
TICDSDocumentSyncManager.hvacuumOperation
Returns a vacuum operation.
- (TICDSVacuumOperation *)vacuumOperationReturn Value
A correctly-configured subclass of TICDSVacuumOperation.
Discussion
Subclasses of TICDSDocumentSyncManager use this method to return a correctly-configured vacuum operation for their particular sync method.
Declared In
TICDSDocumentSyncManager.hwholeStoreDownloadOperation
Returns a whole store download operation.
- (TICDSWholeStoreDownloadOperation *)wholeStoreDownloadOperationReturn Value
A correctly-configured subclass of TICDSWholeStoreDownloadOperation.
Discussion
Subclasses of TICDSDocumentSyncManager use this method to return a correctly-configured whole store download operation (including the remote location of the document’s whole store, etc) for their particular sync method.
Declared In
TICDSDocumentSyncManager.hwholeStoreUploadOperation
Returns a whole store upload operation.
- (TICDSWholeStoreUploadOperation *)wholeStoreUploadOperationReturn Value
A correctly-configured subclass of TICDSWholeStoreUploadOperation.
Discussion
Subclasses of TICDSDocumentSyncManager use this method to return a correctly-configured whole store upload operation for their particular sync method.
Declared In
TICDSDocumentSyncManager.h