code: @GET
      @Produces(MediaType.APPLICATION_JSON)
      @Path("/{batchId}")
      @Description("Return a batch query's status and results if done")
      public Response getBatchById(@Context HttpServletRequest req,
                                   @PathParam("batchId") String batchId) {
          _validateBatchId(batchId);
          PrincipalUser currentOwner = validateAndGetOwner(req, null);
  
          BatchMetricQuery batch = batchService.findBatchById(batchId);
          if (batch != null) {
              PrincipalUser actualOwner = userService.findUserByUsername(batch.getOwnerName());
              validateResourceAuthorization(req, actualOwner, currentOwner);
              return Response.ok(BatchDto.transformToDto(batch), MediaType.APPLICATION_JSON).build();
          }
          throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
      }
docs: Returns a batch by its ID
  
  @param   req          HTTPServlet request. Cannot be null.
  @param   batchId      The batch ID to retrieve.
  
  @return  The corresponding batch
  
  @throws  WebApplicationException  If an error occurs.