usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [43/50] [abbrv] git commit: change access key logic
Date Mon, 20 Oct 2014 13:47:11 GMT
change access key logic


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c27a090f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c27a090f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c27a090f

Branch: refs/heads/two-dot-o-events
Commit: c27a090fa492093774848412a66307b82c948afc
Parents: c522a93
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Fri Oct 17 18:06:38 2014 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Fri Oct 17 18:06:38 2014 -0600

----------------------------------------------------------------------
 .../persistence/queue/impl/SQSQueueManagerImpl.java      | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c27a090f/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SQSQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SQSQueueManagerImpl.java
b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SQSQueueManagerImpl.java
index 4b86a52..caf5691 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SQSQueueManagerImpl.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SQSQueueManagerImpl.java
@@ -221,7 +221,7 @@ public class SQSQueueManagerImpl implements QueueManager {
                 @Override
                 public String getAWSAccessKeyId() {
                     String accessKey = System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR);
-                    if(accessKey == null){
+                    if(StringUtils.isEmpty(accessKey)){
                         accessKey = System.getProperty(SDKGlobalConfiguration.ALTERNATE_ACCESS_KEY_ENV_VAR);
                     }
                     return StringUtils.trim(accessKey);
@@ -230,14 +230,17 @@ public class SQSQueueManagerImpl implements QueueManager {
                 @Override
                 public String getAWSSecretKey() {
                     String secret = System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR);
-                    if(secret==null){
+                    if(StringUtils.isEmpty(secret)){
                         secret = System.getProperty(SDKGlobalConfiguration.ALTERNATE_SECRET_KEY_ENV_VAR);
                     }
                     return StringUtils.trim(secret);
                 }
             };
-            if(StringUtils.isEmpty(creds.getAWSAccessKeyId()) || StringUtils.isEmpty(creds.getAWSSecretKey())
){
-                throw new AmazonClientException("could not retrieve credentials from system
properties");
+            if(StringUtils.isEmpty(creds.getAWSAccessKeyId())){
+                throw new AmazonClientException("could not get aws access key from system
properties");
+            }
+            if(StringUtils.isEmpty(creds.getAWSSecretKey())){
+                throw new AmazonClientException("could not get aws secret key from system
properties");
             }
         }
 


Mime
View raw message