Class PersistenceHandler
java.lang.Object
de.hybris.platform.odata2services.odata.processor.handler.persistence.PersistenceHandler
- All Implemented Interfaces:
ODataProcessorHandler<PersistenceParam,org.apache.olingo.odata2.api.processor.ODataResponse>
- Direct Known Subclasses:
PatchPersistenceHandler
public class PersistenceHandler
extends Object
implements ODataProcessorHandler<PersistenceParam,org.apache.olingo.odata2.api.processor.ODataResponse>
ODataProcessor handler that persists a request
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.olingo.odata2.api.processor.ODataResponse.ODataResponseBuilderbuildResponse(PersistenceParam param, PersistenceContext ctx, org.apache.olingo.odata2.api.ep.entry.ODataEntry persistedEntry) Creates anODataResponsefor the requestprotected org.apache.olingo.odata2.api.ep.entry.ODataEntryConverts the request payload to anODataEntryprotected org.apache.olingo.odata2.api.processor.ODataResponse.ODataResponseBuildergetODataResponseBuilder(org.apache.olingo.odata2.api.processor.ODataResponse readerResponse) protected PersistenceServiceprotected StorageRequestFactoryorg.apache.olingo.odata2.api.processor.ODataResponsehandle(PersistenceParam param) protected org.apache.olingo.odata2.api.ep.entry.ODataEntrypersist(StorageRequest storageRequest) Persist the request payloadvoidsetPersistenceService(PersistenceService persistenceService) voidsetStorageRequestFactory(StorageRequestFactory storageRequestFactory)
-
Constructor Details
-
PersistenceHandler
public PersistenceHandler()
-
-
Method Details
-
handle
public org.apache.olingo.odata2.api.processor.ODataResponse handle(PersistenceParam param) throws org.apache.olingo.odata2.api.exception.ODataException - Specified by:
handlein interfaceODataProcessorHandler<PersistenceParam,org.apache.olingo.odata2.api.processor.ODataResponse> - Throws:
org.apache.olingo.odata2.api.exception.ODataException
-
convertToODataEntry
protected org.apache.olingo.odata2.api.ep.entry.ODataEntry convertToODataEntry(PersistenceParam param) throws org.apache.olingo.odata2.api.edm.EdmException Converts the request payload to anODataEntry- Parameters:
param- Parameters from the request- Returns:
ODataEntryrepresenting the request payload- Throws:
org.apache.olingo.odata2.api.edm.EdmException- is thrown when there's a failure in the conversion
-
persist
protected org.apache.olingo.odata2.api.ep.entry.ODataEntry persist(StorageRequest storageRequest) throws org.apache.olingo.odata2.api.edm.EdmException Persist the request payload- Parameters:
storageRequest- Contains information on how to persist the request payload- Returns:
- The persisted
ODataEntry - Throws:
org.apache.olingo.odata2.api.edm.EdmException- is thrown if there's a failure in persistence
-
buildResponse
protected org.apache.olingo.odata2.api.processor.ODataResponse.ODataResponseBuilder buildResponse(PersistenceParam param, PersistenceContext ctx, org.apache.olingo.odata2.api.ep.entry.ODataEntry persistedEntry) throws org.apache.olingo.odata2.api.exception.ODataException Creates anODataResponsefor the request- Parameters:
param- Parameters from the requestctx- Storage request contains the information on how to create the responsepersistedEntry- The persistedODataEntry- Returns:
- The
ODataResponse - Throws:
org.apache.olingo.odata2.api.exception.ODataException- is thrown if a failure occurs creating the response
-
getODataResponseBuilder
protected org.apache.olingo.odata2.api.processor.ODataResponse.ODataResponseBuilder getODataResponseBuilder(org.apache.olingo.odata2.api.processor.ODataResponse readerResponse) -
getPersistenceService
-
setPersistenceService
-
getStorageRequestFactory
-
setStorageRequestFactory
-