RequestT - The type of the request to execute.RequestResultT - The type of the result to return.public class ErpHttpRequestExecutor<RequestT extends Request<RequestT,RequestResultT>,RequestResultT extends RequestResult<RequestT,RequestResultT>> extends Object
| Constructor and Description |
|---|
ErpHttpRequestExecutor() |
| Modifier and Type | Method and Description |
|---|---|
RequestResultT |
execute(HttpDestination destination,
RequestT request,
RequestSerializer<RequestT,RequestResultT> requestSerializer)
Serializes the given request, executes it, and the deserializes the response.
|
String |
execute(HttpDestination destination,
SerializedRequest<RequestT> serializedRequest)
Executes the given
serializedRequest as a HttpUriRequest, returning the body of the
HttpResponse received. |
RequestExecutionMeasurements |
getMeasurements() |
protected com.sap.cloud.sdk.s4hana.connectivity.ErpHttpRequestExecutor.RequestBodyWithHeader |
getRequestBodyWithHeader(HttpDestination destination,
SerializedRequest<RequestT> request)
Returns a wrapper object which encapsulates the HTTP request body and headers.
|
protected URI |
getRequestUri(HttpDestination destination,
SerializedRequest<RequestT> serializedRequest)
Get the request URI.
|
@Nonnull public RequestResultT execute(@Nonnull HttpDestination destination, @Nonnull RequestT request, @Nonnull RequestSerializer<RequestT,RequestResultT> requestSerializer) throws RequestSerializationException, RequestExecutionException, DestinationNotFoundException, DestinationAccessException
destination - The HttpDestination of this call.request - The Request to be executed.requestSerializer - The RequestSerializer to be used to write the request and read the response.RequestSerializationException - If the request could not be serializedRequestExecutionException - If any Exception occured during execution of the request.DestinationNotFoundException - If the Destination cannot be found.DestinationAccessException - If the destination is not of type DestinationType.HTTP or there is an issue while accessing
destination information.@Nonnull protected URI getRequestUri(@Nonnull HttpDestination destination, @Nonnull SerializedRequest<RequestT> serializedRequest)
destination - The destination which is used for the HTTP request.serializedRequest - The serialized request payload.@Nonnull public String execute(@Nonnull HttpDestination destination, @Nonnull SerializedRequest<RequestT> serializedRequest) throws RequestSerializationException, RequestExecutionException, DestinationNotFoundException, DestinationAccessException
serializedRequest as a HttpUriRequest, returning the body of the
HttpResponse received.destination - The HttpDestination of this call.serializedRequest - The SerializedRequest to execute.RequestSerializationException - If the request could not be serialized.RequestExecutionException - If any Exception occured during execution of the request.DestinationNotFoundException - If the Destination cannot be found.DestinationAccessException - If the destination is not of type DestinationType.HTTP or there is an issue while accessing
destination information.@Nonnull protected com.sap.cloud.sdk.s4hana.connectivity.ErpHttpRequestExecutor.RequestBodyWithHeader getRequestBodyWithHeader(HttpDestination destination, @Nonnull SerializedRequest<RequestT> request)
destination - The HttpDestination of this call.request - The Request to be executed.public RequestExecutionMeasurements getMeasurements()
Copyright © 2022 SAP SE. All rights reserved.