JsonEntityProvider

For internal use only.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val hasMetadata: Boolean
Link copied to clipboard
open override var metadata: CsdlDocument
Link copied to clipboard
open override val serviceName: String

Functions

Link copied to clipboard
open override fun createEntity(entity: EntityValue, headers: HttpHeaders, options: RequestOptions)

Create an entity in the target system. Automatically calls {@link com.sap.cloud.mobile.kotlin.odata.csdl.CsdlDocument#resolveEntity(com.sap.cloud.mobile.kotlin.odata.EntityValue) CsdlDocument.resolveEntity} to ensure that {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#entitySet EntityValue.entitySet} is available.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.DataServiceException} if the entity set hasn't been explicitly provided before calling createEntity and there isn't a unique entity set for the entity type.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.EntityValue#ofType(com.sap.cloud.mobile.kotlin.odata.EntityType, com.sap.cloud.mobile.kotlin.odata.core.SparseIndexMap?) EntityValue.ofType}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#inSet(com.sap.cloud.mobile.kotlin.odata.EntitySet) EntityValue.inSet}.

Link copied to clipboard
open override fun createLink(from: EntityValue, property: Property, to: EntityValue, headers: HttpHeaders, options: RequestOptions)

Create a link from a source entity to a target entity.

Link copied to clipboard
open override fun createMedia(entity: EntityValue, content: StreamBase, headers: HttpHeaders, options: RequestOptions)

Create a media entity with the specified content in the target system. If the entity has non-stream structural properties in addition to the key properties and media content, such as label in the examples below, then this function will send two requests to the server: a first request to upload (POST) the media stream, and a second request (PATCH/PUT) to update the non-stream properties. It is not currently supported to make these two calls atomic. Caution: Having too many threads simultaneously creating streams may result in out-of-memory conditions on memory-constrained devices.

Link copied to clipboard
open override fun deleteByQuery(query: DataQuery, headers: HttpHeaders, options: RequestOptions)

Execute query to delete data from the target system.

Link copied to clipboard
open override fun deleteEntity(entity: EntityValue, headers: HttpHeaders, options: RequestOptions)

Delete an entity from the target system.

Link copied to clipboard
open override fun deleteLink(from: EntityValue, property: Property, to: EntityValue, headers: HttpHeaders, options: RequestOptions)

Delete a link from a source entity to a target entity.

Link copied to clipboard
open override fun deleteStream(entity: EntityValue, link: StreamLink, headers: HttpHeaders, options: RequestOptions)

Delete the content of a stream property from the target system.

Link copied to clipboard
open override fun downloadMedia(entity: EntityValue, headers: HttpHeaders, options: RequestOptions): ByteStream

Obtain a stream for downloading the content of a media entity from the target system. Caution: streams are often used for large content that may not fit (all at once) in available application memory. Having too many threads simultaneously downloading streams, or using {@link com.sap.cloud.mobile.kotlin.odata.ByteStream#readAndClose() ByteStream.readAndClose}, may result in out-of-memory conditions on memory-constrained devices.

Link copied to clipboard
open override fun downloadStream(entity: EntityValue, link: StreamLink, headers: HttpHeaders, options: RequestOptions): ByteStream

Obtain a stream for downloading the content of a stream property from the target system. Caution: streams are often used for large content that may not fit (all at once) in available application memory. Having too many threads simultaneously downloading streams, or using {@link com.sap.cloud.mobile.kotlin.odata.ByteStream#readAndClose() ByteStream.readAndClose}, may result in out-of-memory conditions on memory-constrained devices.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.Property#getStreamLink(com.sap.cloud.mobile.kotlin.odata.StructureBase) Property.getStreamLink}.

Link copied to clipboard
open override fun executeMethod(method: DataMethod, parameters: ParameterList, headers: HttpHeaders, options: RequestOptions): DataValue?

Execute a data method (action or function) in the target system. Actions may have backend side-effects. Functions should not have backend side-effects.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.DataServiceException} or {@link com.sap.cloud.mobile.kotlin.odata.DataNetworkException} if an error occurs during action invocation.

Link copied to clipboard
open override fun executeQuery(query: DataQuery, headers: HttpHeaders, options: RequestOptions): QueryResult

Execute a data query to get data from the target system.

Link copied to clipboard
open override fun fetchMetadata(headers: HttpHeaders, options: RequestOptions): CsdlDocument

Fetch latest service metadata and return it, but don't change the {@link com.sap.cloud.mobile.kotlin.odata.JsonEntityProvider#metadata JsonEntityProvider.metadata} property.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.JsonEntityProvider#loadMetadata(com.sap.cloud.mobile.kotlin.odata.http.HttpHeaders, com.sap.cloud.mobile.kotlin.odata.RequestOptions) JsonEntityProvider.loadMetadata}.

Link copied to clipboard
open override fun loadMetadata(headers: HttpHeaders, options: RequestOptions)

Load service metadata (if not already loaded).

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.JsonEntityProvider#metadata JsonEntityProvider.metadata}, {@link com.sap.cloud.mobile.kotlin.odata.JsonEntityProvider#hasMetadata JsonEntityProvider.hasMetadata}.

Link copied to clipboard
open override fun pingServer(headers: HttpHeaders, options: RequestOptions)

Ping the server.

Link copied to clipboard
open override fun processBatch(batch: RequestBatch, headers: HttpHeaders, options: RequestOptions)

Execute a request batch in the target system.

Link copied to clipboard
open override fun unloadMetadata()

Unload service metadata (if previously loaded).

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.JsonEntityProvider#metadata JsonEntityProvider.metadata}, {@link com.sap.cloud.mobile.kotlin.odata.JsonEntityProvider#hasMetadata JsonEntityProvider.hasMetadata}.0

Link copied to clipboard
open override fun updateEntity(entity: EntityValue, headers: HttpHeaders, options: RequestOptions)

Update an entity in the target system.

Link copied to clipboard
open override fun updateLink(from: EntityValue, property: Property, to: EntityValue, headers: HttpHeaders, options: RequestOptions)

Update a link from a source entity to a target entity.

Link copied to clipboard
open override fun uploadMedia(entity: EntityValue, content: StreamBase, headers: HttpHeaders, options: RequestOptions)

Upload content for a media entity to the target system Caution: Having too many threads simultaneously uploading streams may result in out-of-memory conditions on memory-constrained devices. Note: this function cannot be used to create a media entity. See {@link com.sap.cloud.mobile.kotlin.odata.DataService#createMedia(com.sap.cloud.mobile.kotlin.odata.EntityValue, com.sap.cloud.mobile.kotlin.odata.StreamBase, com.sap.cloud.mobile.kotlin.odata.http.HttpHeaders?, com.sap.cloud.mobile.kotlin.odata.RequestOptions?) DataService.createMedia}.

Link copied to clipboard
open override fun uploadStream(entity: EntityValue, link: StreamLink, content: StreamBase, headers: HttpHeaders, options: RequestOptions)

Upload content for a stream property to the target system. Caution: Having too many threads simultaneously uploading streams may result in out-of-memory conditions on memory-constrained devices.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.Property#getStreamLink(com.sap.cloud.mobile.kotlin.odata.StructureBase) Property.getStreamLink}.