List of usage examples for com.amazonaws AmazonServiceException getErrorCode
public String getErrorCode()
From source file:com.amazon.aws.demo.anonymous.sdb.SdbDomainCreate.java
License:Open Source License
public void wireSubmitButton() { submitButton.setOnClickListener(new View.OnClickListener() { @Override/* w w w . j av a 2s . c om*/ public void onClick(View v) { domainName.setVisibility(View.INVISIBLE); try { SimpleDB.createDomain(domainName.getText().toString()); finish(); } catch (AmazonServiceException e) { if ("InvalidClientTokenId".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }); }
From source file:com.amazon.aws.demo.anonymous.sdb.SdbItemCreate.java
License:Open Source License
public void wireSubmitButton() { submitButton.setOnClickListener(new View.OnClickListener() { @Override//from ww w.j a v a 2 s . com public void onClick(View v) { itemName.setVisibility(View.INVISIBLE); try { SimpleDB.createItem(domainName.getSelectedItem().toString(), itemName.getText().toString()); finish(); } catch (AmazonServiceException e) { if ("InvalidClientTokenId".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }); }
From source file:com.amazon.aws.demo.anonymous.sns.SnsCreateTopic.java
License:Open Source License
public void wireSubmitButton() { submitButton.setOnClickListener(new View.OnClickListener() { @Override//from www .j a va 2 s . c o m public void onClick(View v) { topicName.setVisibility(View.INVISIBLE); try { SimpleNotification.createTopic(topicName.getText().toString()); finish(); } catch (AmazonServiceException e) { if ("ExpiredToken".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }); }
From source file:com.amazon.aws.demo.anonymous.sns.SnsPublish.java
License:Open Source License
private void getTopicArn() { Thread t = new Thread() { @Override/*from w w w . j a v a2s. c om*/ public void run() { try { topicArns = SimpleNotification.getTopicNames(); mHandler.post(postResults); } catch (AmazonServiceException e) { if ("ExpiredToken".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }; t.start(); }
From source file:com.amazon.aws.demo.anonymous.sns.SnsPublish.java
License:Open Source License
private void wireSubmitButton() { submitButton.setOnClickListener(new View.OnClickListener() { @Override// w ww. j av a2 s . c o m public void onClick(View v) { topicSpinner.setVisibility(View.INVISIBLE); messageInput.setVisibility(View.INVISIBLE); try { SimpleNotification.publish(topicSpinner.getSelectedItem().toString(), messageInput.getText().toString()); finish(); } catch (AmazonServiceException e) { if ("ExpiredToken".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }); }
From source file:com.amazon.aws.demo.anonymous.sns.SnsSubscribe.java
License:Open Source License
private void getTopicArn() { Thread t = new Thread() { @Override/* w w w . j av a 2s .co m*/ public void run() { try { topicArns = SimpleNotification.getTopicNames(); queueUrls = SimpleQueue.getQueueUrls(); mHandler.post(postResults); } catch (AmazonServiceException e) { if ("ExpiredToken".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }; t.start(); }
From source file:com.amazon.aws.demo.anonymous.sns.SnsSubscribe.java
License:Open Source License
private void subscribeQueue(String url, String arn) { final String tUrl = url; final String tArn = arn; Thread t = new Thread() { @Override/*from ww w .jav a2 s.c o m*/ public void run() { try { SimpleQueue.allowNotifications(tUrl, tArn); mHandler.post(postProp); } catch (AmazonServiceException e) { if ("ExpiredToken".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } try { Thread.sleep(POLICY_PROPAGATION_TIME_IN_SECONDS * 1000); } catch (InterruptedException e) { e.printStackTrace(); } try { String end = SimpleQueue.getQueueArn(tUrl); SimpleNotification.subscribe(tArn, (String) protocolSpinner.getSelectedItem(), end); mHandler.post(postDone); } catch (AmazonServiceException e) { if ("ExpiredToken".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }; t.start(); }
From source file:com.amazon.aws.demo.anonymous.sqs.SqsCreateQueue.java
License:Open Source License
public void wireSubmitButton() { submitButton.setOnClickListener(new View.OnClickListener() { @Override//w w w. j a v a2s.c o m public void onClick(View v) { queueName.setVisibility(View.INVISIBLE); try { SimpleQueue.createQueue(queueName.getText().toString()); finish(); } catch (AmazonServiceException e) { if ("InvalidAccessKeyId".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }); }
From source file:com.amazon.aws.demo.anonymous.sqs.SqsSendMessages.java
License:Open Source License
private void getTopicArn() { Thread t = new Thread() { @Override//from w w w . jav a2 s . c om public void run() { try { queueUrls = SimpleQueue.getQueueUrls(); mHandler.post(postResults); } catch (AmazonServiceException e) { if ("InvalidAccessKeyId".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }; t.start(); }
From source file:com.amazon.aws.demo.anonymous.sqs.SqsSendMessages.java
License:Open Source License
private void wireSubmitButton() { submitButton.setOnClickListener(new View.OnClickListener() { @Override/* ww w . ja va 2s. com*/ public void onClick(View v) { queueSpinner.setVisibility(View.INVISIBLE); messageInput.setVisibility(View.INVISIBLE); try { SimpleQueue.sendMessage(queueSpinner.getSelectedItem().toString(), messageInput.getText().toString()); finish(); } catch (AmazonServiceException e) { if ("InvalidAccessKeyId".equals(e.getErrorCode())) { putRefreshError(); } else { setStackAndPost(e); } } catch (Throwable e) { setStackAndPost(e); } } }); }