QueryT
- The type of the query to execute.QueryResultT
- The type of the result to return.public class HttpRequestExecutor<QueryT extends Query<QueryT,QueryResultT>,QueryResultT extends QueryResult<QueryT,QueryResultT>> extends Object
Constructor and Description |
---|
HttpRequestExecutor() |
Modifier and Type | Method and Description |
---|---|
QueryResultT |
execute(ErpConfigContext configContext,
QueryT query,
QuerySerializer<QueryT,QueryResultT> querySerializer)
Serializes the given query, executes it, and the deserializes the response.
|
String |
execute(ErpConfigContext configContext,
SerializedQuery<QueryT> serializedQuery)
Executes the given
serializedQuery as a HttpUriRequest , returning the body of the
HttpResponse received. |
QueryExecutionMeasurements |
getMeasurements() |
protected com.sap.cloud.sdk.s4hana.connectivity.HttpRequestExecutor.RequestBodyWithHeader |
getRequestBodyWithHeader(ErpConfigContext configContext,
SerializedQuery<QueryT> query)
Returns a wrapper object which encapsulates the HTTP request body and headers.
|
protected URI |
getRequestUri(ErpConfigContext configContext,
Destination destination,
SerializedQuery<QueryT> serializedQuery) |
@Nonnull public QueryResultT execute(@Nonnull ErpConfigContext configContext, @Nonnull QueryT query, @Nonnull QuerySerializer<QueryT,QueryResultT> querySerializer) throws QuerySerializationException, QueryExecutionException, DestinationNotFoundException, DestinationAccessException
configContext
- The ErpConfigContext
of this call.query
- The Query
to be executed.querySerializer
- The QuerySerializer
to be used to write the query and read the response.QuerySerializationException
- If the query could not be serializedQueryExecutionException
- If any Exception occured during execution of the query.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 ErpConfigContext configContext, @Nonnull Destination destination, @Nonnull SerializedQuery<QueryT> serializedQuery)
@Nonnull public String execute(@Nonnull ErpConfigContext configContext, @Nonnull SerializedQuery<QueryT> serializedQuery) throws QuerySerializationException, QueryExecutionException, DestinationNotFoundException, DestinationAccessException
serializedQuery
as a HttpUriRequest
, returning the body of the
HttpResponse
received.configContext
- The ErpConfigContext
of this call.serializedQuery
- The SerializedQuery
to execute.QuerySerializationException
- If the query could not be serialized.QueryExecutionException
- If any Exception occured during execution of the query.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.HttpRequestExecutor.RequestBodyWithHeader getRequestBodyWithHeader(ErpConfigContext configContext, @Nonnull SerializedQuery<QueryT> query)
configContext
- The ErpConfigContext
of this call.query
- The Query
to be executed.public QueryExecutionMeasurements getMeasurements()
Copyright © 2019 SAP SE. All rights reserved.