public abstract class Query<QueryT extends Query<QueryT,QueryResultT>,QueryResultT extends QueryResult<QueryT,QueryResultT>> extends Object
Modifier | Constructor and Description |
---|---|
protected |
Query() |
Modifier and Type | Method and Description |
---|---|
QueryResultT |
execute()
Executes a given query using the default
ErpConfigContext . |
abstract QueryResultT |
execute(ErpConfigContext configContext)
Executes a given query using the given
ErpConfigContext . |
abstract String |
getConstructedByMethod() |
List<Header> |
getCustomHttpHeaders()
Set of HTTP headers to send to the underlying query executor.
|
List<Header> |
getHeaderParameters()
Deprecated.
Use
getCustomHttpHeaders() instead. Will be removed in one of the next releases. |
Duration |
getLongRunningRequestThreshold()
Custom execution duration threshold indicating that the query is long running.
|
String |
getReadAccessData() |
long |
getRequestId()
Represents an identifier that allows to correlate queries between the Cloud cloudplatform and the ERP.
|
protected QueryT |
getThis() |
void |
setLongRunningRequestThreshold(Duration longRunningRequestThreshold)
Custom execution duration threshold indicating that the query is long running.
|
QueryT |
withCustomHttpHeader(Header header)
Fluent method which adds a custom header to this query.
|
QueryT |
withCustomHttpHeader(String name,
String value)
Fluent method which adds a custom HTTP header to this query.
|
QueryT |
withSameCustomHttpHeadersAs(Query<?,?> otherQuery)
Fluent method which adds the custom headers from another query into this query.
|
@Nonnull public abstract String getConstructedByMethod()
@Nullable public String getReadAccessData()
@Deprecated @Nonnull public List<Header> getHeaderParameters()
getCustomHttpHeaders()
instead. Will be removed in one of the next releases.@Nonnull public QueryT withCustomHttpHeader(@Nonnull String name, @Nullable String value)
name
- Header parameter name.value
- Header parameter value.Query
instance, so that this method can be used again in a fluent API style.@Nonnull public QueryT withCustomHttpHeader(@Nonnull Header header)
header
- The custom header.Query
instance, so that this method can be used again in a fluent API style.@Nonnull public QueryT withSameCustomHttpHeadersAs(@Nonnull Query<?,?> otherQuery)
otherQuery
- Other query to get header parameters from.Query
instance, so that this method can be used again in a fluent API style.@Nonnull public abstract QueryResultT execute(@Nonnull ErpConfigContext configContext) throws QuerySerializationException, QueryExecutionException, DestinationNotFoundException, DestinationAccessException
ErpConfigContext
.configContext
- The ErpConfigContext
to be used for query execution.QuerySerializationException
- If there is an issue while serializing the query.QueryExecutionException
- If there is an issue while executing the query.DestinationNotFoundException
- If no destination with the name specified in the ErpConfigContext
can be found.DestinationAccessException
- If there is an issue while accessing destination information.@Nonnull public QueryResultT execute() throws QuerySerializationException, QueryExecutionException, DestinationNotFoundException, DestinationAccessException
ErpConfigContext
. The default ErpConfigContext
can be
instantiated with new ErpConfigContext()
.QuerySerializationException
- If there is an issue while serializing the query.QueryExecutionException
- If there is an issue while executing the query.DestinationNotFoundException
- If no destination with the name specified in the ErpConfigContext
can be found.DestinationAccessException
- If there is an issue while accessing destination information.public long getRequestId()
Important: The identifier does not provide any guarantees with respect to persistence across the application lifecycle. In particular, the identifier will be reset to 1 when restarting the application.
@Nullable public Duration getLongRunningRequestThreshold()
public void setLongRunningRequestThreshold(@Nullable Duration longRunningRequestThreshold)
Copyright © 2019 SAP SE. All rights reserved.