Class JPAODataBatchProcessor
- All Implemented Interfaces:
org.apache.olingo.server.api.processor.BatchProcessor,org.apache.olingo.server.api.processor.Processor
- Author:
- Oliver Grande
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(org.apache.olingo.server.api.OData odata, org.apache.olingo.server.api.ServiceMetadata serviceMetadata)voidprocessBatch(org.apache.olingo.server.api.batch.BatchFacade facade, org.apache.olingo.server.api.ODataRequest request, org.apache.olingo.server.api.ODataResponse response)org.apache.olingo.server.api.deserializer.batch.ODataResponsePartprocessChangeSet(org.apache.olingo.server.api.batch.BatchFacade facade, List<org.apache.olingo.server.api.ODataRequest> requests)Processing one change set of a $batch request.
-
Constructor Details
-
JPAODataBatchProcessor
-
-
Method Details
-
init
public void init(org.apache.olingo.server.api.OData odata, org.apache.olingo.server.api.ServiceMetadata serviceMetadata)- Specified by:
initin interfaceorg.apache.olingo.server.api.processor.Processor
-
processBatch
public void processBatch(org.apache.olingo.server.api.batch.BatchFacade facade, org.apache.olingo.server.api.ODataRequest request, org.apache.olingo.server.api.ODataResponse response) throws org.apache.olingo.server.api.ODataApplicationException, org.apache.olingo.server.api.ODataLibraryException- Specified by:
processBatchin interfaceorg.apache.olingo.server.api.processor.BatchProcessor- Throws:
org.apache.olingo.server.api.ODataApplicationExceptionorg.apache.olingo.server.api.ODataLibraryException
-
processChangeSet
public org.apache.olingo.server.api.deserializer.batch.ODataResponsePart processChangeSet(org.apache.olingo.server.api.batch.BatchFacade facade, List<org.apache.olingo.server.api.ODataRequest> requests) throws org.apache.olingo.server.api.ODataApplicationException, org.apache.olingo.server.api.ODataLibraryExceptionProcessing one change set of a $batch request.OData Version 4.0 Part 1: Protocol Plus Errata 02 11.7.4 Responding to a Batch Request states:
All operations in a change set represent a single change unit so a service MUST successfully process and apply all the requests in the change set or else apply none of them. It is up to the service implementation to define rollback semantics to undo any requests within a change set that may have been applied before another request in that same change set failed and thereby apply this all-or-nothing requirement. The service MAY execute the requests within a change set in any order and MAY return the responses to the individual requests in any order. The service MUST include the Content-ID header in each response with the same value that the client specified in the corresponding request, so clients can correlate requests and responses.This requires that the batch processor can create transactions. To do so it takes an instance of
JPAODataTransactionFactoryfrom the request context and requests a new transaction. In case this is not possible a exception with http status code 501 Not Implemented will be raised.- Specified by:
processChangeSetin interfaceorg.apache.olingo.server.api.processor.BatchProcessor- Throws:
org.apache.olingo.server.api.ODataApplicationExceptionorg.apache.olingo.server.api.ODataLibraryException
-