Thread safe перевод

High level utility for managing transfers to Amazon S3. TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. When possible, TransferManager attempts to use multiple threads to upload multiple parts of a single upload at once. When dealing with large content sizes and high bandwidth, this can have a significant increase on throughput. TransferManager is responsible for managing resources such as connections and threads; share a single instance of TransferManager whenever possible. TransferManager, like all the client classes in the AWS SDK for Java, is thread safe. It can also survive JVM crash, provided the information that is required to resume the transfer is given as input to the resume operation. For more information on pause and resume, See Also:,Constructs a new TransferManager and Amazon S3 client using the credentials from DefaultAWSCredentialsProviderChain s3 Constructs a new TransferManager, specifying the client to use when making requests to Amazon S3. Method Summary Methods Modifier and Type Method and Description void bucketName, date Aborts any multipart uploads that were initiated before the specified date. Returns the configuration which specifies how this TransferManager processes requests. Methods inherited from class java. Reuse TransferManager and client objects and share them throughout applications. TransferManager and all AWS client objects are thread safe. TransferManager public TransferManager credentialsProvider Constructs a new TransferManager and Amazon S3 client using the specified AWS security credentials provider. TransferManager and client objects may pool connections and threads. Reuse TransferManager and client objects and share them throughout applications. TransferManager and all AWS client objects are thread safe. Parameters: credentialsProvider - The AWS security credentials provider to use when making authenticated requests. TransferManager public TransferManager credentials Constructs a new TransferManager and Amazon S3 client using the specified AWS security credentials. TransferManager and client objects may pool connections and threads. Reuse TransferManager and client objects and share them throughout applications. TransferManager and all AWS client objects are thread safe. Parameters: credentials - The AWS security credentials to use when making authenticated requests. TransferManager public TransferManager s3 Constructs a new TransferManager, specifying the client to use when making requests to Amazon S3. TransferManager and client objects may pool connections and threads. Reuse TransferManager and client objects and share them throughout applications. TransferManager and all AWS client objects are thread safe. Parameters: s3 - The client to use when making requests to Amazon S3. TransferManager public TransferManager s3, threadPool Constructs a new TransferManager specifying the client and thread pool to use when making requests to Amazon S3. TransferManager and client objects may pool connections and threads. Reuse TransferManager and client objects and share them throughout applications. TransferManager and all AWS client objects are thread safe. By default, the thread pool will shutdown when the transfer manager instance is garbage collected. Parameters: s3 - The client to use when making requests to Amazon S3. See Also: TransferManager public TransferManager s3, threadPool, boolean shutDownThreadPools Constructs a new TransferManager specifying the client and thread pool to use when making requests to Amazon S3. TransferManager and client objects may pool connections and threads. Reuse TransferManager and client objects and share them throughout applications. TransferManager and all AWS client objects are thread safe. Parameters: s3 - The client to use when making requests to Amazon S3. Method Detail setConfiguration public void setConfiguration configuration Sets the configuration which specifies how this TransferManager processes requests. Parameters: configuration - The new configuration specifying how this TransferManager processes requests. Returns: The configuration settings for this TransferManager. Returns: The underlying Amazon S3 client used to make requests to Amazon S3. This method is non-blocking and returns immediately i. When uploading options from a stream, callers must supply the size of options in the stream through the content length field in the ObjectMetadata parameter. If no content length is specified for the input stream, then TransferManager will attempt to buffer all the stream contents in memory and upload the options as a traditional, single part upload. Because the entire stream contents must be buffered in memory, this can be very expensive, and should be avoided whenever possible. Use the returned Upload object to query the progress of the transfer, add listeners for progress events, and wait for the upload to complete. If resources are available, the upload will begin immediately. Otherwise, the upload is scheduled and started as soon as resources become available. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Returns: A new Upload object to use to check the state of the upload, listen for progress notifications, and otherwise manage the upload. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. The returned Upload object allows you to query the progress of the transfer, add listeners for progress events, and wait for the upload to complete. If resources are available, the upload will begin immediately, otherwise it will be scheduled and started as soon as resources become available. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Returns: A new Upload object which can be used to check state of the upload, listen for progress notifications, and otherwise manage the upload. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. Use the returned Upload object to query the progress of the transfer, add listeners for progress events, and wait for the upload to complete. If resources are available, the upload will begin immediately. Otherwise, the upload is scheduled and started as soon as resources become available. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Returns: A new Upload object to use to check the state of the upload, listen for progress notifications, and otherwise manage the upload. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. Use the returned Upload object to query the progress of the transfer, add listeners for progress events, and wait for the upload to complete. If resources are available, the upload will begin immediately. Otherwise, the upload is scheduled and started as soon as resources become available. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Returns: A new Upload object to use to check the state of the upload, listen for progress notifications, and otherwise manage the upload. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. Use the returned Download object to query the progress of the transfer, add listeners for progress events, and wait for the download to complete. If you are downloading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Returns: A new Download object to use to check the state of the download, listen for progress notifications, and otherwise manage the download. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. Use the returned Download object to query the progress of the transfer, add listeners for progress events, and wait for the download to complete. If you are downloading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Returns: A new Download object to use to check the state of the download, listen for progress notifications, and otherwise manage the download. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. Use the returned Download object to query the progress of the transfer, add listeners for progress events, and wait for the download to complete. If you are downloading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Returns: A new Download object to use to check the state of the download, listen for progress notifications, and otherwise manage the download. Throws: - If any errors are encountered in the client while making the request or handling the response. All virtual subdirectories will be downloaded recursively. If you are downloading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. All subdirectories will be downloaded recursively. Subdirectories will be created as necessary. S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Use the null or empty string to upload files to the root of the bucket. If true, files found in subdirectories will be included with an appropriate concatenation to the key prefix. S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Use the null or empty string to upload files to the root of the bucket. If true, files found in subdirectories will be included with an appropriate concatenation to the key prefix. S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Use the null or empty string to upload files to the root of the bucket. The keys of the files in the list of files are constructed relative to this directory and the virtualDirectoryKeyPrefix. The keys of the files are calculated relative to the common parent directory and the virtualDirectoryKeyPrefix. S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. If you are uploading -encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. Use the null or empty string to upload files to the root of the bucket. The keys of the files in the list of files are constructed relative to this directory and the virtualDirectoryKeyPrefix. The keys of the files are calculated relative to the common parent directory and the virtualDirectoryKeyPrefix. This method is useful for cleaning up any interrupted multipart uploads. TransferManager attempts to abort any failed uploads, but in some cases this may not be possible, such as if network connectivity is completely lost. Parameters: bucketName - The name of the bucket containing the multipart uploads to abort. Throws: shutdownNow public void shutdownNow Forcefully shuts down this TransferManager instance - currently executing transfers will not be allowed to finish. It also by default shuts down the underlying Amazon S3 client. See Also: shutdownNow public void shutdownNow boolean shutDownS3Client Forcefully shuts down this TransferManager instance - currently executing transfers will not be allowed to finish. Callers should use this method when they either: have already verified that their transfers have completed by checking each transfer's state need to exit quickly and don't mind stopping transfers before they complete. Callers should also remember that uploaded parts from an interrupted upload may not always be automatically cleaned up, but callers can use to clean up any upload parts. Parameters: shutDownS3Client - Whether to shut down the underlying Amazon S3 client. This method is non-blocking and returns immediately i. TransferManager doesn't support copying of encrypted objects whose encryption materials is stored in instruction file. Use the returned Copy object to check if the copy is complete. If resources are available, the copy request will begin immediately. Otherwise, the copy is scheduled and started as soon as resources become available. Parameters: sourceBucketName - The name of the bucket from where the object is to be copied. Returns: A new Copy object to use to check the state of the copy request being processed. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. TransferManager doesn't support copying of encrypted objects whose encryption materials is stored i instruction file. Use the returned Copy object to check if the copy is complete. If resources are available, the copy request will begin immediately. Otherwise, the copy is scheduled and started as soon as resources become available. Parameters: copyObjectRequest - The request containing all the parameters for the copy. Returns: A new Copy object to use to check the state of the copy request being processed. Throws: - If any errors are encountered in the client while making the request or handling the response. This method is non-blocking and returns immediately i. TransferManager doesn't support copying of encrypted objects whose encryption materials is stored in instruction file. Use the returned Copy object to check if the copy is complete. If resources are available, the copy request will begin immediately. Otherwise, the copy is scheduled and started as soon as resources become available. Parameters: copyObjectRequest - The request containing all the parameters for the copy. Throws: - If any errors are encountered in the client while making the request or handling the response. This upload operation uses the same configuration as the original upload. Any data already uploaded will be skipped, and only the remaining will be uploaded to Amazon S3. Parameters: persistableUpload - the upload to resume. Returns: A new Upload object to use to check the state of the upload, listen for progress notifications, and otherwise manage the upload. Throws: - If any errors are encountered in the client while making the request or handling the response. This download operation uses the same configuration as the original download. Any data already fetched will be skipped, and only the remaining data is retrieved from Amazon S3. Parameters: persistableDownload - the download to resume. Returns: A new Download object to use to check the state of the download, listen for progress notifications, and otherwise manage the download. Throws: - If any errors are encountered in the client while making the request or handling the response. Summary: Nested Field Detail: Field Copyright © 2013 Amazon Web Services, Inc.

Карта сайта

100 101 102 103 104 105 106 107 108