Search in sources :

Example 1 with NonStreamingBatchOperations

use of org.neo4j.server.rest.batch.NonStreamingBatchOperations in project neo4j by neo4j.

the class BatchOperationService method batchProcess.

private Response batchProcess(UriInfo uriInfo, HttpHeaders httpHeaders, HttpServletRequest req, InputStream body) {
    try {
        NonStreamingBatchOperations batchOperations = new NonStreamingBatchOperations(webServer);
        BatchOperationResults results = batchOperations.performBatchJobs(uriInfo, httpHeaders, req, body);
        Response res = Response.ok().entity(results.toJSON()).type(HttpHeaderUtils.mediaTypeWithCharsetUtf8(MediaType.APPLICATION_JSON_TYPE)).build();
        representationWriteHandler.onRepresentationWritten();
        return res;
    } catch (Exception e) {
        return output.serverError(e);
    } finally {
        representationWriteHandler.onRepresentationFinal();
    }
}
Also used : Response(javax.ws.rs.core.Response) BatchOperationResults(org.neo4j.server.rest.batch.BatchOperationResults) NonStreamingBatchOperations(org.neo4j.server.rest.batch.NonStreamingBatchOperations) IOException(java.io.IOException) WebApplicationException(javax.ws.rs.WebApplicationException)

Aggregations

IOException (java.io.IOException)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 Response (javax.ws.rs.core.Response)1 BatchOperationResults (org.neo4j.server.rest.batch.BatchOperationResults)1 NonStreamingBatchOperations (org.neo4j.server.rest.batch.NonStreamingBatchOperations)1