protected GoogleAnalyticsResponse postBatch(GoogleAnalyticsRequest<?> gaReq) { GoogleAnalyticsResponse resp = new GoogleAnalyticsResponse(); HttpRequest httpReq = createHttpRequest(gaReq); resp.setRequestParams(httpReq.getBodyParams()); if (config.isGatherStats()) { gatherStats(gaReq); } synchronized (currentBatch) { currentBatch.add(httpReq); } // If the batch size has reached the configured max, // then send the batch to google then clear the batch to start a new batch submitBatch(false); return resp; }
protected GoogleAnalyticsResponse postBatch(GoogleAnalyticsRequest<?> gaReq) { GoogleAnalyticsResponse resp = new GoogleAnalyticsResponse(); HttpRequest httpReq = createHttpRequest(gaReq); resp.setRequestParams(httpReq.getBodyParams()); if (config.isGatherStats()) { gatherStats(gaReq); } synchronized (currentBatch) { currentBatch.add(httpReq); } // If the batch size has reached the configured max, // then send the batch to google then clear the batch to start a new batch submitBatch(false); return resp; }
protected GoogleAnalyticsResponse postSingle(GoogleAnalyticsRequest<?> gaReq) { HttpRequest httpReq = createHttpRequest(gaReq); HttpResponse httpResp = httpClient.post(httpReq); GoogleAnalyticsResponse response = new GoogleAnalyticsResponse(); response.setStatusCode(httpResp.getStatusCode()); response.setRequestParams(httpReq.getBodyParams()); if (config.isGatherStats()) { gatherStats(gaReq); } return response; }
protected GoogleAnalyticsResponse postSingle(GoogleAnalyticsRequest<?> gaReq) { HttpRequest httpReq = createHttpRequest(gaReq); HttpResponse httpResp = httpClient.post(httpReq); GoogleAnalyticsResponse response = new GoogleAnalyticsResponse(); response.setStatusCode(httpResp.getStatusCode()); response.setRequestParams(httpReq.getBodyParams()); if (config.isGatherStats()) { gatherStats(gaReq); } return response; }