Achieve functional and procedural cohesion by encapsulating components involved in the upload process that are responsible for archiving, encryption, upload, and data verification.
Implement a "Data Verification Daemon" which calls a url after a short delay to confirm validation of uploaded data.
Provide interfaces for components that enable the API's they wrap (such as OpenSSL) to be easily replaced in their implementation.
Provide completion blocks which pass errors from the API back to the caller.
Allow for encryption of data before insertion into an archive.
Demonstrate use of the encapsulated upload classes using APCDemographicUploader and AsthmaHealth (forthcoming pull request).
In APCDataArchive, provide methods to schematically derive filenames from ORKFileResult URL's which contain timestamps and unique path extensions.
The functionality provided by this package duplicates that already provided by APCDataArchiver, APCDataArchiverAndUploader, and Asthma's APHAirQualityDataModel. Forthcoming pull requests will replace upload code in APHAirQualityDataModel, and refactor APCBaseTaskViewController to use these components where possible.
Description
The procedure for uploading a file is as follows:
Initialize APCDataArchive with a reference that will be the directory name in the temporary directory.
Insert files into the archive
Initialize an APCDataArchiveUploader and call encryptAndUploadArchive()
APCDataArchiveUploader uses composition of APCDataEncryptor, APCDataVerificationClient, and APCDataUploader to upload the data.
APCDataUploader incorporates the APCDataVerificationDaemon to report back on data validation.
Data Verification Daemon
Implement a daemon as a global variable on APCAppDelegate that queues data verification URL's returned from Sage, and calls the URL for verification after a short delay. Daemon will output a message to the console after 5 seconds of the upload, confirming the upload and validating the data per the database schema.
Tests
Tested using APCDemographicUploader and Asthma Air Quality upload.
Objectives
Description
The procedure for uploading a file is as follows:
Data Verification Daemon
Implement a daemon as a global variable on APCAppDelegate that queues data verification URL's returned from Sage, and calls the URL for verification after a short delay. Daemon will output a message to the console after 5 seconds of the upload, confirming the upload and validating the data per the database schema.
Tests
Tested using APCDemographicUploader and Asthma Air Quality upload.
Sequence Diagram
Class Diagram