public class BulkServiceManager extends Object
Example: downloadFileAsync(com.microsoft.bingads.v13.bulk.DownloadParameters, com.microsoft.bingads.AsyncCallback<java.io.File>)
will submit the download request to the bulk 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.bulk.SubmitDownloadParameters, com.microsoft.bingads.AsyncCallback<com.microsoft.bingads.v13.bulk.BulkDownloadOperation>)
, wait for the results file
to be prepared using either BulkOperation.getStatusAsync(com.microsoft.bingads.AsyncCallback<com.microsoft.bingads.v13.bulk.BulkOperationStatus<TStatus>>)
or BulkOperation.trackAsync(com.microsoft.bingads.AsyncCallback<com.microsoft.bingads.v13.bulk.BulkOperationStatus<TStatus>>)
, and then
download the file with the BulkOperation.downloadResultFileAsync(java.io.File, java.lang.String, boolean, com.microsoft.bingads.AsyncCallback<java.io.File>)
method.
Constructor and Description |
---|
BulkServiceManager(AuthorizationData authorizationData)
Initializes a new instance of this class with the specified
AuthorizationData . |
BulkServiceManager(AuthorizationData authorizationData,
ApiEnvironment apiEnvironment) |
BulkServiceManager(AuthorizationData authorizationData,
ApiEnvironment apiEnvironment,
boolean enableRestApi) |
BulkServiceManager(AuthorizationData authorizationData,
boolean enableRestApi) |
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<BulkEntityIterable> |
downloadEntitiesAsync(DownloadParameters parameters,
AsyncCallback<BulkEntityIterable> callback)
Downloads the specified Bulk entities.
|
Future<BulkEntityIterable> |
downloadEntitiesAsync(DownloadParameters parameters,
Progress<BulkOperationProgressInfo> progress,
AsyncCallback<BulkEntityIterable> callback)
Downloads the specified Bulk entities.
|
Future<File> |
downloadFileAsync(DownloadParameters parameters,
AsyncCallback<File> callback)
Downloads the specified Bulk entities to a local file.
|
Future<File> |
downloadFileAsync(DownloadParameters parameters,
Progress<BulkOperationProgressInfo> progress,
AsyncCallback<File> callback)
Downloads the specified Bulk entities to a local file.
|
AuthorizationData |
getAuthorizationData()
Gets the authorization data for the user performing the operation.
|
BulkEntityReaderFactory |
getBulkEntityReaderFactory()
Reserved for internal use.
|
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.
|
int |
getUploadHttpTimeoutInMilliseconds()
Gets the timeout of HttpClient upload operation.
|
File |
getWorkingDirectory()
Gets the directory for storing temporary files needed for some operations.
|
ZipExtractor |
getZipExtractor()
Reserved for internal use.
|
void |
setBulkEntityReaderFactory(BulkEntityReaderFactory bulkEntityReaderFactory)
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 |
setUploadHttpTimeoutInMilliseconds(int uploadHttpTimeoutInMilliseconds)
Sets the timeout of HttpClient upload operation.
|
void |
setWorkingDirectory(File value)
Sets the directory for storing temporary files needed for some operations.
|
void |
setZipExtractor(ZipExtractor zipExtractor)
Reserved for internal use.
|
Future<BulkDownloadOperation> |
submitDownloadAsync(SubmitDownloadParameters parameters,
AsyncCallback<BulkDownloadOperation> callback)
Submits a download request to the Bing Ads bulk service with the specified parameters.
|
Future<BulkUploadOperation> |
submitUploadAsync(FileUploadParameters parameters,
AsyncCallback<BulkUploadOperation> callback)
Submits an upload request to the Bing Ads bulk service with the specified parameters.
|
Future<BulkEntityIterable> |
uploadEntitiesAsync(EntityUploadParameters parameters,
AsyncCallback<BulkEntityIterable> callback)
Uploads the specified Bulk entities.
|
Future<BulkEntityIterable> |
uploadEntitiesAsync(EntityUploadParameters parameters,
Progress<BulkOperationProgressInfo> progress,
AsyncCallback<BulkEntityIterable> callback)
Uploads the specified Bulk entities.
|
Future<File> |
uploadFileAsync(FileUploadParameters parameters,
AsyncCallback<File> callback)
Uploads the specified Bulk file.
|
Future<File> |
uploadFileAsync(FileUploadParameters parameters,
Progress<BulkOperationProgressInfo> progress,
AsyncCallback<File> callback)
Uploads the specified Bulk file.
|
public BulkServiceManager(AuthorizationData authorizationData)
AuthorizationData
.authorizationData
- Represents a user who intends to access the corresponding customer and account.public BulkServiceManager(AuthorizationData authorizationData, boolean enableRestApi)
public BulkServiceManager(AuthorizationData authorizationData, ApiEnvironment apiEnvironment)
public BulkServiceManager(AuthorizationData authorizationData, ApiEnvironment apiEnvironment, boolean enableRestApi)
public AuthorizationData getAuthorizationData()
public Future<BulkEntityIterable> downloadEntitiesAsync(DownloadParameters parameters, AsyncCallback<BulkEntityIterable> callback)
parameters
- Determines the download entities and file path. If a file path is not specified in the download
parameters, the enumerable of BulkEntity
is read from a temporary file path designated at
run time.callback
- a callback to call with an Iterable
of BulkEntity
objectspublic Future<BulkEntityIterable> downloadEntitiesAsync(DownloadParameters parameters, Progress<BulkOperationProgressInfo> progress, AsyncCallback<BulkEntityIterable> callback)
parameters
- Determines the download entities and file path. If a file path is not specified in the download
parameters, the enumerable of BulkEntity
is read from a temporary file path designated at
run time.progress
- an object which is updated with the progress of a bulk operationcallback
- a callback to call with an Iterable
of BulkEntity
objectspublic Future<BulkEntityIterable> uploadEntitiesAsync(EntityUploadParameters parameters, Progress<BulkOperationProgressInfo> progress, AsyncCallback<BulkEntityIterable> callback)
parameters
- determines the upload entities parametersprogress
- an object which is updated with the progress of bulk operationcallback
- a callback to call with an Iterable
of BulkEntity
objectspublic Future<BulkEntityIterable> uploadEntitiesAsync(EntityUploadParameters parameters, AsyncCallback<BulkEntityIterable> callback)
parameters
- determines the upload entities parameterscallback
- a callback to call with an Iterable
of BulkEntity
objectspublic Future<File> uploadFileAsync(FileUploadParameters parameters, AsyncCallback<File> callback)
parameters
- determines the file upload parameterscallback
- a callback which is called with the file path when the file is downloaded and availablepublic Future<File> uploadFileAsync(FileUploadParameters parameters, Progress<BulkOperationProgressInfo> progress, AsyncCallback<File> callback)
parameters
- determines the file upload parametersprogress
- an object which is updated with the progress of bulk operationcallback
- a callback which is called with the file path when the file is downloaded and availablepublic Future<File> downloadFileAsync(DownloadParameters parameters, AsyncCallback<File> callback)
parameters
- Determines the download entities 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<File> downloadFileAsync(DownloadParameters parameters, Progress<BulkOperationProgressInfo> progress, AsyncCallback<File> callback)
parameters
- Determines the download entities and file path.progress
- An object which is updated with the progress of a bulk operationcallback
- a callback which is called with the file path when the file is downloaded and availableFuture
that will indicate completion of the operationpublic Future<BulkDownloadOperation> submitDownloadAsync(SubmitDownloadParameters parameters, AsyncCallback<BulkDownloadOperation> callback)
The DownloadParameters.getResultFileDirectory()
and DownloadParameters.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 BulkOperation.downloadResultFileAsync(java.io.File, java.lang.String, boolean, com.microsoft.bingads.AsyncCallback<java.io.File>)
method.
parameters
- Describes the type of entities and data scope that you want to download.callback
- a callback will be called when the BulkDownloadOperation
has been createdFuture
that will indicate completion of the operationpublic Future<BulkUploadOperation> submitUploadAsync(FileUploadParameters parameters, AsyncCallback<BulkUploadOperation> callback)
The FileUploadParameters.getResultFileDirectory()
and FileUploadParameters.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 BulkOperation.downloadResultFileAsync(java.io.File, java.lang.String, boolean, com.microsoft.bingads.AsyncCallback<java.io.File>)
method.
parameters
- Describes the upload response mode and file name.callback
- a callback will be called when the BulkDownloadOperation
has been createdFuture
that will indicate completion of the operationpublic void cleanupTempFiles()
public HttpFileService getHttpFileService()
public void setHttpFileService(HttpFileService httpFileService)
public ZipExtractor getZipExtractor()
public void setZipExtractor(ZipExtractor zipExtractor)
public BulkEntityReaderFactory getBulkEntityReaderFactory()
public void setBulkEntityReaderFactory(BulkEntityReaderFactory bulkEntityReaderFactory)
public File getWorkingDirectory()
public void setWorkingDirectory(File value)
public int getStatusPollIntervalInMilliseconds()
public void setStatusPollIntervalInMilliseconds(int statusPollIntervalInMilliseconds)
public int getUploadHttpTimeoutInMilliseconds()
public void setUploadHttpTimeoutInMilliseconds(int uploadHttpTimeoutInMilliseconds)
public int getDownloadHttpTimeoutInMilliseconds()
public void setDownloadHttpTimeoutInMilliseconds(int downloadHttpTimeoutInMilliseconds)
Copyright © 2024. All rights reserved.