DBBatchUploadData

@interface DBBatchUploadData : NSObject

Stores data for a particular batch upload attempt.

  • The queue on which most response handling is performed.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSOperationQueue *_Nonnull queue;

    Swift

    var queue: OperationQueue { get }
  • The dispatch group that pairs upload requests with upload responses so that we can wait for all request/response pairs to complete before batch committing. In this way, we can start many upload requests (for files under the chunk limit), without waiting for the corresponding response.

    Declaration

    Objective-C

    @property (readonly, nonatomic) dispatch_group_t _Nonnull uploadGroup;

    Swift

    var uploadGroup: DispatchGroup { get }
  • A client-supplied parameter that maps the file urls of the files to upload to the corresponding commit info objects.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        NSDictionary<NSURL *, DBFILESCommitInfo *> *_Nonnull fileUrlsToCommitInfo;

    Swift

    var fileUrlsToCommitInfo: [URL : DBFILESCommitInfo] { get }
  • Mapping of urls for files that were unsuccessfully uploaded to any request errors that were encounted.

    Declaration

    Objective-C

    @property (readonly, atomic) NSMutableDictionary<NSURL *, DBRequestError *>
        *_Nonnull fileUrlsToRequestErrors;

    Swift

    var fileUrlsToRequestErrors: NSMutableDictionary { get }
  • List of finish args (which include commit info, cursor, etc.) which the SDK maintains and passes to upload_session/finish_batch.

    Declaration

    Objective-C

    @property (readwrite, strong, atomic)
        NSMutableArray<DBFILESUploadSessionFinishArg *> *_Nonnull finishArgs;

    Swift

    var finishArgs: NSMutableArray { get set }
  • The progress block that is periodically executed once a file upload is complete.

    Declaration

    Objective-C

    @property (readonly, nonatomic) DBProgressBlock _Nullable progressBlock;

    Swift

    var progressBlock: DBProgressBlock? { get }
  • The response block that is executed once all file uploads and the final batch commit is complete.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        DBBatchUploadResponseBlock _Nonnull responseBlock;

    Swift

    var responseBlock: DBBatchUploadResponseBlock { get }
  • The total size of all the files to upload. Used to return progress data to the client.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger totalUploadSize;

    Swift

    var totalUploadSize: UInt { get set }
  • The total size of all the file content upload so far. Used to return progress data to the client.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger totalUploadedSoFar;

    Swift

    var totalUploadedSoFar: UInt { get set }
  • The flag that determines whether upload continues or not.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) BOOL cancel;

    Swift

    var cancel: Bool { get set }
  • The container object that stores all upload / download task objects for cancelling.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) DBTasksStorage *_Nonnull taskStorage;

    Swift

    var taskStorage: DBTasksStorage { get set }
  • Full constructor.

    Declaration

    Objective-C

    - (nonnull instancetype)
    initWithFileCommitInfo:
        (nonnull NSDictionary<NSURL *, DBFILESCommitInfo *> *)fileUrlsToCommitInfo
             progressBlock:(DBProgressBlock _Nullable)progressBlock
             responseBlock:(nonnull DBBatchUploadResponseBlock)responseBlock
                     queue:(nonnull NSOperationQueue *)queue;

    Swift

    init(fileCommitInfo fileUrlsToCommitInfo: [URL : DBFILESCommitInfo], progressBlock: DBProgressBlock?, responseBlock: @escaping DBBatchUploadResponseBlock, queue: OperationQueue)

    Parameters

    fileUrlsToCommitInfo

    A client-supplied parameter that maps the file urls of the files to upload to the corresponding commit info objects.

    progressBlock

    The progress block that is periodically executed once a file upload is complete.

    responseBlock

    The response block that is executed once all file uploads and the final batch commit is complete.

    queue

    The queue on which most response handling is performed.

    Return Value

    An initialized instance.