/** * Parses the input stream containing the response body of the list queues request result and populates the class * data. * * @param stream * The <code>InputStream</code> object to deserialize from. * @param serviceClient * A {@link CloudQueueClient} object associated with the storage * service. * * @throws IOException * @throws SAXException * @throws ParserConfigurationException */ public static ListResponse<CloudQueue> getQueues(final InputStream stream, final CloudQueueClient serviceClient) throws SAXException, IOException, ParserConfigurationException { SAXParser saxParser = Utility.getSAXParser(); QueueListHandler handler = new QueueListHandler(serviceClient); saxParser.parse(stream, handler); return handler.response; }
@Override public ResultSegment<CloudQueue> postProcessResponse(HttpURLConnection connection, Void queue, CloudQueueClient client, OperationContext context, ResultSegment<CloudQueue> storageObject) throws Exception { final ListResponse<CloudQueue> response = QueueListHandler.getQueues(connection.getInputStream(), client); ResultContinuation newToken = null; if (response.getNextMarker() != null) { newToken = new ResultContinuation(); newToken.setNextMarker(response.getNextMarker()); newToken.setContinuationType(ResultContinuationType.QUEUE); newToken.setTargetLocation(this.getResult().getTargetLocation()); } final ResultSegment<CloudQueue> resSegment = new ResultSegment<CloudQueue>(response.getResults(), response.getMaxResults(), newToken); // Important for listQueues because this is required by the lazy iterator between executions. segmentedRequest.setToken(resSegment.getContinuationToken()); return resSegment; } };
@Override public ResultSegment<CloudQueue> postProcessResponse(HttpURLConnection connection, Void queue, CloudQueueClient client, OperationContext context, ResultSegment<CloudQueue> storageObject) throws Exception { final ListResponse<CloudQueue> response = QueueListHandler.getQueues(connection.getInputStream(), client); ResultContinuation newToken = null; if (response.getNextMarker() != null) { newToken = new ResultContinuation(); newToken.setNextMarker(response.getNextMarker()); newToken.setContinuationType(ResultContinuationType.QUEUE); newToken.setTargetLocation(this.getResult().getTargetLocation()); } final ResultSegment<CloudQueue> resSegment = new ResultSegment<CloudQueue>(response.getResults(), response.getMaxResults(), newToken); // Important for listQueues because this is required by the lazy iterator between executions. segmentedRequest.setToken(resSegment.getContinuationToken()); return resSegment; } };
/** * Parses the input stream containing the response body of the list queues request result and populates the class * data. * * @param stream * The <code>InputStream</code> object to deserialize from. * @param serviceClient * A {@link CloudQueueClient} object associated with the storage * service. * * @throws IOException * @throws SAXException * @throws ParserConfigurationException */ public static ListResponse<CloudQueue> getQueues(final InputStream stream, final CloudQueueClient serviceClient) throws SAXException, IOException, ParserConfigurationException { SAXParser saxParser = Utility.getSAXParser(); QueueListHandler handler = new QueueListHandler(serviceClient); saxParser.parse(stream, handler); return handler.response; }