FluentHelperT
- The fluent helper type.EntityT
- The type of the entity this OData request operates on, if any.ResultT
- The type of the result entity, if any.public abstract class FluentHelperBasic<FluentHelperT,EntityT,ResultT> extends Object implements FluentHelperCustomHttpHeader<FluentHelperT>, FluentHelperExecutable<Object>
executing
it.Constructor and Description |
---|
FluentHelperBasic(String servicePath)
Instantiates this fluent helper using the given service path to send the requests.
|
Modifier and Type | Method and Description |
---|---|
FluentHelperCustomHttpHeader<FluentHelperT> |
and(String headerName,
String headerValue)
Deprecated.
Use
withHeader(String, String) instead. |
FluentHelperT |
cachingMetadata()
Deprecated.
Obsolete, as calling the improved method
executeRequest avoids metadata retrieval. |
abstract ResultT |
execute(HttpDestinationProperties destination)
Deprecated.
Use the improved method
executeRequest(HttpDestinationProperties) instead. |
abstract Object |
executeRequest(HttpDestinationProperties destination)
Executes this request.
|
protected abstract Class<? extends EntityT> |
getEntityClass()
Returns a class object of the type this fluent helper works with.
|
protected Map<String,String> |
getHeaders()
Get all headers for explicit and implicit requests.
|
protected Map<String,String> |
getHeadersForRequestAndImplicitRequests()
Deprecated.
Use
getHeaders() instead. |
protected Map<String,String> |
getHeadersForRequestOnly()
Deprecated.
Use
getHeaders() instead. |
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 String |
getServicePath() |
protected FluentHelperT |
getThis() |
protected String |
getVersionIdentifier(com.sap.cloud.sdk.odatav2.connectivity.internal.ODataHttpResponseWrapper response) |
protected boolean |
isCachingMetadata() |
FluentHelperT |
onRequestAndImplicitRequests()
Deprecated.
Headers will be always applied for both: explicit and implicit request. The distinction between
actual request and CSRF token request has been dropped. Use only
withHeader(String, String) or withHeaders(Map) . |
FluentHelperT |
onRequestOnly()
Deprecated.
Headers will be always applied for both: explicit and implicit request. The distinction between
actual request and CSRF token request has been dropped. Use only
withHeader(String, String) or withHeaders(Map) . |
FluentHelperT |
withHeader(String key,
String value)
Gives the option to specify custom HTTP headers.
|
FluentHelperT |
withHeaders(Map<String,String> map)
Gives the option to specify a map of custom HTTP headers.
|
FluentHelperT |
withoutCachingMetadata()
Deprecated.
Obsolete, as calling the improved method
executeRequest avoids metadata retrieval. |
protected FluentHelperT |
withQueryParameter(String key,
String value)
Gives the option to specify custom query parameters for the request.
|
@Nonnull protected abstract Class<? extends EntityT> getEntityClass()
@Nonnull protected FluentHelperT getThis()
@Nullable @Deprecated public abstract ResultT execute(@Nonnull HttpDestinationProperties destination) throws com.sap.cloud.sdk.odatav2.connectivity.ODataException
executeRequest(HttpDestinationProperties)
instead.destination
- The destination to use for the request.com.sap.cloud.sdk.odatav2.connectivity.ODataException
- The exception occurred during request execution@Nullable public abstract Object executeRequest(@Nonnull HttpDestinationProperties destination)
Note: This is an alternative to execute(HttpDestinationProperties)
. Contrary to
execute(HttpDestinationProperties)
this operation does not request the service metadata before
performing the actual request. As a consequence withoutCachingMetadata()
and cachingMetadata()
have no effect on this operation. Furthermore, error handlers registered via
FluentHelperRead.withErrorHandler(ErrorResultHandler)
will not be respected.
executeRequest
in interface FluentHelperExecutable<Object>
destination
- The target system this request should be issued against.@Deprecated protected Map<String,String> getHeadersForRequestOnly()
getHeaders()
instead.@Deprecated protected Map<String,String> getHeadersForRequestAndImplicitRequests()
getHeaders()
instead.protected Map<String,String> getHeaders()
@Nonnull public FluentHelperT withHeader(@Nonnull String key, @Nullable String value)
key
- Name of the (first) desired HTTP header parameter.value
- Value of the (first) desired HTTP header parameter.@Nonnull public FluentHelperT withHeaders(@Nonnull Map<String,String> map)
map
- A map of HTTP header key/value pairs.@Deprecated @Nonnull public FluentHelperCustomHttpHeader<FluentHelperT> and(@Nonnull String headerName, @Nullable String headerValue)
withHeader(String, String)
instead.and
in interface FluentHelperCustomHttpHeader<FluentHelperT>
headerName
- The header name to add.headerValue
- The header value to add.@Deprecated @Nonnull public FluentHelperT onRequestAndImplicitRequests()
withHeader(String, String)
or withHeaders(Map)
.onRequestAndImplicitRequests
in interface FluentHelperCustomHttpHeader<FluentHelperT>
@Deprecated @Nonnull public FluentHelperT onRequestOnly()
withHeader(String, String)
or withHeaders(Map)
.onRequestOnly
in interface FluentHelperCustomHttpHeader<FluentHelperT>
@Nonnull protected FluentHelperT 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 fluent helper method calls can lead to unsupported response handling. There is no contract on the order or priority of parameters added to the query.
Example: Use the 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
- Unencoded value of the query parameter.@Nullable protected String getVersionIdentifier(@Nonnull com.sap.cloud.sdk.odatav2.connectivity.internal.ODataHttpResponseWrapper response)
@Nonnull @Deprecated public FluentHelperT cachingMetadata()
executeRequest
avoids metadata retrieval.Enables tenant-isolated caching of the metadata document of an OData API. That is, the metadata is not retrieved again for subsequent calls, after it was fetched once.
Only use this caching when the metadata does not get updated during the application runs.
By default, the caching is disabled.
Use withoutCachingMetadata()
to disable the metadata caching.
@Nonnull @Deprecated public FluentHelperT withoutCachingMetadata()
executeRequest
avoids metadata retrieval.Disables caching of the metadata document of OData APIs. That is, the metadata is retrieved along with every OData request.
By default, the caching is disabled.
Use cachingMetadata
to enable the metadata caching.
protected boolean isCachingMetadata()
Copyright © 2021 SAP SE. All rights reserved.