Class ODataRequestBatch
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestBatch
- All Implemented Interfaces:
ODataRequestExecutable
The OData Batch request.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
The Changeset representation of the OData Batch operation. -
Field Summary
Fields inherited from class com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
csrfTokenRetriever, resourcePath, servicePath
-
Constructor Summary
ConstructorDescriptionODataRequestBatch
(String servicePath, ODataProtocol protocol) Default constructor for OData Batch request.ODataRequestBatch
(String servicePath, ODataProtocol protocol, Supplier<UUID> uuidProvider) Default constructor for OData Batch request. -
Method Summary
Modifier and TypeMethodDescriptionaddFunction
(ODataRequestFunction request) Add an OData Function request to the current OData Batch request.addRead
(ODataRequestRead request) Add an OData Read request to the current OData Batch request.addReadByKey
(ODataRequestReadByKey request) Add an OData Read-By-Key request to the current OData Batch request.Instantiate a new changeset to the current OData Batch request.protected boolean
boolean
execute
(org.apache.http.client.HttpClient httpClient) Execute the OData request with the provided HttpClient reference.Get the list of headers that will be sent with this request.getRelativeUri
(UriEncodingStrategy strategy) Get the static request URI of the OData resource.List<com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestBatch.BatchItem>
int
hashCode()
Methods inherited from class com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
addHeader, addHeaderIfAbsent, addListener, addQueryParameter, getListeners, getProtocol, getQueryParameters, getRelativeUri, getRequestQuery, getResourcePath, getServicePath, setCsrfTokenRetriever, setHeader, setHeader, tryExecute, tryExecuteWithCsrfToken
-
Constructor Details
-
ODataRequestBatch
Default constructor for OData Batch request. The service path will be URL-encoded during request serialization.- Parameters:
servicePath
- The unencoded OData service pathprotocol
- The OData protocol
-
ODataRequestBatch
public ODataRequestBatch(@Nonnull String servicePath, @Nonnull ODataProtocol protocol, @Nonnull Supplier<UUID> uuidProvider) Default constructor for OData Batch request. The service path will be URL-encoded during request serialization.- Parameters:
servicePath
- The unencoded OData service pathprotocol
- The OData protocoluuidProvider
- A generic UUID provider, customizable for testing
-
-
Method Details
-
getRelativeUri
Description copied from class:ODataRequestGeneric
Get the static request URI of the OData resource.- Specified by:
getRelativeUri
in classODataRequestGeneric
- Parameters:
strategy
- URI encoding strategy.- Returns:
- The String representation of the request URI.
-
addRead
Add an OData Read request to the current OData Batch request.- Parameters:
request
- The Read request.- Returns:
- The Batch request fluent helper instance.
-
addReadByKey
Add an OData Read-By-Key request to the current OData Batch request.- Parameters:
request
- The Read-By-Key request.- Returns:
- The Batch request fluent helper instance.
-
addFunction
Add an OData Function request to the current OData Batch request.- Parameters:
request
- The Function request.- Returns:
- The Batch request fluent helper instance.
-
beginChangeset
Instantiate a new changeset to the current OData Batch request. As per specification if any data modifying operation fails within one changeset, then the incomplete changes will be reverted.- Returns:
- A new Changeset fluent helper instance.
-
execute
@Nonnull public ODataRequestResultMultipartGeneric execute(@Nonnull org.apache.http.client.HttpClient httpClient) Description copied from interface:ODataRequestExecutable
Execute the OData request with the provided HttpClient reference.- Parameters:
httpClient
- The HttpClient.- Returns:
- An OData request result.
-
getHeaders
Description copied from class:ODataRequestGeneric
Get the list of headers that will be sent with this request. To add headers, please useaddHeader
andaddHeaderIfAbsent
- Overrides:
getHeaders
in classODataRequestGeneric
- Returns:
- The list of headers.
-
getRequests
@Nonnull public List<com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestBatch.BatchItem> getRequests() -
getContentId
-
getBatchUuid
-
getUuidProvider
-
equals
- Overrides:
equals
in classODataRequestGeneric
-
canEqual
- Overrides:
canEqual
in classODataRequestGeneric
-
hashCode
public int hashCode()- Overrides:
hashCode
in classODataRequestGeneric
-