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
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 |
---|---|
FluentHelperT |
cachingMetadata()
Enables tenant-isolated caching of the metadata document of an OData API.
|
abstract ResultT |
execute(HttpDestinationProperties destination) |
protected abstract Class<? extends EntityT> |
getEntityClass()
Returns a class object of the type this fluent helper works with.
|
protected Map<String,String> |
getHeadersForRequestAndImplicitRequests()
A map containing the headers to be used for all implicit requests that are part of this FluentHelper
implementation (metadata, csrf, ...).
|
protected Map<String,String> |
getHeadersForRequestOnly()
A map containing the headers to be used only for the actual request of this FluentHelper implementation.
|
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() |
FluentHelperCustomHttpHeader<FluentHelperT> |
withHeader(String key,
String value)
Gives the option to specify custom HTTP headers.
|
FluentHelperCustomHttpHeader<FluentHelperT> |
withHeaders(Map<String,String> map)
Gives the option to specify a map of custom HTTP headers.
|
FluentHelperT |
withoutCachingMetadata()
Disables caching of the metadata document of OData APIs.
|
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 public abstract ResultT execute(@Nonnull HttpDestinationProperties destination) throws com.sap.cloud.sdk.odatav2.connectivity.ODataException
com.sap.cloud.sdk.odatav2.connectivity.ODataException
@Nonnull public FluentHelperCustomHttpHeader<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 FluentHelperCustomHttpHeader<FluentHelperT> withHeaders(@Nonnull Map<String,String> map)
map
- A map of HTTP header key/value pairs.@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
- Value of the query parameter.@Nullable protected String getVersionIdentifier(@Nonnull com.sap.cloud.sdk.odatav2.connectivity.internal.ODataHttpResponseWrapper response)
@Nonnull @Beta public FluentHelperT cachingMetadata()
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 @Beta public FluentHelperT withoutCachingMetadata()
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()
protected Map<String,String> getHeadersForRequestAndImplicitRequests()
protected Map<String,String> getHeadersForRequestOnly()
Copyright © 2019 SAP SE. All rights reserved.