package

com.sap.cloud.mobile.odata.offline

Provides Offline OData framework classes to add offline capability to the application.


The package depends on following packages

  • com.sap.cloud.mobile.foundation
  • com.sap.cloud.mobile.odata

The class OfflineODataProvider implements the com.sap.cloud.mobile.odata.DataServiceProvider interface and provides offline operations.

  • Error Archive

    Unlike Online OData where errors are discovered immediately, Offline OData errors are not discovered until the upload operation is performed. When a request fails against the OData backend during an upload operation, the request and any relevant details are stored in the ErrorArchive, a special entity set that can be queried using the OfflineODataProvider. Application developers must determine what to do for these errors.

    Example Usage:

     DataQuery query = new DataQuery().orderBy(OfflineODataErrorArchiveEntity.requestID);
     List<OfflineODataErrorArchiveEntity> errorEntities = offlineODataProvider.getErrorArchive(query);
     for (OfflineODataErrorArchiveEntity errorEntity : errorEntities) {
         dataService.loadProperty(OfflineODataErrorArchiveEntity.affectedEntity, errorEntity);
         EntityValue affectedEntity = OfflineODataErrorArchiveEntity.affectedEntity.getEntity(errorEntity);
         // process affected entity
     }
    
     // remove all errors
     if (!errorEntities.isEmpty()) {
         dataService.deleteEntity(errorEntities.get(0));
     }
     

  • EventLog

    Offline OData provides a queryable event log which contains information about Offline OData events (such as downloads and uploads). The event log is represented as a read-only entity set, EventLog, which can be read and queried using the OfflineODataProvider.

    Example Usage:

     DataQuery query = new DataQuery().
         select(OfflineODataEvent.id, OfflineODataEvent.eventType, OfflineODataEvent.details, OfflineODataEvent.time).
         orderBy(OfflineODataEvent.id);
     List<OfflineODataEvent> eventEntities = offlineODataProvider.getEventLog(query);
     for (OfflineODataEvent eventEntity : eventEntities) {
         // process event entity
     }
     

Classes

OfflineODataDefiningQuery A defining query is an OData read request that targets the OData backend associated with the 'OfflineODataProvider' and retrieves a subset of the OData backend data. 
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. 
OfflineODataErrorArchiveEntity

A built-in Offline OData entity type which stores information about a modification request which failed during an upload operation. 

OfflineODataEvent

A built-in Offline OData entity type which stores information about Offline OData events such as upload and download. 

OfflineODataFailedRequest The class represents the information of a failed request occurred at OData back end during an uploading. 
OfflineODataFileDownloadProgress The class represents the progress information during a download of file. 
OfflineODataMetadata The static named metadata for built-in entity sets ErrorArchive and EventLog, and their entity types. 
OfflineODataMetadata.EntitySets Offline OData built-in entity sets  
OfflineODataMetadata.EntityTypes Offline OData built-in entity types  
OfflineODataParameters The class represents the configuration details for an OfflineODataProvider. 
OfflineODataProgress The class represents the number of bytes sent and received during a download or upload. 
OfflineODataProvider The class represents a DataServiceProvider for Offline OData. 
OfflineODataQueryFunction The class provides Offline OData specific QueryFilter. 
OfflineODataRequest

A built-in Offline OData entity type which stores information about Offline OData requests to the backend service. 

OfflineODataRequestOptions The class provides Offline OData specific request options. 
OfflineODataRequestOptions.TransactionID The class represents a TransactionID instance. 
OfflineODataRequestOptions.UploadCategory The class represents an UploadCategory instance. 
OfflineODataSendStoreProgress This class represents the progress of sending the offline store. 
OfflineODataServiceOptions The class represents the options for the OData back end used by OfflineODataProvider. 

Enums

Exceptions

OfflineODataException The class represents an exception occurred at OfflineODataProvider operation.