Example usage for com.amazonaws.services.glacier AmazonGlacierClient setRegion

List of usage examples for com.amazonaws.services.glacier AmazonGlacierClient setRegion

Introduction

In this page you can find the example usage for com.amazonaws.services.glacier AmazonGlacierClient setRegion.

Prototype

@Deprecated
public void setRegion(Region region) throws IllegalArgumentException 

Source Link

Document

An alternative to AmazonWebServiceClient#setEndpoint(String) , sets the regional endpoint for this client's service calls.

Usage

From source file:com.optimalbi.AmazonAccount.java

License:Apache License

private void populateGlacier() throws AmazonClientException {
    for (Region r : regions) {
        if (r.isServiceSupported(ServiceAbbreviations.Glacier)) {
            AmazonGlacierClient glacierClient = new AmazonGlacierClient(credentials.getCredentials());
            glacierClient.setRegion(r);
            ListVaultsResult result = glacierClient.listVaults(new ListVaultsRequest());
            List<DescribeVaultOutput> vaults = result.getVaultList();
            for (DescribeVaultOutput d : vaults) {
                DescribeVaultResult res = glacierClient
                        .describeVault(new DescribeVaultRequest(d.getVaultName()));
                Service temp = new LocalGlacierService(d.getVaultName(), credentials, r, res, logger);
                services.add(temp);/*from  w w  w  .  j a va 2s. c o m*/
            }
        }
    }
}