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:

  1. Subclass checks whether the appIdentifier directory exists on the remote.

    1. If not, blitz any existing keychain items, then ask the application sync manager whether to use encryption (get a password, if so), then:

      1. Subclass creates the appIdentifier directory on the remote, and general file structure (directories only).

      2. Subclass saves the ReadMe.txt file at the root.

      3. If encryption is enabled, create the FZACryptor and set its password.

      4. If encryption is enabled, subclass saves the generated salt file in the remote Encryption directory.

      5. If encryption is enabled, subclass saves a suitable file for password testing in the remote Encryption directory.

      6. Continue by creating the client’s directory (main step 3) inside ClientDevices.

    2. If app has been registered before, subclass checks whether the salt file exists on the remote, and shouldUseEncryption is set accordingly, then:

      1. Subclass checks whether the client’s directory exists inside ClientDevices.

      2. If not, any existing keychain items are blitzed, then:

        1. If encryption is disabled, continue by creating the client’s directory (main step 3) inside ClientDevices.

        2. If encryption is enabled, subclass downloads the salt file and sets the saltData operation property.

        3. The application sync manager is asked for the password.

        4. The FZACryptor is configured with password and salt, and the test file is downloaded.

      3. If the directory exists, and encryption is disabled, then operation is complete.

    3. If app has been registered before, subclass checks whether the salt file exists on the remote.

      1. If not, encryption is disabled, so continue by checking whether the client has registered before.

      2. If salt file exists, encryption is enabled, so check whether the FZACryptor has a password and salt.

        1. If not, subclass downloads the salt, the application sync manager is asked to get the password from the user, then the FZACryptor is configured.

        2. Once downloaded, or if FZACryptor already has the password, continue by subclass checking whether the client’s directory exists inside ClientDevices.

  2. Subclass checks whether the client’s directory exists inside ClientDevices.

  3. If not, subclass creates client’s directory inside ClientDevices, then:

    1. documentInfo.plist is created, and encrypted, if necessary.

    2. Subclass uploads the documentInfo.plist file 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

Methods Overridden by Subclasses

Callbacks

Properties

Properties

appIdentifier

The application identifier.

@property (nonatomic, retain) NSString *appIdentifier

Declared In

TICDSApplicationRegistrationOperation.h

applicationUserInfo

The user info.

@property (nonatomic, retain) NSDictionary *applicationUserInfo

Declared In

TICDSApplicationRegistrationOperation.h

clientDescription

The client description.

@property (nonatomic, retain) NSString *clientDescription

Declared In

TICDSApplicationRegistrationOperation.h

password

The password to use for encryption at initial global app registration, if shouldUseEncryption is YES.

@property (retain) NSString *password

Declared In

TICDSApplicationRegistrationOperation.h

paused

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 paused

Declared In

TICDSApplicationRegistrationOperation.h

saltData

The cached salt data, set only after fetching from the remote.

@property (nonatomic, retain) NSData *saltData

Declared In

TICDSApplicationRegistrationOperation.h

shouldCreateClientDirectory

Used mid-operation to indicate whether the client directory needs to be created after configuring encryption.

@property (nonatomic, assign) BOOL shouldCreateClientDirectory

Declared In

TICDSApplicationRegistrationOperation.h

Instance Methods

checkWhetherRemoteClientDeviceDirectoryExists

Check whether the client’s directory already exists in ClientDevices.

- (void)checkWhetherRemoteClientDeviceDirectoryExists

Discussion

This method must call discoveredStatusOfRemoteClientDeviceDirectory: to indicate the status.

Declared In

TICDSApplicationRegistrationOperation.h

checkWhetherRemoteGlobalAppDirectoryExists

Check whether a directory exists for this application.

- (void)checkWhetherRemoteGlobalAppDirectoryExists

Discussion

This method must call discoveredStatusOfGlobalAppDirectory: to indicate the status.

Declared In

TICDSApplicationRegistrationOperation.h

checkWhetherSaltFileExists

Check whether the salt.ticdsync file exists at the root of the application’s remote directory.

- (void)checkWhetherSaltFileExists

Discussion

This method must call discoveredStatusOfSaltFile: to indicate the status.

Declared In

TICDSApplicationRegistrationOperation.h

copiedReadMeTxtFileToRootOfGlobalAppDirectoryWithSuccess:

Indicate whether the ReadMe.txt file was copied from the bundle.

- (void)copiedReadMeTxtFileToRootOfGlobalAppDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the ReadMe.txt file was copied, otherwise NO.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

copyReadMeTxtFileToRootOfGlobalAppDirectoryFromPath:

Copy the ReadMe.txt file from the bundle to the root of this application’s remote directory.

- (void)copyReadMeTxtFileToRootOfGlobalAppDirectoryFromPath:(NSString *)aPath

Parameters

aPath

The local path to the ReadMe.txt file.

Discussion

This method must call copiedReadMeTxtFileToRootOfGlobalAppDirectoryWithSuccess: to indicate whether the copy was successful.

Declared In

TICDSApplicationRegistrationOperation.h

createRemoteClientDeviceDirectory

Create the client’s directory in ClientDevices.

- (void)createRemoteClientDeviceDirectory

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

createRemoteGlobalAppDirectoryStructure

Create global application directory structure.

- (void)createRemoteGlobalAppDirectoryStructure

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

createdRemoteClientDeviceDirectoryWithSuccess:

Indicate whether the client’s directory was created successful in ClientDevices.

- (void)createdRemoteClientDeviceDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the client’s directory was created, otherwise NO.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

createdRemoteGlobalAppDirectoryStructureWithSuccess:

Indicate whether the creation of the global app directory structure was successful.

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

TICDSApplicationRegistrationOperation.h

discoveredStatusOfRemoteGlobalAppDirectory:

Indicate the status of the global application directory.

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

TICDSApplicationRegistrationOperation.h

discoveredStatusOfSaltFile:

Indicate the status of the salt.ticdsync file.

- (void)discoveredStatusOfSaltFile:(TICDSRemoteFileStructureExistsResponseType)status

Parameters

status

The status of the file: 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

TICDSApplicationRegistrationOperation.h

fetchPasswordTestData

Fetch the test data from the test.ticdsync file in the Encryption directory.

- (void)fetchPasswordTestData

Discussion

This method must call fetchedPasswordTestData: when done.

Declared In

TICDSApplicationRegistrationOperation.h

fetchSaltData

Fetch the data from the salt.ticdsync file.

- (void)fetchSaltData

Discussion

This method must call `` when the data has been fetched.

Declared In

TICDSApplicationRegistrationOperation.h

fetchedPasswordTestData:

Provide the test data from the test.ticdsync file.

- (void)fetchedPasswordTestData:(NSData *)testData

Parameters

testData

The NSData contents of the test.ticdsync file, or nil if an error occurred.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

fetchedSaltData:

Provide the data from the salt.ticdsync file.

- (void)fetchedSaltData:(NSData *)saltData

Parameters

saltData

The NSData contents of the salt.ticdsync file, or nil if an error occurred.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

initWithDelegate:

Initialize an application registration operation using a delegate that supports the TICDSApplicationRegistrationOperationDelegate protocol.

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

Parameters

aDelegate

The delegate to use for this operation.

Return Value

An initialized document registration operation.

Declared In

TICDSApplicationRegistrationOperation.h

savePasswordTestData:

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 *)testData

Parameters

testData

The data to be saved.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

saveRemoteClientDeviceInfoPlistFromDictionary:

Save the dictionary to a deviceInfo.plist file in this client’s directory inside the ClientDevices directory.

- (void)saveRemoteClientDeviceInfoPlistFromDictionary:(NSDictionary *)aDictionary

Parameters

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.h

saveSaltDataToRemote:

Save the salt data to a salt.ticdsync file at the root of the application’s remote directory.

- (void)saveSaltDataToRemote:(NSData *)saltData

Parameters

saltData

The data to be saved.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

savedPasswordTestDataWithSuccess:

Indicate whether the test data was saved successfuly.

- (void)savedPasswordTestDataWithSuccess:(BOOL)success

Parameters

success

YES if the test.ticdsync file was saved, otherwise NO.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

savedRemoteClientDeviceInfoPlistWithSuccess:

Indicate whether the deviceInfo.plist file was saved successfully.

- (void)savedRemoteClientDeviceInfoPlistWithSuccess:(BOOL)success

Parameters

success

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

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h

savedSaltDataToRootOfGlobalAppDirectoryWithSuccess:

Indicate whether the salt data was saved successfully.

- (void)savedSaltDataToRootOfGlobalAppDirectoryWithSuccess:(BOOL)success

Parameters

success

YES if the salt.ticdsync file was saved, otherwise NO.

Discussion

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

Declared In

TICDSApplicationRegistrationOperation.h