com.google.api.ads.adwords.lib.utils
Class AdHocReportDownloadHelper

java.lang.Object
  extended by com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelper

public class AdHocReportDownloadHelper
extends Object

Helper class that handles AdHoc report downloads. Requests will be logged (header and payload) to INFO. Successful reports will be logged (headers and response code) to INFO. Failed reports will be logged in their entirety to WARN.

Author:
Kevin Winter

Constructor Summary
AdHocReportDownloadHelper(AdWordsSession session, String version)
          Constructor that stores the session for authentication and uses the provided version to determine the report endpoint.
 
Method Summary
protected  ReportDownloadResponse downloadReport(com.google.api.ads.adwords.lib.utils.ReportWriter reportWriter)
          Downloads a report and returns a ReportDownloadResponse with the results.
 ReportDownloadResponse downloadReport(String reportDefinitionXml)
          Downloads a report and returns a ReportDownloadResponse with the results.
 ReportDownloadResponse downloadReport(String reportQuery, String format)
          Downloads a report query and returns a ReportDownloadResponse with the results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdHocReportDownloadHelper

public AdHocReportDownloadHelper(AdWordsSession session,
                                 String version)
Constructor that stores the session for authentication and uses the provided version to determine the report endpoint.

Method Detail

downloadReport

public ReportDownloadResponse downloadReport(String reportDefinitionXml)
                                      throws ReportException
Downloads a report and returns a ReportDownloadResponse with the results.

Parameters:
reportDefinitionXml - to download a report for.
Returns:
ReportDownloadResponse When HTTP request completes. On success, the outputStream will be flushed and closed.
Throws:
ReportException - If there is any issue making HTTP request with server.

downloadReport

public ReportDownloadResponse downloadReport(String reportQuery,
                                             String format)
                                      throws ReportException
Downloads a report query and returns a ReportDownloadResponse with the results.

Parameters:
reportQuery - to download a report for.
Returns:
ReportDownloadResponse When HTTP request completes. On success, the outputStream will be flushed and closed.
Throws:
ReportException - If there is any issue making HTTP request with server.

downloadReport

protected ReportDownloadResponse downloadReport(com.google.api.ads.adwords.lib.utils.ReportWriter reportWriter)
                                         throws ReportException
Downloads a report and returns a ReportDownloadResponse with the results.

Parameters:
reportWriter - Encapsulated class that will write this report to the output stream.
Returns:
ReportDownloadResponse When HTTP request completes. On success, the outputStream will be flushed and closed.
Throws:
ReportException - If there is any issue making HTTP request with server.


Copyright © 2012. All Rights Reserved.