@Override public void processBatch(final BatchFacade facade, final ODataRequest request, final ODataResponse response) throws ODataApplicationException, ODataLibraryException { final int handle = context.getDebugger().startRuntimeMeasurement(this, "processBatch"); final String boundary = facade.extractBoundaryFromContentType(request.getHeader(HttpHeader.CONTENT_TYPE)); final BatchOptions options = BatchOptions.with() .rawBaseUri(request.getRawBaseUri()) .rawServiceResolutionUri(request.getRawServiceResolutionUri()) .build(); final List<BatchRequestPart> requestParts = odata.createFixedFormatDeserializer() .parseBatchRequest(request.getBody(), boundary, options); final List<ODataResponsePart> responseParts = new ArrayList<>(); for (final BatchRequestPart part : requestParts) { responseParts.add(facade.handleBatchRequest(part)); } final String responseBoundary = "batch_" + UUID.randomUUID().toString(); final InputStream responseContent = odata.createFixedFormatSerializer().batchResponse(responseParts, responseBoundary); response.setHeader(HttpHeader.CONTENT_TYPE, ContentType.MULTIPART_MIXED + ";boundary=" + responseBoundary); response.setContent(responseContent); response.setStatusCode(HttpStatusCode.ACCEPTED.getStatusCode()); context.getDebugger().stopRuntimeMeasurement(handle); }
.rawServiceResolutionUri(this.request.getRawServiceResolutionUri()).build();
.rawServiceResolutionUri(this.request.getRawServiceResolutionUri()).build();