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 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:
      handle in interface ODataProcessorHandler<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 an ODataEntry
      Parameters:
      param - Parameters from the request
      Returns:
      ODataEntry representing 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 an ODataResponse for the request
      Parameters:
      param - Parameters from the request
      ctx - Storage request contains the information on how to create the response
      persistedEntry - The persisted ODataEntry
      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

      protected PersistenceService getPersistenceService()
    • setPersistenceService

      public void setPersistenceService(PersistenceService persistenceService)
    • getStorageRequestFactory

      protected StorageRequestFactory getStorageRequestFactory()
    • setStorageRequestFactory

      public void setStorageRequestFactory(StorageRequestFactory storageRequestFactory)