'Instantiate a BulkTransporterApp.
Uploads or downloads data to or from application using HTTP requests.
When run, the class will spin up a number of threads to read entities
from the data source, pass those to a number of worker threads
for sending to the application, and track all of the progress in a
small database in case an error or pause/termination requires a
restart/resumption of the upload process.
Args:
arg_dict: Dictionary of command line options.
input_generator_factory: A factory that creates a WorkItem generator.
throttle: A Throttle instance.
progress_db: The database to use for replaying/recording progress.
progresstrackerthread_factory: Used for dependency injection.
max_queue_size: Maximum size of the queues before they should block.
request_manager_factory: Used for dependency injection.
datasourcethread_factory: Used for dependency injection.
progress_queue_factory: Used for dependency injection.
thread_pool_factory: Used for dependency injection.
throttle_class: None, or class to use for throttling.
server: An existing AbstractRpcServer to reuse.
oauth2_parameters: None, or an
appengine_rpc_httplib2.HttpRpcServerOAuth2.OAuth2Parameters instance.'

def __init__(self, arg_dict, input_generator_factory, throttle, progress_db, progresstrackerthread_factory, max_queue_size=DEFAULT_QUEUE_SIZE, request_manager_factory=RequestManager, datasourcethread_factory=DataSourceThread, progress_queue_factory=Queue.Queue, thread_pool_factory=adaptive_thread_pool.AdaptiveThreadPool, throttle_class=None, server=None, oauth2_parameters=None):

    self.app_id = arg_dict['application']
    self.post_url = arg_dict['url']
    self.kind = arg_dict['kind']
    self.batch_size = arg_dict['batch_size']
    self.input_generator_factory = input_generator_factory
    self.num_threads = arg_dict['num_threads']
    self.dry_run = arg_dict['dry_run']
    self.throttle = throttle
    self.progress_db = progress_db
    self.progresstrackerthread_factory = progresstrackerthread_factory
    self.max_queue_size = max_queue_size
    self.request_manager_factory = request_manager_factory
    self.datasourcethread_factory = datasourcethread_factory
    self.progress_queue_factory = progress_queue_factory
    self.thread_pool_factory = thread_pool_factory
    self.throttle_class = throttle_class
    self.server = server
    (scheme, self.host_port, self.url_path, unused_query, unused_fragment) = urlparse.urlsplit(self.post_url)
    self.secure = (scheme == 'https')
    self.oauth2_parameters = oauth2_parameters
