private void init() { exceptionUnmarshallers.add(new SubscriptionLimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller()); exceptionUnmarshallers.add(new EndpointDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new FilterPolicyLimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new KMSOptInRequiredExceptionUnmarshaller()); exceptionUnmarshallers.add(new KMSAccessDeniedExceptionUnmarshaller()); exceptionUnmarshallers.add(new KMSInvalidStateExceptionUnmarshaller()); exceptionUnmarshallers.add(new NotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new KMSDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new KMSNotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new TopicLimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new ThrottledExceptionUnmarshaller()); exceptionUnmarshallers.add(new PlatformApplicationDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new InternalErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new KMSThrottlingExceptionUnmarshaller()); exceptionUnmarshallers.add(new AuthorizationErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidSecurityExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.sns.model.AmazonSNSException.class)); setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://sns.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/sns/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/sns/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
private void init() { exceptionUnmarshallers.add(new AuthorizationErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new EndpointDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new InternalErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller()); exceptionUnmarshallers.add(new NotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new PlatformApplicationDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new SubscriptionLimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new ThrottledExceptionUnmarshaller()); exceptionUnmarshallers.add(new TopicLimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sns.us-east-1.amazonaws.com"); this.endpointPrefix = "sns"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( "/com/amazonaws/services/sns/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain( "/com/amazonaws/services/sns/request.handler2s")); }
public void download(String vaultName, String archiveId, String downloadFilePath) { String msg = "Downloading " + archiveId + " from Glacier vault " + vaultName; System.out.println(msg); sqsClient = new AmazonSQSClient(credentials); sqsClient.setEndpoint("https://sqs." + region + ".amazonaws.com"); snsClient = new AmazonSNSClient(credentials); snsClient.setEndpoint("https://sns." + region + ".amazonaws.com"); try { ArchiveTransferManager atm = new ArchiveTransferManager(client, sqsClient, snsClient); atm.download(vaultName, archiveId, new File(downloadFilePath)); } catch (Exception e) { throw new RuntimeException("Error " + msg, e); } }
private void init() { exceptionUnmarshallers.add(new AuthorizationErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new EndpointDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new InternalErrorExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterExceptionUnmarshaller()); exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller()); exceptionUnmarshallers.add(new NotFoundExceptionUnmarshaller()); exceptionUnmarshallers.add(new PlatformApplicationDisabledExceptionUnmarshaller()); exceptionUnmarshallers.add(new SubscriptionLimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new ThrottledExceptionUnmarshaller()); exceptionUnmarshallers.add(new TopicLimitExceededExceptionUnmarshaller()); exceptionUnmarshallers.add(new StandardErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sns.us-east-1.amazonaws.com"); this.endpointPrefix = "sns"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( "/com/amazonaws/services/sns/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain( "/com/amazonaws/services/sns/request.handler2s")); }
public void inventory(String vaultName, String snsTopicName, String sqsQueueName, String fileName) { String msg = "Requesting inventory from Glacier vault " + vaultName + ". It might take around 4 hours."; System.out.println(msg); sqsClient = new AmazonSQSClient(credentials); sqsClient.setEndpoint("https://sqs." + region + ".amazonaws.com"); snsClient = new AmazonSNSClient(credentials); snsClient.setEndpoint("https://sns." + region + ".amazonaws.com"); try { QueueConfig config = setupSQS(sqsQueueName); config = setupSNS(config, snsTopicName); String jobId = initiateJobRequest(vaultName, config.snsTopicARN); System.out.println("Jobid = " + jobId); Boolean success = waitForJobToComplete(jobId, config.sqsQueueURL); if (!success) { throw new Exception("Job did not complete successfully."); } downloadJobOutput(vaultName, jobId, fileName); cleanUp(config); } catch (Exception e) { System.err.println("Archive retrieval failed."); System.err.println(e); } }
dlSNS.setEndpoint(endpoint.getSNSEndpoint());
sns.setEndpoint(CMBProperties.getInstance().getCNSServiceUrl());
/********************** Member Functions **************************/ public AwsGlacierInventoryRetriever(String region) { // Get credentials from credentials file, environment variable, or // Java property. // See http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html AWSCredentialsProviderChain credentialsProvider = new DefaultAWSCredentialsProviderChain(); AWSCredentials credentials = credentialsProvider.getCredentials(); logger.debug("Read in credentials AWSAccessKeyId={} AWSSecretKey={}...", credentials.getAWSAccessKeyId(), credentials.getAWSSecretKey().substring(0, 4)); // Create the glacier client and set to specified region. glacierClient = new AmazonGlacierClient(credentials); glacierClient.setEndpoint("https://glacier." + region + ".amazonaws.com"); // Set up params needed for retrieving vault inventory sqsClient = new AmazonSQSClient(credentials); sqsClient.setEndpoint("https://sqs." + region + ".amazonaws.com"); snsClient = new AmazonSNSClient(credentials); snsClient.setEndpoint("https://sns." + region + ".amazonaws.com"); setupSQS(); setupSNS(); }
sqsClient.setEndpoint("https://sqs." + region + ".amazonaws.com"); snsClient = new AmazonSNSClient(credentials); snsClient.setEndpoint("https://sns." + region + ".amazonaws.com");