/** * {@inheritDoc } */ @Override public ODataSingleRequest setRequest(final ODataBatchableRequest request) { if (!isOpen()) { throw new IllegalStateException("Current batch item is closed"); } hasStreamedSomething = true; // stream the request if (request.getMethod() == HttpMethod.GET) { streamRequestHeader(request); } else { streamRequestHeader(ODataSingleResponseItem.SINGLE_CONTENT_ID); request.batch(req, ODataSingleResponseItem.SINGLE_CONTENT_ID); } // close before in order to avoid any further setRequest calls. close(); // add request to the list expectedResItem.addResponse( ODataSingleResponseItem.SINGLE_CONTENT_ID, ((AbstractODataRequest) request).getResponseTemplate()); return this; } }
/** * Stream the given request header. * * @param request request to be batched. */ protected void streamRequestHeader(final ODataBatchableRequest request) { // stream batch content type stream(ODataBatchConstants.ITEM_CONTENT_TYPE_LINE.getBytes(DEFAULT_CHARSET)); newLine(); stream(ODataBatchConstants.ITEM_TRANSFER_ENCODING_LINE.getBytes(DEFAULT_CHARSET)); newLine(); newLine(); stream(request.toByteArray()); newLine(); }
LOG.error("While performing {}", entry.getKey().getURI(), e);
/** * Stream the given request header. * * @param request request to be batched. */ protected void streamRequestHeader(final ODataBatchableRequest request) { // stream batch content type stream(ODataBatchConstants.ITEM_CONTENT_TYPE_LINE.getBytes(DEFAULT_CHARSET)); newLine(); stream(ODataBatchConstants.ITEM_TRANSFER_ENCODING_LINE.getBytes(DEFAULT_CHARSET)); newLine(); newLine(); stream(request.toByteArray()); newLine(); }
LOG.error("While performing {}", entry.getKey().getURI(), e);
/** * {@inheritDoc } */ @Override public ODataSingleRequest setRequest(final ODataBatchableRequest request) { if (!isOpen()) { throw new IllegalStateException("Current batch item is closed"); } hasStreamedSomething = true; // stream the request if (request.getMethod() == HttpMethod.GET) { streamRequestHeader(request); } else { streamRequestHeader(ODataSingleResponseItem.SINGLE_CONTENT_ID); request.batch(req, ODataSingleResponseItem.SINGLE_CONTENT_ID); } // close before in order to avoid any further setRequest calls. close(); // add request to the list expectedResItem.addResponse( ODataSingleResponseItem.SINGLE_CONTENT_ID, ((AbstractODataRequest) request).getResponseTemplate()); return this; } }