@Override public ResultSegment<T> preProcessResponse(TableQuery<T> queryRef, CloudTableClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) { throw TableServiceException.generateTableServiceException(this.getResult(), null, this.getConnection().getErrorStream(), options.getTablePayloadFormat()); } return null; }
@SuppressWarnings("unchecked") @Override public ResultSegment<T> postProcessResponse(HttpURLConnection connection, TableQuery<T> queryRef, CloudTableClient client, OperationContext context, ResultSegment<T> storageObject) throws Exception { ODataPayload<T> clazzResponse = null; InputStream inStream = connection.getInputStream(); clazzResponse = (ODataPayload<T>) TableDeserializer.parseQueryResponse(inStream, options, queryToExecute.getClazzType(), null, context); final ResultContinuation nextToken = TableResponse.getTableContinuationFromResponse(connection); if (nextToken != null) { nextToken.setTargetLocation(this.getResult().getTargetLocation()); } // Note, setting the token on the SegmentedStorageRequest is // key, this is how the iterator will share the token across executions segmentedRequest.setToken(nextToken); return new ResultSegment<T>(clazzResponse.results, queryToExecute.getTakeCount() == null ? clazzResponse.results.size() : queryToExecute.getTakeCount(), nextToken); }
@SuppressWarnings("unchecked") @Override public ResultSegment<T> postProcessResponse(HttpURLConnection connection, TableQuery<T> queryRef, CloudTableClient client, OperationContext context, ResultSegment<T> storageObject) throws Exception { ODataPayload<T> clazzResponse = null; InputStream inStream = connection.getInputStream(); clazzResponse = (ODataPayload<T>) TableDeserializer.parseQueryResponse(inStream, options, queryToExecute.getClazzType(), null, context); final ResultContinuation nextToken = TableResponse.getTableContinuationFromResponse(connection); if (nextToken != null) { nextToken.setTargetLocation(this.getResult().getTargetLocation()); } // Note, setting the token on the SegmentedStorageRequest is // key, this is how the iterator will share the token across executions segmentedRequest.setToken(nextToken); return new ResultSegment<T>(clazzResponse.results, queryToExecute.getTakeCount() == null ? clazzResponse.results.size() : queryToExecute.getTakeCount(), nextToken); }
@Override public void setRequestLocationMode() { this.setRequestLocationMode(Utility.getListingLocationMode(segmentedRequest.getToken())); }
@Override public void setRequestLocationMode() { this.setRequestLocationMode(Utility.getListingLocationMode(segmentedRequest.getToken())); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableQuery<T> queryRef, OperationContext context) throws Exception { return TableRequest.query(client.getTransformedEndPoint(context).getUri(this.getCurrentLocation()), options, queryToExecute.generateQueryBuilder(), context, queryToExecute.getSourceTableName(), null/* identity */, segmentedRequest.getToken()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableQuery<T> queryRef, OperationContext context) throws Exception { return TableRequest.query(client.getTransformedEndPoint(context).getUri(this.getCurrentLocation()), options, queryToExecute.generateQueryBuilder(), context, queryToExecute.getSourceTableName(), null/* identity */, segmentedRequest.getToken()); }
@Override public ResultSegment<T> preProcessResponse(TableQuery<T> queryRef, CloudTableClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) { throw TableServiceException.generateTableServiceException(this.getResult(), null, this.getConnection().getErrorStream(), options.getTablePayloadFormat()); } return null; }