public class CDSDataProvider extends DataProvider implements AcceptsCSN, ODataOperationValidator
APPLICATIONUSER, XS_APPLICATIONUSER| Constructor and Description |
|---|
CDSDataProvider(com.sap.gateway.core.api.srvrepo.IServiceInfo service)
Initialize the ODataToCDSProcessor and the TransactionManager,decides whether transaction manager will be local transaction manager
or provided transaction manager.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkEtagStatusPass(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response) |
Object |
checkEtagValidations(com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response,
org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context) |
void |
cleanupTransaction() |
void |
commitTransaction() |
void |
computePageValues(org.apache.olingo.odata2.api.uri.UriInfo uriInfo) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
countDataCollectionFromMainTable(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
List<String> filters) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
countEntitySet(org.apache.olingo.odata2.api.uri.info.GetEntitySetCountUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
createEntity(org.apache.olingo.odata2.api.uri.info.PostUriInfo uriInfo,
org.apache.olingo.odata2.api.ep.entry.ODataEntry content,
String requestContentType,
org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties.ODataEntityProviderPropertiesBuilder providerPropertiesBuilder,
org.apache.olingo.odata2.api.processor.ODataContext context) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
createEntityMedia(org.apache.olingo.odata2.api.uri.info.PostUriInfo uriInfo,
InputStream content,
String requestContentType,
String slugType,
org.apache.olingo.odata2.api.processor.ODataContext context) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
deleteEntity(org.apache.olingo.odata2.api.uri.info.DeleteUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
boolean cascadeDelete) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
deleteEntityMedia(org.apache.olingo.odata2.api.uri.info.DeleteUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context) |
void |
executeEtagCheckForFunctionImport(org.apache.olingo.odata2.api.uri.info.GetFunctionImportUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context)
Checks whether the following conditions to execute a function are met:
1.
|
DataSourceParams |
getDataSource() |
DataSourceParams |
getDSParams() |
ExtensionHelper |
getExtensionHelper(org.apache.olingo.odata2.api.processor.ODataRequest request,
String namespace) |
CDSHandler |
getHandler(org.apache.olingo.odata2.api.processor.ODataRequest request,
String namespace) |
int |
getInlineCount(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
boolean mainTable) |
Long |
getPageSize(org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo uriInfo) |
TransactionParams |
getTSParams() |
Map<String,Object> |
getTypeMapping(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.ep.EntityProviderReadProperties readProperties,
org.apache.olingo.odata2.api.edm.EdmNavigationProperty navigationProperty) |
boolean |
isCreatable(String serviceName,
String entityName) |
boolean |
isDeletable(String serviceName,
String entityName) |
Boolean |
isDraftFlow() |
boolean |
isUpdatable(String serviceName,
String entityName) |
void |
populateEtagInHeaderFromResponse(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response) |
void |
populateUpdatedEntityinResponse(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response,
org.apache.olingo.odata2.api.ep.entry.ODataEntry content) |
List<Map<String,Object>> |
readDataCollectionFromMainTable(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
List<String> filters) |
List<Map<String,Object>> |
readDataCollectionFromMainTableForCombinedEntries(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
List<String> filters,
boolean pagination) |
Map<String,Object> |
readDataFromMainTable(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
List<String> filters) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
readEntity(org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
boolean cascadeDelete)
ReadEntity Flow .
|
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
readEntityMedia(org.apache.olingo.odata2.api.uri.info.GetMediaResourceUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
readEntitySet(org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context)
ReadEntityCollection Flow
|
void |
rollbackTransaction() |
void |
setCSN(com.fasterxml.jackson.databind.JsonNode csn) |
void |
setIsBatchFlow(boolean isBatchFlow) |
void |
setIsDraftFlow(boolean draftFlow) |
void |
startTransaction() |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
updateEntity(org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo uriInfo,
org.apache.olingo.odata2.api.ep.entry.ODataEntry content,
String requestContentType,
boolean merge,
org.apache.olingo.odata2.api.processor.ODataContext context) |
com.sap.gateway.core.api.provider.data.IDataProviderResponse |
updateEntityMedia(org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
org.apache.olingo.odata2.api.processor.ODataContext context) |
castNavigationStringToGuid, castStringToGuid, castStringToGuid, castStringToGuidWithCompelxProperty, compareEtagValues, convertUUIDtoStringinPayload, createETagHeaderValue, executeSingleOperationForBatch, generateAndSetUUIDtoPayLoad, getAllNavigationUUIDColumns, getFilterExpression, getIGWMessageContainerFromMessageContainer, getIGWMessageFromMessage, getSelectOptions, getUserContextParam, getUUIDColumns, getUUIDColumnsInComplexType, isBatchRequest, populateResponseHeaderEtag, readEntityFromBatch, readEntitySetFromBatch, setBatchRequest, setDataSource, setFilterExpression, setSelectOptions, setStatisticsInContext, setUserContextInfo, setUserContextParamcountEntityLinks, createEntityLink, deleteEntity, deleteEntityLink, deleteEntitySimplePropertyValue, executeBatch, executeChangeSet, executeFunctionImport, existsEntity, existsEntityLink, getServiceDocumentProducer, getServiceInfo, getTimestampProperty, readEntity, readEntityComplexProperty, readEntityLink, readEntityLinks, readEntitySimpleProperty, readExpandedEntity, readExpandedEntitySet, updateEntityComplexProperty, updateEntityLink, updateEntitySimpleProperty, updateEntitySimplePropertyValuepublic CDSDataProvider(com.sap.gateway.core.api.srvrepo.IServiceInfo service)
service - public Map<String,Object> getTypeMapping(org.apache.olingo.odata2.api.uri.UriInfo uriInfo, org.apache.olingo.odata2.api.ep.EntityProviderReadProperties readProperties, org.apache.olingo.odata2.api.edm.EdmNavigationProperty navigationProperty) throws org.apache.olingo.odata2.api.exception.ODataException
getTypeMapping in interface com.sap.gateway.core.api.provider.data.IDataProvidergetTypeMapping in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse readEntity(org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
boolean cascadeDelete)
throws org.apache.olingo.odata2.api.exception.ODataException
readEntity in class DataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse readEntitySet(org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
readEntitySet in interface com.sap.gateway.core.api.provider.data.IDataProviderreadEntitySet in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse readEntityMedia(org.apache.olingo.odata2.api.uri.info.GetMediaResourceUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
readEntityMedia in interface com.sap.gateway.core.api.provider.data.IDataProviderreadEntityMedia in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse countEntitySet(org.apache.olingo.odata2.api.uri.info.GetEntitySetCountUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
countEntitySet in interface com.sap.gateway.core.api.provider.data.IDataProvidercountEntitySet in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic CDSHandler getHandler(org.apache.olingo.odata2.api.processor.ODataRequest request, String namespace)
public ExtensionHelper getExtensionHelper(org.apache.olingo.odata2.api.processor.ODataRequest request, String namespace)
getExtensionHelper in class DataProviderpublic DataSourceParams getDataSource()
getDataSource in class DataProviderpublic final DataSourceParams getDSParams()
getDSParams in class DataProviderpublic final TransactionParams getTSParams()
getTSParams in class DataProviderpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse createEntity(org.apache.olingo.odata2.api.uri.info.PostUriInfo uriInfo,
org.apache.olingo.odata2.api.ep.entry.ODataEntry content,
String requestContentType,
org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties.ODataEntityProviderPropertiesBuilder providerPropertiesBuilder,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
createEntity in interface com.sap.gateway.core.api.provider.data.IDataProvidercreateEntity in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse createEntityMedia(org.apache.olingo.odata2.api.uri.info.PostUriInfo uriInfo,
InputStream content,
String requestContentType,
String slugType,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
createEntityMedia in interface com.sap.gateway.core.api.provider.data.IDataProvidercreateEntityMedia in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic boolean checkEtagStatusPass(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response)
throws org.apache.olingo.odata2.api.exception.ODataException
checkEtagStatusPass in class DataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic void populateUpdatedEntityinResponse(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response,
org.apache.olingo.odata2.api.ep.entry.ODataEntry content)
throws org.apache.olingo.odata2.api.exception.ODataException
populateUpdatedEntityinResponse in class DataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic void populateEtagInHeaderFromResponse(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response)
throws org.apache.olingo.odata2.api.exception.ODataException
populateEtagInHeaderFromResponse in class DataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse updateEntity(org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo uriInfo,
org.apache.olingo.odata2.api.ep.entry.ODataEntry content,
String requestContentType,
boolean merge,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
updateEntity in interface com.sap.gateway.core.api.provider.data.IDataProviderupdateEntity in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse updateEntityMedia(org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo uriInfo,
InputStream content,
String requestContentType,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
updateEntityMedia in interface com.sap.gateway.core.api.provider.data.IDataProviderupdateEntityMedia in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse deleteEntity(org.apache.olingo.odata2.api.uri.info.DeleteUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
boolean cascadeDelete)
throws org.apache.olingo.odata2.api.exception.ODataException
deleteEntity in class DataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse deleteEntityMedia(org.apache.olingo.odata2.api.uri.info.DeleteUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
deleteEntityMedia in interface com.sap.gateway.core.api.provider.data.IDataProviderdeleteEntityMedia in class com.sap.gateway.core.api.provider.data.BaseDataProviderorg.apache.olingo.odata2.api.exception.ODataExceptionpublic void setCSN(com.fasterxml.jackson.databind.JsonNode csn)
setCSN in interface AcceptsCSNpublic Object checkEtagValidations(com.sap.gateway.core.api.provider.data.BaseDataProviderResponse response, org.apache.olingo.odata2.api.uri.UriInfo uriInfo, org.apache.olingo.odata2.api.processor.ODataContext context) throws org.apache.olingo.odata2.api.exception.ODataApplicationException
checkEtagValidations in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic void startTransaction()
throws org.apache.olingo.odata2.api.exception.ODataApplicationException
startTransaction in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic void commitTransaction()
throws org.apache.olingo.odata2.api.exception.ODataApplicationException
commitTransaction in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic void rollbackTransaction()
throws org.apache.olingo.odata2.api.exception.ODataApplicationException
rollbackTransaction in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic void cleanupTransaction()
cleanupTransaction in class DataProviderpublic void setIsBatchFlow(boolean isBatchFlow)
setIsBatchFlow in class DataProviderpublic boolean isCreatable(String serviceName, String entityName)
isCreatable in interface ODataOperationValidatorpublic boolean isUpdatable(String serviceName, String entityName)
isUpdatable in interface ODataOperationValidatorpublic boolean isDeletable(String serviceName, String entityName)
isDeletable in interface ODataOperationValidatorpublic Long getPageSize(org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo uriInfo)
getPageSize in class DataProviderpublic final void computePageValues(org.apache.olingo.odata2.api.uri.UriInfo uriInfo)
throws NumberFormatException
NumberFormatExceptionpublic void executeEtagCheckForFunctionImport(org.apache.olingo.odata2.api.uri.info.GetFunctionImportUriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context)
throws org.apache.olingo.odata2.api.exception.ODataException
if-match or if-none-match) are present and the corresponding conditions are fulfilled
then the function can be executed.
- On the other hand, if the HTTP header for the ETag value is missing or if the corresponding condition is not fulfilled then an ODataException is thrown.
2. If the function is not bound, then the function can be executed.executeEtagCheckForFunctionImport in class DataProvideruriInfo - Contains information specific to the function from the requestcontext - Contains general information from the requestorg.apache.olingo.odata2.api.exception.ODataException - If the HTTP header is missing or if the condition specified by it is not metpublic Boolean isDraftFlow()
isDraftFlow in class DataProviderpublic void setIsDraftFlow(boolean draftFlow)
setIsDraftFlow in class DataProviderpublic Map<String,Object> readDataFromMainTable(org.apache.olingo.odata2.api.uri.UriInfo uriInfo, org.apache.olingo.odata2.api.processor.ODataContext context, List<String> filters) throws org.apache.olingo.odata2.api.exception.ODataApplicationException
readDataFromMainTable in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic List<Map<String,Object>> readDataCollectionFromMainTable(org.apache.olingo.odata2.api.uri.UriInfo uriInfo, org.apache.olingo.odata2.api.processor.ODataContext context, List<String> filters) throws org.apache.olingo.odata2.api.exception.ODataApplicationException
readDataCollectionFromMainTable in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic List<Map<String,Object>> readDataCollectionFromMainTableForCombinedEntries(org.apache.olingo.odata2.api.uri.UriInfo uriInfo, org.apache.olingo.odata2.api.processor.ODataContext context, List<String> filters, boolean pagination) throws org.apache.olingo.odata2.api.exception.ODataApplicationException
readDataCollectionFromMainTableForCombinedEntries in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic com.sap.gateway.core.api.provider.data.IDataProviderResponse countDataCollectionFromMainTable(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
List<String> filters)
throws org.apache.olingo.odata2.api.exception.ODataApplicationException
countDataCollectionFromMainTable in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionpublic int getInlineCount(org.apache.olingo.odata2.api.uri.UriInfo uriInfo,
org.apache.olingo.odata2.api.processor.ODataContext context,
boolean mainTable)
throws org.apache.olingo.odata2.api.exception.ODataApplicationException
getInlineCount in class DataProviderorg.apache.olingo.odata2.api.exception.ODataApplicationExceptionCopyright © 2020 SAP. All Rights Reserved.