public class ReportingServiceManager extends Object
Example: downloadFileAsync(com.microsoft.bingads.v13.reporting.ReportingDownloadParameters, com.microsoft.bingads.AsyncCallback<java.io.File>)
will submit the download request to the reporting service,
poll until the status is completed (or returns an error), and downloads the file locally.
If instead you want to manage the low level details you would first call submitDownloadAsync(com.microsoft.bingads.v13.reporting.ReportRequest, com.microsoft.bingads.AsyncCallback<com.microsoft.bingads.v13.reporting.ReportingDownloadOperation>)
,
wait for the results file to be prepared using either ReportingDownloadOperation.getStatusAsync(com.microsoft.bingads.AsyncCallback<com.microsoft.bingads.v13.reporting.ReportingOperationStatus>)
or ReportingDownloadOperation.trackAsync(com.microsoft.bingads.AsyncCallback<com.microsoft.bingads.v13.reporting.ReportingOperationStatus>)
, and then download the file with the
ReportingDownloadOperation.downloadResultFileAsync(java.io.File, java.lang.String, boolean, com.microsoft.bingads.AsyncCallback<java.io.File>)
method.
Constructor and Description |
---|
ReportingServiceManager(AuthorizationData authorizationData)
Initializes a new instance of this class with the specified
AuthorizationData . |
ReportingServiceManager(AuthorizationData authorizationData,
ApiEnvironment apiEnvironment) |
Modifier and Type | Method and Description |
---|---|
void |
cleanupTempFiles()
Removes all files from the working directory, whether the files are used by this BulkServiceManager or by another instance.
|
Future<File> |
downloadFileAsync(ReportingDownloadParameters parameters,
AsyncCallback<File> callback)
Downloads the reporting file to a local file.
|
Future<Report> |
downloadReportAsync(ReportingDownloadParameters parameters,
AsyncCallback<Report> callback)
Downloads the reporting file to a Report Object in async mode.
|
AuthorizationData |
getAuthorizationData()
Gets the authorization data for the user performing the operation.
|
int |
getDownloadHttpTimeoutInMilliseconds()
Gets the timeout of HttpClient download operation.
|
HttpFileService |
getHttpFileService()
Reserved for internal use.
|
int |
getStatusPollIntervalInMilliseconds()
Gets the time interval in milliseconds between two status polling attempts.
|
File |
getWorkingDirectory()
Gets the directory for storing temporary files needed for some operations.
|
ZipExtractor |
getZipExtractor()
Reserved for internal use.
|
void |
setDownloadHttpTimeoutInMilliseconds(int downloadHttpTimeoutInMilliseconds)
Sets the timeout of HttpClient download operation.
|
void |
setHttpFileService(HttpFileService httpFileService)
Reserved for internal use.
|
void |
setStatusPollIntervalInMilliseconds(int statusPollIntervalInMilliseconds)
Sets the time interval in milliseconds between two status polling attempts.
|
void |
setWorkingDirectory(File value)
Sets the directory for storing temporary files needed for some operations.
|
void |
setZipExtractor(ZipExtractor zipExtractor)
Reserved for internal use.
|
Future<ReportingDownloadOperation> |
submitDownloadAsync(ReportRequest reportRequest,
AsyncCallback<ReportingDownloadOperation> callback)
Submits a download request to the Bing Ads reporting service with the specified parameters.
|
public ReportingServiceManager(AuthorizationData authorizationData)
AuthorizationData
.authorizationData
- Represents a user who intends to access the corresponding customer and accountpublic ReportingServiceManager(AuthorizationData authorizationData, ApiEnvironment apiEnvironment)
public AuthorizationData getAuthorizationData()
public Future<Report> downloadReportAsync(ReportingDownloadParameters parameters, AsyncCallback<Report> callback)
parameters
- Determines the download request and file path.callback
- a callback which is called with the report object when the report file is
downloaded and availableFuture
that will indicate completion of the operationpublic Future<File> downloadFileAsync(ReportingDownloadParameters parameters, AsyncCallback<File> callback)
parameters
- Determines the download request and file path.callback
- a callback which is called with the file path when the file is downloaded and availableFuture
that will indicate completion of the operationpublic Future<ReportingDownloadOperation> submitDownloadAsync(ReportRequest reportRequest, AsyncCallback<ReportingDownloadOperation> callback)
The ReportingDownloadParameters.getResultFileDirectory()
and ReportingDownloadParameters.getResultFileName()
properties are ignored by this method.
When the file is ready for download, specify the result file path and name as parameters of the
ReportingDownloadOperation.downloadResultFileAsync(java.io.File, java.lang.String, boolean, com.microsoft.bingads.AsyncCallback<java.io.File>)
method.
reportRequest
- Describes the type of entities and data scope that you want to downloadcallback
- a callback will be called when the ReportingDownloadOperation
has been createdFuture
that will indicate completion of the operationpublic HttpFileService getHttpFileService()
public void setHttpFileService(HttpFileService httpFileService)
public ZipExtractor getZipExtractor()
public void setZipExtractor(ZipExtractor zipExtractor)
public File getWorkingDirectory()
public void setWorkingDirectory(File value)
public int getStatusPollIntervalInMilliseconds()
public void setStatusPollIntervalInMilliseconds(int statusPollIntervalInMilliseconds)
public int getDownloadHttpTimeoutInMilliseconds()
public void setDownloadHttpTimeoutInMilliseconds(int downloadHttpTimeoutInMilliseconds)
public void cleanupTempFiles()
Copyright © 2024. All rights reserved.