@Beta public class BatchRequestBuilder extends Object
Constructor and Description |
---|
BatchRequestBuilder(String servicePath)
Instantiates this request builder using the given service path to send the requests.
|
Modifier and Type | Method and Description |
---|---|
BatchRequestBuilder |
addChangeset(ModificationRequestBuilder<?>... operations)
Add modifying operations to the OData batch request as combined changeset.
|
BatchRequestBuilder |
addReadOperations(ReadRequestBuilder<?>... operations)
Add read operations to the OData batch request.
|
BatchResponse |
execute(HttpDestinationProperties destination)
Execute the OData request.
|
protected Map<String,String> |
getHeaders()
A map containing the headers to be used only for the actual request of this FluentHelper implementation.
|
protected List<ODataRequestListener> |
getListeners() |
protected Map<String,String> |
getParametersForRequestOnly()
A map containing the custom query parameters to be used only for the actual request of this FluentHelper
implementation.
|
protected ODataResourcePath |
getResourcePath() |
protected String |
getServicePath() |
protected BuilderT |
getThis()
Get the reference to this instance.
|
protected Supplier<UUID> |
getUuidProvider() |
ODataRequestBatch |
toRequest()
Assemble a generic, untyped request object that represents the request build up via this builder.
|
BuilderT |
withHeader(String key,
String value)
Gives the option to specify custom HTTP headers.
|
BuilderT |
withHeaders(Map<String,String> map)
Gives the option to specify a map of custom HTTP headers.
|
BuilderT |
withListener(ODataRequestListener listener)
An error handling class that implements the error result handler interface can be attached to this request
builder.
|
BuilderT |
withQueryParameter(String key,
String value)
Gives the option to specify custom query parameters for the request.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
tryExecute
@Nonnull public BatchRequestBuilder addReadOperations(@Nonnull ReadRequestBuilder<?>... operations)
operations
- A var-arg array of read operations.GetAllRequestBuilder
,
GetByKeyRequestBuilder
,
FunctionRequestBuilder
@Nonnull public BatchRequestBuilder addChangeset(@Nonnull ModificationRequestBuilder<?>... operations)
operations
- A var-arg array of modifying operations.CreateRequestBuilder
,
DeleteRequestBuilder
,
UpdateRequestBuilder
,
ActionRequestBuilder
@Beta @Nonnull public ODataRequestBatch toRequest()
RequestBuilder
ODataRequestGeneric
.@Nonnull public BatchResponse execute(@Nonnull HttpDestinationProperties destination)
RequestBuilderExecutable
destination
- The destination to be used as request target.@Nonnull protected BuilderT getThis()
@Nonnull @Beta public BuilderT withListener(@Nonnull ODataRequestListener listener)
execute
method. If
this method is not called, then an instance of ODataRequestListener is used. Only one handler can be attached at
a time per request builder object, so calling this multiple times will replace the handler.listener
- Instance of an error handler class that implements the error result handler interface.@Nonnull public BuilderT withHeader(@Nonnull String key, @Nullable String value)
RequestBuilder
withHeader
in interface RequestBuilder<ResultT>
key
- Name of the (first) desired HTTP header parameter.value
- Value of the (first) desired HTTP header parameter.@Nonnull public BuilderT withHeaders(@Nonnull Map<String,String> map)
RequestBuilder
withHeaders
in interface RequestBuilder<ResultT>
map
- A map of HTTP header key/value pairs.@Nonnull @Beta public BuilderT withQueryParameter(@Nonnull String key, @Nullable String value)
Note: It is recommended to only use this function for query parameters which are not supported by the VDM by default. Using this function to bypass request builder method calls can lead to unsupported response handling. There is no contract on the order or priority of parameters added to the request.
Example: Use the request query option $search
to reduce the result set, leaving
only entities which match the specified search expression. This feature is supported in protocol OData v4.
new DefaultBusinessPartnerService().getAllBusinessPartner().withQueryParameter("$search", "Köln OR Cologne")
key
- Name of the query parameter.value
- Value of the query parameter.@Nonnull protected ODataResourcePath getResourcePath()
@Nonnull protected Map<String,String> getHeaders()
@Nonnull protected Map<String,String> getParametersForRequestOnly()
@Nonnull protected List<ODataRequestListener> getListeners()
Copyright © 2021 SAP SE. All rights reserved.