}
public List<BVProductStatistic> getProductStatistics(List<String> productIds) {
List<BVProductStatistic> results = new ArrayList<BVProductStatistic>();
BVRequest request = buildRequest();
request.setResource(configuration.get(BVConstants.RESOURCE_STATISTICS));
StringBuilder productIdsBuilder = new StringBuilder();
boolean first = true;
for (String productId : productIds) {
if (first) {
first = false;
} else {
productIdsBuilder.append(",");
}
productIdsBuilder.append(productId);
}
request.addParameter(BVConstants.URL_FILTER, String.format("productid:%s", productIdsBuilder.toString()));
request.addParameter(BVConstants.URL_STATS, "Reviews,NativeReviews");
request.addParameter(BVConstants.URL_LIMIT, "99");
if (getLocale() != null) {
request.addParameter(BVConstants.URL_FILTER, String.format("%s:%s:%s", BVConstants.URL_LOCALE, BVConstants.URL_EQUALS, getLocale()));
}
request.addRequestProcessor(new BVReviewStatisticsJSONProcessor());
long startTime = Calendar.getInstance().getTimeInMillis();
BVResponse response = request.process();
this.setMostRecentAPIResponse(response);
this.setMostRecentAPICallProcessingTime(Calendar.getInstance().getTimeInMillis() - startTime);
for (BVElement result : response.getResults()) {
results.add((BVProductStatistic) result);