Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.glacier.transfer
Class ArchiveTransferManager

java.lang.Object
  extended by com.amazonaws.services.glacier.transfer.ArchiveTransferManager

public class ArchiveTransferManager
extends Object

Utilities for uploading and downloading data to and from AWS Glacier.


Constructor Summary
ArchiveTransferManager(AmazonGlacierClient glacier, AmazonSQSClient sqs, AmazonSNSClient sns)
          Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client, and the specified Amazon SQS and Amazon SNS clients for polling download job status.
ArchiveTransferManager(AmazonGlacierClient glacier, AWSCredentials credentials)
          Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client and AWS credentials.
ArchiveTransferManager(AmazonGlacierClient glacier, AWSCredentialsProvider credentialsProvider)
          Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client and AWS credentials provider.
ArchiveTransferManager(AmazonGlacierClient glacier, AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration)
          Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client, AWS credentials provider and client configuration.
ArchiveTransferManager(AWSCredentials credentials)
          Constructs a new ArchiveTransferManager, using the specified AWS credentials to authenticate requests.
ArchiveTransferManager(AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration)
          Constructs a new ArchiveTransferManager, using the specified AWS credentials provider and client configuration.
 
Method Summary
 void download(String vaultName, String archiveId, File file)
          Downloads an archive from Amazon Glacier in the specified vault for the current user's account, and saves it to the specified file.
 void download(String accountId, String vaultName, String archiveId, File file)
          Downloads an archive from Amazon Glacier in the specified vault in the specified user's account, and saves it to the specified file.
 UploadResult upload(String vaultName, String archiveDescription, File file)
          Uploads the specified file to Amazon Glacier for archival storage in the specified vault for the user's current account.
 UploadResult upload(String accountId, String vaultName, String archiveDescription, File file)
          Uploads the specified file to Amazon Glacier for archival storage in the specified vault in the specified user's account.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveTransferManager

public ArchiveTransferManager(AWSCredentials credentials)
Constructs a new ArchiveTransferManager, using the specified AWS credentials to authenticate requests.

Parameters:
credentials - The AWS credentials used to authenticate requests.

ArchiveTransferManager

public ArchiveTransferManager(AWSCredentialsProvider credentialsProvider,
                              ClientConfiguration clientConfiguration)
Constructs a new ArchiveTransferManager, using the specified AWS credentials provider and client configuration.

Parameters:
credentialsProvider - The AWS credentials provider used to authenticate requests.
clientConfiguration - Client specific options, such as proxy settings, retries, and timeouts.

ArchiveTransferManager

public ArchiveTransferManager(AmazonGlacierClient glacier,
                              AWSCredentialsProvider credentialsProvider)
Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client and AWS credentials provider.

Parameters:
glacier - The client for working with Amazon Glacier.
credentialsProvider - The AWS credentials provider used to authenticate requests.

ArchiveTransferManager

public ArchiveTransferManager(AmazonGlacierClient glacier,
                              AWSCredentials credentials)
Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client and AWS credentials.

Parameters:
glacier - The client for working with Amazon Glacier.
credentials - The AWS credentials used to authenticate requests.

ArchiveTransferManager

public ArchiveTransferManager(AmazonGlacierClient glacier,
                              AWSCredentialsProvider credentialsProvider,
                              ClientConfiguration clientConfiguration)
Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client, AWS credentials provider and client configuration.

Parameters:
glacier - The client for working with Amazon Glacier.
credentialsProvider - The AWS credentials provider used to authenticate requests.
clientConfiguration - Client specific options, such as proxy settings, retries, and timeouts.

ArchiveTransferManager

public ArchiveTransferManager(AmazonGlacierClient glacier,
                              AmazonSQSClient sqs,
                              AmazonSNSClient sns)
Constructs a new ArchiveTransferManager, using the specified Amazon Glacier client, and the specified Amazon SQS and Amazon SNS clients for polling download job status.

This constructor form can be used to work with ArchiveTransferManager in any AWS region where Amazon Glacier is supported. Just make sure to set the correct endpoint on each individual client object so that they all operate in the same region.

Parameters:
glacier - The client for working with Amazon Glacier.
sqs - The client for working with Amazon SQS when polling archive retrieval job status.
sns - The client for working with Amazon SNS when polling archive retrieval job status.
Method Detail

upload

public UploadResult upload(String vaultName,
                           String archiveDescription,
                           File file)
                    throws AmazonServiceException,
                           AmazonClientException,
                           FileNotFoundException
Uploads the specified file to Amazon Glacier for archival storage in the specified vault for the user's current account. For small archives, this method will upload the archive directly to Glacier. For larger archives, this method will use Glacier's multipart upload API to split the upload into multiple parts for better error recovery if any errors are encountered while streaming the data to Amazon Glacier.

Parameters:
vaultName - The name of the vault to upload to.
archiveDescription - The description of the new archive being uploaded.
file - The file to upload to Amazon Glacier.
Returns:
The result of the upload, including the archive ID needed to access the upload later.
Throws:
AmazonServiceException - If any problems were encountered while communicating with AWS.
AmazonClientException - If any problems were encountered inside the AWS SDK for Java client code in making requests or processing responses from AWS.
FileNotFoundException - If the specified file to upload doesn't exist.

upload

public UploadResult upload(String accountId,
                           String vaultName,
                           String archiveDescription,
                           File file)
                    throws AmazonServiceException,
                           AmazonClientException,
                           FileNotFoundException
Uploads the specified file to Amazon Glacier for archival storage in the specified vault in the specified user's account. For small archives, this method will upload the archive directly to Glacier. For larger archives, this method will use Glacier's multipart upload API to split the upload into multiple parts for better error recovery if any errors are encountered while streaming the data to Amazon Glacier.

Parameters:
accountId - The ID for the account which owns the Glacier vault being uploaded to. To use the same account the developer is using to make requests to AWS, the value "-" can be used instead of the full account ID.
vaultName - The name of the vault to upload to.
archiveDescription - The description of the new archive being uploaded.
file - The file to upload to Amazon Glacier.
Returns:
The result of the upload, including the archive ID needed to access the upload later.
Throws:
AmazonServiceException - If any problems were encountered while communicating with AWS.
AmazonClientException - If any problems were encountered inside the AWS SDK for Java client code in making requests or processing responses from AWS.
FileNotFoundException - If the specified file to upload doesn't exist.

download

public void download(String vaultName,
                     String archiveId,
                     File file)
              throws AmazonServiceException,
                     AmazonClientException
Downloads an archive from Amazon Glacier in the specified vault for the current user's account, and saves it to the specified file. Amazon Glacier is optimized for long term storage of data that isn't needed quickly. This method will first make a request to Amazon Glacier to prepare the archive to be downloaded. Once Glacier has finished preparing the archive to be downloaded, this method will start downloading the data and storing it in the specified file.

Parameters:
vaultName - The name of the vault to download the archive from.
archiveId - The unique ID of the archive to download.
file - The file save the archive to.
Throws:
AmazonServiceException - If any problems were encountered while communicating with AWS.
AmazonClientException - If any problems were encountered inside the AWS SDK for Java client code in making requests or processing responses from AWS.

download

public void download(String accountId,
                     String vaultName,
                     String archiveId,
                     File file)
              throws AmazonServiceException,
                     AmazonClientException
Downloads an archive from Amazon Glacier in the specified vault in the specified user's account, and saves it to the specified file. Amazon Glacier is optimized for long term storage of data that isn't needed quickly. This method will first make a request to Amazon Glacier to prepare the archive to be downloaded. Once Glacier has finished preparing the archive to be downloaded, this method will start downloading the data and storing it in the specified file.

Parameters:
accountId - The ID for the account which owns the Glacier vault where the archive is being downloaded from. To use the same account the developer is using to make requests to AWS, the value "-" can be used instead of the full account ID.
vaultName - The name of the vault to download the archive from.
archiveId - The unique ID of the archive to download.
file - The file save the archive to.
Throws:
AmazonServiceException - If any problems were encountered while communicating with AWS.
AmazonClientException - If any problems were encountered inside the AWS SDK for Java client code in making requests or processing responses from AWS.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.