airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r1483031 - /airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
Date Wed, 15 May 2013 19:33:00 GMT
Author: amilaj
Date: Wed May 15 19:32:59 2013
New Revision: 1483031

URL: http://svn.apache.org/r1483031
Log:
add code not to create credentials again and again

Modified:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java?rev=1483031&r1=1483030&r2=1483031&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/context/security/GSISecurityContext.java
Wed May 15 19:32:59 2013
@@ -22,7 +22,6 @@ package org.apache.airavata.gfac.context
 
 import java.util.Properties;
 
-import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.utils.MyProxyManager;
 import org.globus.gsi.GlobusCredential;
 import org.ietf.jgss.GSSCredential;
@@ -42,7 +41,7 @@ public class GSISecurityContext extends 
 
     private MyProxyManager myProxyManager;
 
-    private GSSCredential gssCredentials;
+    private GSSCredential gssCredentials = null;
 
     private GlobusCredential globusCredential;
 
@@ -75,21 +74,22 @@ public class GSISecurityContext extends 
 
     public GSSCredential getGssCredentials() throws SecurityException {
 
-        GSSCredential credential = null;
+        if (gssCredentials != null)
+            return gssCredentials;
 
         try {
 
-            credential = this.myProxyManager.getCredentialsFromStore(gatewayId, tokenId);
+            gssCredentials = this.myProxyManager.getCredentialsFromStore(gatewayId, tokenId);
 
         } catch (Exception e) {
             log.warn("An error occurred while retrieving credentials from credential store.
" +
                     "But continuing with password credentials. ", e);
         }
 
-        if (credential == null)
+        if (gssCredentials == null)
             return getGssCredentialsFromUserPassword();
         else
-            return credential;
+            return gssCredentials;
     }
 
 



Mime
View raw message