TICDSApplicationRegistrationOperation Class Reference
| Inherits from | TICDSOperation : NSOperation |
| Declared in | TICDSApplicationRegistrationOperation.h |
Overview
The TICDSApplicationRegistrationOperation class describes a generic operation used by the TICoreDataSync framework to register an application for future synchronization of documents.
The operation carries out the following tasks:
Subclass checks whether the
appIdentifierdirectory exists on the remote.If not, blitz any existing keychain items, then ask the application sync manager whether to use encryption (get a password, if so), then:
Subclass creates the
appIdentifierdirectory on the remote, and general file structure (directories only).Subclass saves the
ReadMe.txtfile at the root.If encryption is enabled, create the
FZACryptorand set its password.If encryption is enabled, subclass saves the generated salt file in the remote
Encryptiondirectory.If encryption is enabled, subclass saves a suitable file for password testing in the remote
Encryptiondirectory.Continue by creating the client’s directory (main step 3) inside
ClientDevices.
If app has been registered before, subclass checks whether the salt file exists on the remote, and
shouldUseEncryptionis set accordingly, then:Subclass checks whether the client’s directory exists inside
ClientDevices.If not, any existing keychain items are blitzed, then:
If encryption is disabled, continue by creating the client’s directory (main step 3) inside
ClientDevices.If encryption is enabled, subclass downloads the salt file and sets the
saltDataoperation property.The application sync manager is asked for the password.
The
FZACryptoris configured with password and salt, and the test file is downloaded.
If the directory exists, and encryption is disabled, then operation is complete.
If app has been registered before, subclass checks whether the salt file exists on the remote.
If not, encryption is disabled, so continue by checking whether the client has registered before.
If salt file exists, encryption is enabled, so check whether the
FZACryptorhas a password and salt.If not, subclass downloads the salt, the application sync manager is asked to get the password from the user, then the
FZACryptoris configured.Once downloaded, or if
FZACryptoralready has the password, continue by subclass checking whether the client’s directory exists insideClientDevices.
Subclass checks whether the client’s directory exists inside
ClientDevices.If not, subclass creates client’s directory inside
ClientDevices, then:documentInfo.plistis created, and encrypted, if necessary.Subclass uploads the
documentInfo.plistfile to the remote.
Operations are typically created automatically by the relevant sync manager.
You must use one of the subclasses of TICDSApplicationRegistrationOperation.
Tasks
Designated Initializer
-
– initWithDelegate:Initialize an application registration operation using a delegate that supports the
TICDSApplicationRegistrationOperationDelegateprotocol.
Methods Overridden by Subclasses
-
– checkWhetherRemoteGlobalAppDirectoryExistsCheck whether a directory exists for this application.
-
– createRemoteGlobalAppDirectoryStructureCreate global application directory structure.
-
– copyReadMeTxtFileToRootOfGlobalAppDirectoryFromPath:Copy the
ReadMe.txtfile from the bundle to the root of this application’s remote directory. -
– checkWhetherSaltFileExistsCheck whether the
salt.ticdsyncfile exists at the root of the application’s remote directory. -
– fetchSaltDataFetch the data from the
salt.ticdsyncfile. -
– saveSaltDataToRemote:Save the salt data to a
salt.ticdsyncfile at the root of the application’s remote directory. -
– savePasswordTestData:Save the test data to a
test.ticdsyncfile in theEncryptiondirectory at the root of the application’s remote directory. -
– fetchPasswordTestDataFetch the test data from the
test.ticdsyncfile in theEncryptiondirectory. -
– checkWhetherRemoteClientDeviceDirectoryExistsCheck whether the client’s directory already exists in
ClientDevices. -
– createRemoteClientDeviceDirectoryCreate the client’s directory in
ClientDevices. -
– saveRemoteClientDeviceInfoPlistFromDictionary:Save the dictionary to a
deviceInfo.plistfile in this client’s directory inside theClientDevicesdirectory.
Callbacks
-
– discoveredStatusOfRemoteGlobalAppDirectory:Indicate the status of the global application directory.
-
– createdRemoteGlobalAppDirectoryStructureWithSuccess:Indicate whether the creation of the global app directory structure was successful.
-
– copiedReadMeTxtFileToRootOfGlobalAppDirectoryWithSuccess:Indicate whether the
ReadMe.txtfile was copied from the bundle. -
– discoveredStatusOfSaltFile:Indicate the status of the
salt.ticdsyncfile. -
– fetchedSaltData:Provide the data from the
salt.ticdsyncfile. -
– savedSaltDataToRootOfGlobalAppDirectoryWithSuccess:Indicate whether the salt data was saved successfully.
-
– savedPasswordTestDataWithSuccess:Indicate whether the test data was saved successfuly.
-
– fetchedPasswordTestData:Provide the test data from the
test.ticdsyncfile. -
– createdRemoteClientDeviceDirectoryWithSuccess:Indicate whether the client’s directory was created successful in
ClientDevices. -
– savedRemoteClientDeviceInfoPlistWithSuccess:Indicate whether the
deviceInfo.plistfile was saved successfully.
Properties
-
appIdentifierThe application identifier.
property -
clientDescriptionThe client description.
property -
applicationUserInfoThe user info.
property -
pausedUsed to indicate whether the operation is currently paused awaiting input from the operation delegate, or in turn the application sync manager delegate.
property -
passwordThe password to use for encryption at initial global app registration, if
propertyshouldUseEncryptionisYES. -
saltDataThe cached salt data, set only after fetching from the remote.
property -
shouldCreateClientDirectoryUsed mid-operation to indicate whether the client directory needs to be created after configuring encryption.
property
Properties
appIdentifier
The application identifier.
@property (nonatomic, retain) NSString *appIdentifierDeclared In
TICDSApplicationRegistrationOperation.happlicationUserInfo
The user info.
@property (nonatomic, retain) NSDictionary *applicationUserInfoDeclared In
TICDSApplicationRegistrationOperation.hclientDescription
The client description.
@property (nonatomic, retain) NSString *clientDescriptionDeclared In
TICDSApplicationRegistrationOperation.hpassword
The password to use for encryption at initial global app registration, if shouldUseEncryption is YES.
@property (retain) NSString *passwordDeclared In
TICDSApplicationRegistrationOperation.hpaused
Used to indicate whether the operation is currently paused awaiting input from the operation delegate, or in turn the application sync manager delegate.
@property (assign, getter=isPaused) BOOL pausedDeclared In
TICDSApplicationRegistrationOperation.hInstance Methods
checkWhetherRemoteClientDeviceDirectoryExists
Check whether the client’s directory already exists in ClientDevices.
- (void)checkWhetherRemoteClientDeviceDirectoryExistsDiscussion
This method must call discoveredStatusOfRemoteClientDeviceDirectory: to indicate the status.
Declared In
TICDSApplicationRegistrationOperation.hcheckWhetherRemoteGlobalAppDirectoryExists
Check whether a directory exists for this application.
- (void)checkWhetherRemoteGlobalAppDirectoryExistsDiscussion
This method must call discoveredStatusOfGlobalAppDirectory: to indicate the status.
Declared In
TICDSApplicationRegistrationOperation.hcheckWhetherSaltFileExists
Check whether the salt.ticdsync file exists at the root of the application’s remote directory.
- (void)checkWhetherSaltFileExistsDiscussion
This method must call discoveredStatusOfSaltFile: to indicate the status.
Declared In
TICDSApplicationRegistrationOperation.hcopiedReadMeTxtFileToRootOfGlobalAppDirectoryWithSuccess:
Indicate whether the ReadMe.txt file was copied from the bundle.
- (void)copiedReadMeTxtFileToRootOfGlobalAppDirectoryWithSuccess:(BOOL)successParameters
- success
YESif theReadMe.txtfile was copied, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSApplicationRegistrationOperation.hcopyReadMeTxtFileToRootOfGlobalAppDirectoryFromPath:
Copy the ReadMe.txt file from the bundle to the root of this application’s remote directory.
- (void)copyReadMeTxtFileToRootOfGlobalAppDirectoryFromPath:(NSString *)aPathParameters
- aPath
The local path to the
ReadMe.txtfile.
Discussion
This method must call copiedReadMeTxtFileToRootOfGlobalAppDirectoryWithSuccess: to indicate whether the copy was successful.
Declared In
TICDSApplicationRegistrationOperation.hcreateRemoteClientDeviceDirectory
Create the client’s directory in ClientDevices.
- (void)createRemoteClientDeviceDirectoryDiscussion
This method must call createdRemoteClientDeviceDirectoryWithSuccess: to indicate whether the creation was successful.
Declared In
TICDSApplicationRegistrationOperation.hcreateRemoteGlobalAppDirectoryStructure
Create global application directory structure.
- (void)createRemoteGlobalAppDirectoryStructureDiscussion
This method must call createdGlobalAppDirectoryStructureWithSuccess: to indicate whether the creation was successful.
Declared In
TICDSApplicationRegistrationOperation.hcreatedRemoteClientDeviceDirectoryWithSuccess:
Indicate whether the client’s directory was created successful in ClientDevices.
- (void)createdRemoteClientDeviceDirectoryWithSuccess:(BOOL)successParameters
- success
YESif the client’s directory was created, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSApplicationRegistrationOperation.hcreatedRemoteGlobalAppDirectoryStructureWithSuccess:
Indicate whether the creation of the global app directory structure was successful.
- (void)createdRemoteGlobalAppDirectoryStructureWithSuccess:(BOOL)successParameters
- success
YESif the directory structure was created, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSApplicationRegistrationOperation.hdiscoveredStatusOfRemoteGlobalAppDirectory:
Indicate the status of the global application directory.
- (void)discoveredStatusOfRemoteGlobalAppDirectory:(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
TICDSApplicationRegistrationOperation.hdiscoveredStatusOfSaltFile:
Indicate the status of the salt.ticdsync file.
- (void)discoveredStatusOfSaltFile:(TICDSRemoteFileStructureExistsResponseType)statusParameters
- status
The status of the file: 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
TICDSApplicationRegistrationOperation.hfetchPasswordTestData
Fetch the test data from the test.ticdsync file in the Encryption directory.
- (void)fetchPasswordTestDataDiscussion
This method must call fetchedPasswordTestData: when done.
Declared In
TICDSApplicationRegistrationOperation.hfetchSaltData
Fetch the data from the salt.ticdsync file.
- (void)fetchSaltDataDiscussion
This method must call `` when the data has been fetched.
Declared In
TICDSApplicationRegistrationOperation.hfetchedPasswordTestData:
Provide the test data from the test.ticdsync file.
- (void)fetchedPasswordTestData:(NSData *)testDataParameters
- testData
The
NSDatacontents of thetest.ticdsyncfile, ornilif an error occurred.
Discussion
If an error occurred, call setError: first, then specify nil for testData.
Declared In
TICDSApplicationRegistrationOperation.hfetchedSaltData:
Provide the data from the salt.ticdsync file.
- (void)fetchedSaltData:(NSData *)saltDataParameters
- saltData
The
NSDatacontents of thesalt.ticdsyncfile, ornilif an error occurred.
Discussion
If an error occurred, call setError: first, then specify nil for saltData.
Declared In
TICDSApplicationRegistrationOperation.hinitWithDelegate:
Initialize an application registration operation using a delegate that supports the TICDSApplicationRegistrationOperationDelegate protocol.
- (id)initWithDelegate:(NSObject<TICDSApplicationRegistrationOperationDelegate> *)aDelegateParameters
- aDelegate
The delegate to use for this operation.
Return Value
An initialized document registration operation.
Declared In
TICDSApplicationRegistrationOperation.hsavePasswordTestData:
Save the test data to a test.ticdsync file in the Encryption directory at the root of the application’s remote directory.
- (void)savePasswordTestData:(NSData *)testDataParameters
- testData
The data to be saved.
Discussion
This method must call savedTestDataWithSuccess: to indicate whether the save was successful.
Declared In
TICDSApplicationRegistrationOperation.hsaveRemoteClientDeviceInfoPlistFromDictionary:
Save the dictionary to a deviceInfo.plist file in this client’s directory inside the ClientDevices directory.
- (void)saveRemoteClientDeviceInfoPlistFromDictionary:(NSDictionary *)aDictionaryParameters
- aDictionary
The dictionary to save as the
deviceInfo.plist.
Discussion
This method must call savedRemoteClientDeviceInfoPlistWithSuccess: to indicate whether the save was successful.
Declared In
TICDSApplicationRegistrationOperation.hsaveSaltDataToRemote:
Save the salt data to a salt.ticdsync file at the root of the application’s remote directory.
- (void)saveSaltDataToRemote:(NSData *)saltDataParameters
- saltData
The data to be saved.
Discussion
This method must call savedSaltDataToRootOfGlobalAppDirectoryWithSuccess: to indicate whether the save was successful.
Declared In
TICDSApplicationRegistrationOperation.hsavedPasswordTestDataWithSuccess:
Indicate whether the test data was saved successfuly.
- (void)savedPasswordTestDataWithSuccess:(BOOL)successParameters
- success
YESif thetest.ticdsyncfile was saved, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSApplicationRegistrationOperation.hsavedRemoteClientDeviceInfoPlistWithSuccess:
Indicate whether the deviceInfo.plist file was saved successfully.
- (void)savedRemoteClientDeviceInfoPlistWithSuccess:(BOOL)successParameters
- success
YESif thedeviceInfo.plistfile was saved, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSApplicationRegistrationOperation.hsavedSaltDataToRootOfGlobalAppDirectoryWithSuccess:
Indicate whether the salt data was saved successfully.
- (void)savedSaltDataToRootOfGlobalAppDirectoryWithSuccess:(BOOL)successParameters
- success
YESif thesalt.ticdsyncfile was saved, otherwiseNO.
Discussion
If not, call setError: first, then specify NO for success.
Declared In
TICDSApplicationRegistrationOperation.h