public abstract class Request<RequestT extends Request<RequestT,RequestResultT>,RequestResultT extends RequestResult<RequestT,RequestResultT>> extends Object
Modifier | Constructor and Description |
---|---|
protected |
Request() |
Modifier and Type | Method and Description |
---|---|
abstract RequestResultT |
execute(Destination destination)
Executes a given request using the given
Destination . |
abstract String |
getConstructedByMethod() |
List<Header> |
getCustomHttpHeaders()
Set of HTTP headers to send to the underlying request executor.
|
Duration |
getLongRunningRequestThreshold()
Custom execution duration threshold indicating that the request is long running.
|
String |
getReadAccessData() |
long |
getRequestId()
Represents an identifier that allows to correlate queries between the Cloud cloudplatform and the ERP.
|
protected RequestT |
getThis() |
void |
setLongRunningRequestThreshold(Duration longRunningRequestThreshold)
Custom execution duration threshold indicating that the request is long running.
|
RequestT |
withHeader(Header header)
Fluent method which adds a custom header to this request.
|
RequestT |
withHeader(String name,
String value)
Fluent method which adds a custom HTTP header to this request.
|
RequestT |
withSameCustomHttpHeadersAs(Request<?,?> otherRequest)
Fluent method which adds the custom headers from another request into this request.
|
@Nonnull public abstract String getConstructedByMethod()
@Nullable public String getReadAccessData()
@Nonnull public RequestT withHeader(@Nonnull String name, @Nullable String value)
name
- Header parameter name.value
- Header parameter value.Request
instance, so that this method can be used again in a fluent API style.@Nonnull public RequestT withHeader(@Nonnull Header header)
header
- The custom header.Request
instance, so that this method can be used again in a fluent API style.@Nonnull public RequestT withSameCustomHttpHeadersAs(@Nonnull Request<?,?> otherRequest)
otherRequest
- Other request to get header parameters from.Request
instance, so that this method can be used again in a fluent API style.@Nonnull public abstract RequestResultT execute(@Nonnull Destination destination) throws RequestSerializationException, RequestExecutionException, DestinationNotFoundException, DestinationAccessException
Destination
.destination
- The Destination
to be used for request execution.RequestSerializationException
- If there is an issue while serializing the request.RequestExecutionException
- If there is an issue while executing the request.DestinationNotFoundException
- If no destination with the name specified in the Destination
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.