cameronhunter/glacier-cli — pull request #2 by brocklaporte (2012-11-28 16:15:49+00:00)
Title: Two small updates

Hi Cameron, I made two small updates you may be interested in pulling:

1. update aws sdk version to 1.3.26 in pom.xml
2. Changes to Glacier.java to set sns and sqs endpoints, necessary for downloads from non us-east-1 regions to work properly.

Item 1 above is commit b6e40bff7f700c3cda4d43f607c80f0f6ed3c4d5
Item 2 above is commit 7509ed623c58c39f35a4f56040ea2255be6b4ceb

(other commits I've made to pom.xml and README.md can be ignored)

Not sure exactly what info you need beyond this, so I am also pasting in the commit info as well here:

Item 1:
commit b6e40bff7f700c3cda4d43f607c80f0f6ed3c4d5
Author: bdl3
Date: Sat Nov 24 15:28:22 2012 -0800

Update pom.xml

updating aws-java-sdk dependency from 1.3.22 to 1.3.26

diff --git a/pom.xml b/pom.xml
index 7cfa15d..ee4bf11 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@

com.amazonaws
aws-java-sdk
- 1.3.22
+ 1.3.26

commons-cli

Item 2:
commit 7509ed623c58c39f35a4f56040ea2255be6b4ceb
Author: bdl3
Date: Sat Nov 24 15:26:46 2012 -0800

Update src/main/java/uk/co/cameronhunter/aws/glacier/Glacier.java

setting endpoints for sns and sqs, plus changing to new constructor. Reported to handle issues with downloading from non us-east-1 regions - refer to this thread:

https://forums.aws.amazon.com/thread.jspa?threadID=102702

diff --git a/src/main/java/uk/co/cameronhunter/aws/glacier/Glacier.java b/src/main/java/uk/co/cameronhunter/aws/glacier/Glacier.java
index 4ea5544..2969a2f 100644
--- a/src/main/java/uk/co/cameronhunter/aws/glacier/Glacier.java
+++ b/src/main/java/uk/co/cameronhunter/aws/glacier/Glacier.java
@@ -29,6 +29,8 @@ import uk.co.cameronhunter.aws.glacier.domain.Vault;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.services.glacier.AmazonGlacierClient;
+import com.amazonaws.services.sns.AmazonSNSClient;
+import com.amazonaws.services.sqs.AmazonSQSClient;
import com.amazonaws.services.glacier.transfer.ArchiveTransferManager;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableSet;
@@ -47,6 +49,8 @@ public class Glacier implements Closeable {

private final ExecutorService workers;
private final AmazonGlacierClient client;
+ private final AmazonSNSClient sns;
+ private final AmazonSQSClient sqs;
private final ArchiveTransferManager transferManager;
private final Set vaults;

@@ -64,7 +68,14 @@ public class Glacier implements Closeable {

this.client = new AmazonGlacierClient( credentials );
this.client.setEndpoint( "https://glacier." + region + ".amazonaws.com/" );
- this.transferManager = new ArchiveTransferManager( client, credentials );
+
+ this.sns = new AmazonSNSClient( credentials );
+ this.sns.setEndpoint( "https://sns." + region + ".amazonaws.com/" );
+
+ this.sqs = new AmazonSQSClient( credentials );
+ this.sqs.setEndpoint( "https://sqs." + region + ".amazonaws.com/" );
+
+ this.transferManager = new ArchiveTransferManager( this.client, this.sqs, this.sns );

LOG.info( "Retrieving vault names in \"" + region + "\" region" );

After these changes I've verified downloads from us-west-2 are working.

Cheers
Brock