public class BatchRequestBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
BatchRequestBuilder |
addChangeSet(ChangeSet changeSet)
Adds a change set request to the batch.
|
BatchRequestBuilder |
addQueryRequest(ODataQuery queryRequest)
Adds a query request to the batch.
|
BatchRequest |
build()
Builds an BatchRequest from this builder.
|
BatchRequestBuilder |
enableMetadataCache()
Enables caching of the metadata of an OData V2 data source.
|
BatchRequestBuilder |
enableMetadataCache(com.sap.cloud.sdk.cloudplatform.cache.CacheKey cacheKey)
Enables caching of the metadata of an OData V2 data source.
|
BatchRequestBuilder |
withCacheRefresh()
Replaces the existing metadata in the cache with the latest version from the OData V2 data source.
|
BatchRequestBuilder |
withErrorHandler(ErrorResultHandler<?> errorHandler)
Sets an error handler in this BatchRequestBuilder.
|
BatchRequestBuilder |
withHeader(String key,
String value)
Adds a header to the batch request.
|
BatchRequestBuilder |
withHeader(String key,
String value,
boolean passInAllRequests)
Adds a header to the batch request and optionally to the metadata request as well depending on the value of the
passInAllRequests parameter.
|
BatchRequestBuilder |
withMetadata(URL metadataFilePath)
Gets the metadata from the specified path.
|
static BatchRequestBuilder |
withService(String serviceName)
Specifies the service where the batch request will be executed.
|
public BatchRequest build()
public BatchRequestBuilder addQueryRequest(ODataQuery queryRequest)
queryRequest - Represents the query requestpublic BatchRequestBuilder addChangeSet(ChangeSet changeSet)
changeSet - Represents the change setpublic static BatchRequestBuilder withService(String serviceName)
serviceName - Name of the OData servicepublic BatchRequestBuilder withHeader(String key, String value)
key - name of the headervalue - value of the headerpublic BatchRequestBuilder withHeader(String key, String value, boolean passInAllRequests)
key - name of the headervalue - value of the headerpassInAllRequests - boolean indicating whether the header is to be passed in all the requests to the backend like $metadata call, CSRF Token fetch etc. made as part of the Create Request callpublic BatchRequestBuilder withErrorHandler(ErrorResultHandler<?> errorHandler)
errorHandler - public BatchRequestBuilder enableMetadataCache()
public BatchRequestBuilder enableMetadataCache(com.sap.cloud.sdk.cloudplatform.cache.CacheKey cacheKey)
key - Cache key containing the ID of the tenant where
the application runs. You can also include the user name and other parameters in the cache key.public BatchRequestBuilder withCacheRefresh()
public BatchRequestBuilder withMetadata(URL metadataFilePath)
metadataFilePath - URL pointing to the metadata informationCopyright © 2020 SAP. All Rights Reserved.