FluentHelperT
- The fluent helper type.ObjectT
- The type of the object this OData request operates on, if any.ResultT
- The type of the result entity, if any.public abstract class FluentHelperFunction<FluentHelperT,ObjectT,ResultT> extends FluentHelperBasic<FluentHelperT,ObjectT,ResultT>
executing
it.Constructor and Description |
---|
FluentHelperFunction(String servicePath)
Instantiates this fluent helper using the given service path to send the requests.
|
Modifier and Type | Method and Description |
---|---|
protected abstract org.apache.http.client.methods.HttpUriRequest |
createRequest(URI uri)
Creates a request for this function based on the given
URI . |
protected List<ObjectT> |
executeMultiple(ErpConfigContext configContext)
Default implementation for the case that this function retuns a collection of entries.
|
protected ObjectT |
executeSingle(ErpConfigContext configContext)
Default implementation for the case that this function returns a single type.
|
protected abstract String |
getFunctionName()
The exact name of the function to be called on the OData Endpoint.
|
protected abstract Map<String,Object> |
getParameters()
Getter for the map of parameters to be used in the function call.
|
asResilientCommand, asResilientCommand, cachingMetadata, execute, execute, getEntityClass, getHeadersForRequestAndImplicitRequests, getHeadersForRequestOnly, getParametersForRequestOnly, getServicePath, getThis, getVersionIdentifier, isCachingMetadata, withCustomHttpHeader, withCustomHttpHeaders, withCustomQueryParameter, withoutCachingMetadata
@Nonnull protected abstract Map<String,Object> getParameters()
The map maps the ODataName of a parameter to the corresponding value.
@Nonnull protected abstract String getFunctionName()
@Nonnull protected abstract org.apache.http.client.methods.HttpUriRequest createRequest(@Nonnull URI uri)
URI
.
Examples for such requests are HttpGet
and HttpPost
.
uri
- The URI
the request should target.@Nullable protected ObjectT executeSingle(@Nonnull ErpConfigContext configContext) throws com.sap.cloud.sdk.odatav2.connectivity.ODataException
This method can be used in subclasses to implement the FluentHelperBasic.execute(ErpConfigContext)
method.
configContext
- The configuration to run the function against.null
if the function did not return a
result.com.sap.cloud.sdk.odatav2.connectivity.ODataException
- If the execution of the function failed.@Nonnull protected List<ObjectT> executeMultiple(@Nonnull ErpConfigContext configContext) throws com.sap.cloud.sdk.odatav2.connectivity.ODataException
This method can be used in subclasses to implement the FluentHelperBasic.execute(ErpConfigContext)
method.
configContext
- The configuration to run the function against.com.sap.cloud.sdk.odatav2.connectivity.ODataException
- If the execution of the function failed.Copyright © 2019 SAP SE. All rights reserved.