private void retrieveMonitorDetails(final ODataBatchResponse res) { Collection<String> headers = res.getHeader(HttpHeader.LOCATION); if (headers == null || headers.isEmpty()) { throw new AsyncRequestException("Invalid async request response. Monitor URL not found"); } else { this.location = URI.create(headers.iterator().next()); } headers = res.getHeader(HttpHeader.RETRY_AFTER); if (headers != null && !headers.isEmpty()) { this.retryAfter = Integer.parseInt(headers.iterator().next()); } headers = res.getHeader(HttpHeader.PREFERENCE_APPLIED); if (headers != null && !headers.isEmpty()) { for (String header : headers) { if (header.equalsIgnoreCase(new ODataPreferences().respondAsync())) { preferenceApplied = true; } } } IOUtils.closeQuietly(res.getRawResponse()); } }
private void retrieveMonitorDetails(final ODataBatchResponse res) { Collection<String> headers = res.getHeader(HttpHeader.LOCATION); if (headers == null || headers.isEmpty()) { throw new AsyncRequestException("Invalid async request response. Monitor URL not found"); } else { this.location = URI.create(headers.iterator().next()); } headers = res.getHeader(HttpHeader.RETRY_AFTER); if (headers != null && !headers.isEmpty()) { this.retryAfter = Integer.parseInt(headers.iterator().next()); } headers = res.getHeader(HttpHeader.PREFERENCE_APPLIED); if (headers != null && !headers.isEmpty()) { for (String header : headers) { if (header.equalsIgnoreCase(new ODataPreferences().respondAsync())) { preferenceApplied = true; } } } IOUtils.closeQuietly(res.getRawResponse()); } }
public ODataBatchResponseManager( final ODataBatchResponse res, final List<ODataBatchResponseItem> expectedItems, final boolean continueOnError) { this.continueOnError = continueOnError; try { this.expectedItemsIterator = expectedItems.iterator(); this.batchLineIterator = new ODataBatchLineIteratorImpl( IOUtils.lineIterator(res.getRawResponse(), Constants.UTF8)); // search for boundary batchBoundary = ODataBatchUtilities.getBoundaryFromHeader( res.getHeader(HttpHeader.CONTENT_TYPE)); LOG.debug("Retrieved batch response bondary '{}'", batchBoundary); } catch (IOException e) { LOG.error("Error parsing batch response", e); throw new IllegalStateException(e); } }
public ODataBatchResponseManager( final ODataBatchResponse res, final List<ODataBatchResponseItem> expectedItems, final boolean continueOnError) { this.continueOnError = continueOnError; try { this.expectedItemsIterator = expectedItems.iterator(); this.batchLineIterator = new ODataBatchLineIteratorImpl( IOUtils.lineIterator(res.getRawResponse(), Constants.UTF8)); // search for boundary batchBoundary = ODataBatchUtilities.getBoundaryFromHeader( res.getHeader(HttpHeader.CONTENT_TYPE)); LOG.debug("Retrieved batch response bondary '{}'", batchBoundary); } catch (IOException e) { LOG.error("Error parsing batch response", e); throw new IllegalStateException(e); } }