OfflineODataDelegate
public protocol OfflineODataDelegate
A delegate used to get progress updates while an OfflineODataProvider
is
opening, downloading, file downloading, uploading, and sending the store to server,
to get state change notifications, and to get information about requests that fail
during an upload.
-
Called every time there is an update while the
OfflineODataProvider
is performing a download.Generally the SAPOfflineOData framework and mobile services communicate through a sequence of proprietary commands while performing a download. This is the typical communication when performing a download to retrieve the delta from the backend. This function updates the progress of that communication.
During the download processing, mobile services MAY decide to send a new offline store in its entirety via a file download. For progress on the file transfer itself see
offlineODataProvider(_:didUpdateFileDownloadProgress:)
.Declaration
Swift
func offlineODataProvider(_ provider: OfflineODataProvider, didUpdateDownloadProgress progress: OfflineODataProgress)
Parameters
provider
The
OfflineODataProvider
whose download progress has been updated.progress
The progress update.
-
Called every time there is an update while downloading an offline store via a file download.
A new offline store is always received via a file download the first time the
OfflineODataProvider
is opened. On subsequent downloads (OfflineODataProvider.download(completionHandler:)
) a new offline store will be sent via a file download if a change to the metadata is detected or if a delta link expired.Declaration
Swift
func offlineODataProvider(_ provider: OfflineODataProvider, didUpdateFileDownloadProgress progress: OfflineODataFileDownloadProgress)
Parameters
provider
The
OfflineODataProvider
whose file download progress has been updated.progress
The progress update.
-
Called every time there is an update while the provider is uploading.
Declaration
Swift
func offlineODataProvider(_ provider: OfflineODataProvider, didUpdateUploadProgress progress: OfflineODataProgress)
Parameters
provider
The
OfflineODataProvider
whose upload progress has been updated.progress
The progress update.
-
Called once for each request that fails against the OData backend during an upload.
Note that the upload operation will report a successful result even if some requests have failed against the OData backend.
Declaration
Swift
func offlineODataProvider(_ provider: OfflineODataProvider, requestDidFail request: OfflineODataFailedRequest)
Parameters
provider
The
OfflineODataProvider
that was performing the upload.request
Information about the failed request.
-
Called whenever the store state changes.
Declaration
Swift
func offlineODataProvider(_ provider: OfflineODataProvider, stateDidChange newState: OfflineODataStoreState)
Parameters
provider
The
OfflineODataProvider
whose state has changed.newState
The new state.
-
offlineODataProvider(_:didUpdateSendStoreProgress:)
Default implementationCalled every time there is an update while the provider is sending the offline store to server.
Default Implementation
Called every time there is an update while the provider is sending the offline store to server.
Declaration
Swift
func offlineODataProvider(_ provider: OfflineODataProvider, didUpdateSendStoreProgress progress: OfflineODataSendStoreProgress)
Parameters
provider
The
OfflineODataProvider
whose send store progress has been updated.progress
The progress update.