RSDDataArchive

public protocol RSDDataArchive : AnyObject, NSObjectProtocol

A data archive is a class object that can be used to add multiple files to a zipped archive for upload as a package. The data archive could also be a service that implements the logic for uploading results where the results are sent individually. It is the responsibility of the developer who implements this protocol for their services to ensure that the data is cached (if offline) and to re-attempt upload of the encrypted results.

  • A unique identifier for this archive.

    Declaration

    Swift

    var identifier: String { get }
  • Identifier for this task that can be mapped back to a notification. This may be the same as the task identifier, or it might be that a task is scheduled multiple times per day, and the app needs to track what the scheduled timing is for the task.

    Declaration

    Swift

    var scheduleIdentifier: String? { get }
  • Should the data archive include inserting data for the given reserved filename?

    Declaration

    Swift

    func shouldInsertData(for filename: RSDReservedFilename) -> Bool
  • Method for adding data to an archive.

    Declaration

    Swift

    func insertDataIntoArchive(_ data: Data, manifest: RSDFileManifest) throws

    Parameters

    data

    The data to insert.

    manifest

    The file manifest for this data.

  • Mark the archive as completed.

    Declaration

    Swift

    func completeArchive(with metadata: RSDTaskMetadata) throws

    Parameters

    metadata

    The metadata for this archive.

  • Returns an archivable object for the given result.

    Declaration

    Swift

    func archivableData(for result: RSDResult, sectionIdentifier: String?, stepPath: String?) -> RSDArchivable?

    Parameters

    result

    The result to archive.

    sectionIdentifier

    The section identifier for the task.

    stepPath

    The full step path to the given result.

    Return Value

    An archivable object or nil if the result should be skipped.