/**
   * Blocks and waits for a report to be ready. When a {@link ReportJobStatus} is received that is
   * not {@code ReportJobStatus#Pending} or {@code ReportJobStatus#InProgress}, the report is
   * considered finished, and the method is returned with a {@code true} if the report was
   * successful, or an {@code false} if not.
   *
   * @return {@code true} if the report was successful, {@code false} otherwise
   * @throws RemoteException if there was an error performing one of the SOAP calls
   * @throws InterruptedException if the thread was interrupted
   */
  public boolean waitForReportReady() throws RemoteException, InterruptedException {
    ReportJobStatus status = reportService.getReportJob(reportJobId).getReportJobStatus();
    while (status == ReportJobStatus.IN_PROGRESS) {
      Thread.sleep(SLEEP_TIMER);
      status = reportService.getReportJob(reportJobId).getReportJobStatus();
    }

    return status == ReportJobStatus.COMPLETED;
  }
 /**
  * Gets the download URL for a GZip or plain-text format report.
  *
  * @param exportFormat the export format of the report
  * @return the URL for the report download
  * @throws RemoteException if there was an error performing any Axis call
  * @throws IllegalStateException if the report is not ready to be downloaded
  */
 private String getDownloadUrl(ExportFormat exportFormat) throws RemoteException {
   ReportJobStatus status = reportService.getReportJob(reportJobId).getReportJobStatus();
   Preconditions.checkState(
       status == ReportJobStatus.COMPLETED,
       "Report "
           + reportJobId
           + " must be completed before downloading. It is currently: "
           + status);
   return reportService.getReportDownloadURL(reportJobId, exportFormat);
 }