ResearchKit / AppCore

Core code shared by the initial ResearchKit apps.
Other
262 stars 82 forks source link

Encapsulate upload classes and provide data verification daemon #95

Closed ghost closed 9 years ago

ghost commented 9 years ago

Objectives

The procedure for uploading a file is as follows:

  1. Initialize APCDataArchive with a reference that will be the directory name in the temporary directory.
  2. Insert files into the archive
  3. Initialize an APCDataArchiveUploader and call encryptAndUploadArchive()
  4. APCDataArchiveUploader uses composition of APCDataEncryptor, APCDataVerificationClient, and APCDataUploader to upload the data.
  5. 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.

Sequence Diagram

uploadsequencediagram

Class Diagram

uploadclassdiagram
YuanZhu-apple commented 9 years ago

r=me, merged.