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 |
---|---|
ODataRequestCommand<ResultT> |
asResilientCommand()
This method will take the OData requests on which it is called and return an
ODataRequestCommand that
wraps the request. |
ODataRequestCommand<ResultT> |
asResilientCommand(ErpConfigContext configContext)
This method will take the OData requests on which it is called and return an
ODataRequestCommand that
wraps the request and will use the given ERP configuration context for executing the request. |
ResultT |
execute()
Executes the underlying query using the stored values, plus any query modifiers that were previously called.
|
abstract ResultT |
execute(ErpConfigContext configContext)
Executes the underlying query using the stored values, plus any query modifiers that were previously called.
|
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 header 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 header 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) |
FluentHelperCustomHttpHeader<FluentHelperT> |
withCustomHttpHeader(String key,
String value)
Gives the option to specify custom HTTP headers.
|
FluentHelperCustomHttpHeader<FluentHelperT> |
withCustomHttpHeaders(Map<String,String> map)
Gives the option to specify a map of custom HTTP headers.
|
@Nonnull protected abstract Class<? extends EntityT> getEntityClass()
@Nonnull protected FluentHelperT getThis()
public abstract ResultT execute(@Nonnull ErpConfigContext configContext) throws com.sap.cloud.sdk.odatav2.connectivity.ODataException
configContext
- Supply the ERP system context for executing the underlying OData query.com.sap.cloud.sdk.odatav2.connectivity.ODataException
ErpConfigContext.ErpConfigContext()
public ResultT execute() throws com.sap.cloud.sdk.odatav2.connectivity.ODataException
com.sap.cloud.sdk.odatav2.connectivity.ODataException
ErpConfigContext.ErpConfigContext()
@Nonnull public FluentHelperCustomHttpHeader<FluentHelperT> withCustomHttpHeader(@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> withCustomHttpHeaders(@Nonnull Map<String,String> map)
map
- A map of HTTP header key/value pairs.@Nullable protected String getVersionIdentifier(@Nonnull com.sap.cloud.sdk.odatav2.connectivity.internal.ODataHttpResponseWrapper response)
@Nonnull public ODataRequestCommand<ResultT> asResilientCommand(@Nonnull ErpConfigContext configContext)
ODataRequestCommand
that
wraps the request and will use the given ERP configuration context for executing the request. Note, that the
command returned by this method has no fallback configured. You can do so by using the method
ODataRequestCommand.withFallback(Function)
.configContext
- Supply the ERP system context for executing the underlying OData query.@Nonnull public ODataRequestCommand<ResultT> asResilientCommand()
ODataRequestCommand
that
wraps the request. The command will use the default ERP configuration context. Note, that the command returned by
this method has no fallback configured. You can do so by using the function
ODataRequestCommand.withFallback(Function)
.protected Map<String,String> getHeadersForRequestAndImplicitRequests()
Copyright © 2018 SAP SE. All rights reserved.