airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [02/15] Implemented Orchestrator side improvements of AIRAVATA-1426
Date Fri, 26 Sep 2014 15:19:48 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java
index aee6b02..4e0b081 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java
@@ -20,32 +20,13 @@
 */
 package org.apache.airavata.gfac.gsissh.security;
 
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
 import org.apache.airavata.credential.store.store.CredentialReader;
 import org.apache.airavata.gfac.AbstractSecurityContext;
-import org.apache.airavata.gfac.Constants;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.RequestData;
+import org.apache.airavata.common.utils.RequestData;
 import org.apache.airavata.gsi.ssh.api.Cluster;
-import org.globus.gsi.X509Credential;
-import org.globus.gsi.gssapi.GlobusGSSCredentialImpl;
-import org.globus.gsi.provider.GlobusProvider;
-import org.globus.myproxy.GetParams;
-import org.globus.myproxy.MyProxy;
-import org.globus.myproxy.MyProxyException;
-import org.gridforum.jgss.ExtendedGSSCredential;
-import org.ietf.jgss.GSSCredential;
-import org.ietf.jgss.GSSException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.security.Security;
-import java.security.cert.X509Certificate;
-
 /**
  * Handles GRID related security.
  */

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/TokenizedMyProxyAuthInfo.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/TokenizedMyProxyAuthInfo.java b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/TokenizedMyProxyAuthInfo.java
deleted file mode 100644
index bb20a53..0000000
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/security/TokenizedMyProxyAuthInfo.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.gsissh.security;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
-import org.apache.airavata.credential.store.store.CredentialReader;
-import org.apache.airavata.gfac.Constants;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.RequestData;
-import org.apache.airavata.gfac.core.utils.GFacUtils;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-import org.globus.gsi.X509Credential;
-import org.globus.gsi.gssapi.GlobusGSSCredentialImpl;
-import org.globus.gsi.provider.GlobusProvider;
-import org.globus.myproxy.GetParams;
-import org.globus.myproxy.MyProxy;
-import org.globus.myproxy.MyProxyException;
-import org.gridforum.jgss.ExtendedGSSCredential;
-import org.ietf.jgss.GSSCredential;
-import org.ietf.jgss.GSSException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.security.Security;
-import java.security.cert.X509Certificate;
-
-public class TokenizedMyProxyAuthInfo extends GSIAuthenticationInfo {
-    protected static final Logger log = LoggerFactory.getLogger(TokenizedMyProxyAuthInfo.class);
-
-    public static int CREDENTIAL_RENEWING_THRESH_HOLD = 10 * 90;
-
-    private GSSCredential gssCredentials = null;
-
-
-    private CredentialReader credentialReader;
-
-    private RequestData requestData;
-
-    public static final String X509_CERT_DIR = "X509_CERT_DIR";
-
-
-    static {
-        Security.addProvider(new GlobusProvider());
-        try {
-            setUpTrustedCertificatePath();
-        } catch (ApplicationSettingsException e) {
-            log.error(e.getLocalizedMessage(), e);
-        }
-    }
-
-    public static void setUpTrustedCertificatePath(String trustedCertificatePath) {
-
-        File file = new File(trustedCertificatePath);
-
-        if (!file.exists() || !file.canRead()) {
-            File f = new File(".");
-            log.info("Current directory " + f.getAbsolutePath());
-            throw new RuntimeException("Cannot read trusted certificate path " + trustedCertificatePath);
-        } else {
-            System.setProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY, file.getAbsolutePath());
-        }
-    }
-
-    private static void setUpTrustedCertificatePath() throws ApplicationSettingsException {
-
-        String trustedCertificatePath = ServerSettings.getSetting(Constants.TRUSTED_CERT_LOCATION);
-
-        setUpTrustedCertificatePath(trustedCertificatePath);
-    }
-
-    public TokenizedMyProxyAuthInfo(CredentialReader credentialReader, RequestData requestData) {
-        this.credentialReader = credentialReader;
-        this.requestData = requestData;
-        try {
-            properties.setProperty(X509_CERT_DIR, ServerSettings.getSetting(Constants.TRUSTED_CERT_LOCATION));
-        } catch (ApplicationSettingsException e) {
-            e.printStackTrace();
-        };
-    }
-
-    public TokenizedMyProxyAuthInfo(RequestData requestData) {
-           this.requestData = requestData;
-           try {
-               properties.setProperty(X509_CERT_DIR, ServerSettings.getSetting(Constants.TRUSTED_CERT_LOCATION));
-           } catch (ApplicationSettingsException e) {
-               e.printStackTrace();
-           };
-       }
-
-    public GSSCredential getCredentials() throws SecurityException {
-
-        if (gssCredentials == null) {
-
-            try {
-                gssCredentials = getCredentialsFromStore();
-            } catch (Exception e) {
-                log.error("An exception occurred while retrieving credentials from the credential store. " +
-                        "Will continue with my proxy user name and password. Provided TokenId:" + requestData.getTokenId(), e);
-            }
-
-            if (gssCredentials == null) {
-                System.out.println("Authenticating with provided token failed, so falling back to authenticate with defaultCredentials");
-                try {
-                    gssCredentials = getDefaultCredentials();
-                } catch (Exception e) {
-                    throw new SecurityException("Error retrieving my proxy using username password");
-                }
-            }
-            // if still null, throw an exception
-            if (gssCredentials == null) {
-                throw new SecurityException("Unable to retrieve my proxy credentials to continue operation.");
-            }
-        } else {
-            try {
-                if (gssCredentials.getRemainingLifetime() < CREDENTIAL_RENEWING_THRESH_HOLD) {
-                    try {
-                        return renewCredentials();
-                    } catch (Exception e) {
-                        throw new SecurityException("Error renewing credentials", e);
-                    }
-                }
-            } catch (GSSException e) {
-                throw new SecurityException("Unable to retrieve remaining life time from credentials.", e);
-            }
-        }
-
-        return gssCredentials;
-    }
-
-
-    /**
-     * Reads the credentials from credential store.
-     *
-     * @return If token is found in the credential store, will return a valid credential. Else returns null.
-     * @throws Exception If an error occurred while retrieving credentials.
-     */
-    public GSSCredential getCredentialsFromStore() throws Exception {
-
-        if (getCredentialReader() == null) {
-            setCredentialReader(GFacUtils.getCredentialReader());
-        }
-
-        Credential credential = getCredentialReader().getCredential(getRequestData().getGatewayId(),
-                getRequestData().getTokenId());
-
-        if (credential != null) {
-            if (credential instanceof CertificateCredential) {
-
-                log.info("Successfully found credentials for token id - " + getRequestData().getTokenId() +
-                        " gateway id - " + getRequestData().getGatewayId());
-
-                CertificateCredential certificateCredential = (CertificateCredential) credential;
-
-                X509Certificate[] certificates = certificateCredential.getCertificates();
-                X509Credential newCredential = new X509Credential(certificateCredential.getPrivateKey(), certificates);
-
-                GlobusGSSCredentialImpl cred = new GlobusGSSCredentialImpl(newCredential, GSSCredential.INITIATE_AND_ACCEPT);
-                System.out.print(cred.export(ExtendedGSSCredential.IMPEXP_OPAQUE));
-                return cred;
-                //return new GlobusGSSCredentialImpl(newCredential,
-                //        GSSCredential.INITIATE_AND_ACCEPT);
-            } else {
-                log.info("Credential type is not CertificateCredential. Cannot create mapping globus credentials. " +
-                        "Credential type - " + credential.getClass().getName());
-            }
-        } else {
-            log.info("Could not find credentials for token - " + getRequestData().getTokenId() + " and "
-                    + "gateway id - " + getRequestData().getGatewayId());
-        }
-
-        return null;
-    }
-
-    /**
-     * Renew GSSCredentials.
-     * Before executing we need to add current host as a trusted renewer. Note to renew credentials
-     * we dont need user name and password.
-     * To do that execute following command
-     * > myproxy-logon -t <LIFETIME></LIFETIME> -s <MY PROXY SERVER> -l <USER NAME>
-     * E.g :- > myproxy-logon -t 264 -s myproxy.teragrid.org -l us3
-     * Enter MyProxy pass phrase:
-     * A credential has been received for user us3 in /tmp/x509up_u501.
-     * > myproxy-init -A --cert /tmp/x509up_u501 --key /tmp/x509up_u501 -l ogce -s myproxy.teragrid.org
-     *
-     * @return Renewed credentials.
-     * @throws org.apache.airavata.gfac.GFacException                            If an error occurred while renewing credentials.
-     * @throws org.apache.airavata.common.exception.ApplicationSettingsException
-     */
-    public GSSCredential renewCredentialsAsATrustedHost() throws GFacException, ApplicationSettingsException {
-        MyProxy myproxy = new MyProxy(getRequestData().getMyProxyServerUrl(), getRequestData().getMyProxyPort());
-        GetParams getParams = new GetParams();
-        getParams.setAuthzCreds(gssCredentials);
-        getParams.setUserName(getRequestData().getMyProxyUserName());
-        getParams.setLifetime(getRequestData().getMyProxyLifeTime());
-        try {
-            return myproxy.get(gssCredentials, getParams);
-        } catch (MyProxyException e) {
-            throw new GFacException("An error occurred while renewing security credentials.", e);
-        }
-    }
-
-
-    /**
-     * Gets the default proxy certificate.
-     *
-     * @return Default my proxy credentials.
-     * @throws org.apache.airavata.gfac.GFacException                            If an error occurred while retrieving credentials.
-     * @throws org.apache.airavata.common.exception.ApplicationSettingsException
-     */
-    public GSSCredential getDefaultCredentials() throws GFacException, ApplicationSettingsException {
-        MyProxy myproxy = new MyProxy(getRequestData().getMyProxyServerUrl(), getRequestData().getMyProxyPort());
-        try {
-            return myproxy.get(getRequestData().getMyProxyUserName(), getRequestData().getMyProxyPassword(),
-                    getRequestData().getMyProxyLifeTime());
-        } catch (MyProxyException e) {
-            throw new GFacException("An error occurred while retrieving default security credentials.", e);
-        }
-    }
-
-
-    /**
-     * Renews credentials. First try to renew credentials as a trusted renewer. If that failed
-     * use user name and password to renew credentials.
-     *
-     * @return Renewed credentials.
-     * @throws org.apache.airavata.gfac.GFacException                            If an error occurred while renewing credentials.
-     * @throws org.apache.airavata.common.exception.ApplicationSettingsException
-     */
-    public GSSCredential renewCredentials() throws GFacException, ApplicationSettingsException {
-
-        // First try to renew credentials as a trusted renewer
-        try {
-            gssCredentials = renewCredentialsAsATrustedHost();
-        } catch (Exception e) {
-            log.warn("Renewing credentials as a trusted renewer failed", e);
-            gssCredentials = getProxyCredentials();
-        }
-
-        return gssCredentials;
-    }
-
-    /**
-     * Gets a new proxy certificate given current credentials.
-     *
-     * @return The short lived GSSCredentials
-     * @throws org.apache.airavata.gfac.GFacException                            If an error is occurred while retrieving credentials.
-     * @throws org.apache.airavata.common.exception.ApplicationSettingsException
-     */
-    public GSSCredential getProxyCredentials() throws GFacException, ApplicationSettingsException {
-
-        MyProxy myproxy = new MyProxy(getRequestData().getMyProxyServerUrl(), getRequestData().getMyProxyPort());
-        try {
-            return myproxy.get(gssCredentials, getRequestData().getMyProxyUserName(), getRequestData().getMyProxyPassword(),
-                    getRequestData().getMyProxyLifeTime());
-        } catch (MyProxyException e) {
-            throw new GFacException("An error occurred while renewing security credentials using user/password.", e);
-        }
-    }
-
-    public void setGssCredentials(GSSCredential gssCredentials) {
-        this.gssCredentials = gssCredentials;
-    }
-
-    public CredentialReader getCredentialReader() {
-        return credentialReader;
-    }
-
-    public void setCredentialReader(CredentialReader credentialReader) {
-        this.credentialReader = credentialReader;
-    }
-
-    public RequestData getRequestData() {
-        return requestData;
-    }
-
-    public void setRequestData(RequestData requestData) {
-        this.requestData = requestData;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
index 9e45986..bd1be1f 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
@@ -33,11 +33,11 @@ import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.MappingFactory;
 import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.RequestData;
+import org.apache.airavata.common.utils.RequestData;
 import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.context.MessageContext;
 import org.apache.airavata.gfac.gsissh.security.GSISecurityContext;
-import org.apache.airavata.gfac.gsissh.security.TokenizedMyProxyAuthInfo;
+import org.apache.airavata.credential.store.util.TokenizedMyProxyAuthInfo;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
 import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java b/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
index 0774022..ad2b520 100644
--- a/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
+++ b/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
@@ -42,7 +42,7 @@ import org.apache.airavata.gfac.gsissh.security.GSISecurityContext;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
+import org.apache.airavata.credential.store.util.GSIAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.util.CommonUtils;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/security/GSISecurityContextTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/security/GSISecurityContextTestWithMyProxyAuth.java b/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/security/GSISecurityContextTestWithMyProxyAuth.java
index 44b7ae4..8168c5d 100644
--- a/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/security/GSISecurityContextTestWithMyProxyAuth.java
+++ b/modules/gfac/gfac-gsissh/src/test/java/org/apache/airavata/core/gfac/services/impl/security/GSISecurityContextTestWithMyProxyAuth.java
@@ -28,9 +28,8 @@ import org.apache.airavata.common.utils.DerbyUtil;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.credential.store.store.CredentialReader;
 import org.apache.airavata.credential.store.store.CredentialReaderFactory;
-import org.apache.airavata.gfac.RequestData;
-import org.apache.airavata.gfac.gsissh.security.GSISecurityContext;
-import org.apache.airavata.gfac.gsissh.security.TokenizedMyProxyAuthInfo;
+import org.apache.airavata.common.utils.RequestData;
+import org.apache.airavata.credential.store.util.TokenizedMyProxyAuthInfo;
 import org.apache.log4j.Logger;
 import org.ietf.jgss.GSSCredential;
 import org.testng.annotations.AfterClass;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
index 0ced88a..041d145 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
@@ -22,15 +22,13 @@ package org.apache.airavata.gfac.monitor;/*
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.monitor.MonitorID;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.model.workspace.experiment.JobState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.sql.Timestamp;
 import java.util.Date;
-import java.util.Map;
 
 public class HPCMonitorID extends MonitorID {
     private final static Logger logger = LoggerFactory.getLogger(HPCMonitorID.class);

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
index ff467bf..6428112 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
@@ -32,7 +32,7 @@ import org.apache.airavata.gfac.monitor.HPCMonitorID;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
 import org.apache.airavata.gfac.monitor.impl.pull.qstat.HPCPullMonitor;
 import org.apache.airavata.gfac.monitor.util.CommonUtils;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPushMonitorHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPushMonitorHandler.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPushMonitorHandler.java
index 1155965..d7543a3 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPushMonitorHandler.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPushMonitorHandler.java
@@ -34,7 +34,7 @@ import org.apache.airavata.gfac.core.handler.ThreadedHandler;
 import org.apache.airavata.gfac.core.monitor.MonitorID;
 import org.apache.airavata.gfac.monitor.HPCMonitorID;
 import org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
index dac9499..a04d3d0 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
@@ -37,7 +37,7 @@ import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
 import org.apache.airavata.gfac.monitor.impl.push.amqp.SimpleJobFinishConsumer;
 import org.apache.airavata.gfac.monitor.util.CommonUtils;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.model.workspace.experiment.JobState;
 import org.apache.airavata.model.workspace.experiment.TaskState;
 import org.apache.airavata.schemas.gfac.GsisshHostType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
index 73c05b7..16a2e02 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
@@ -26,7 +26,7 @@ import org.apache.airavata.gfac.gsissh.security.GSISecurityContext;
 import org.apache.airavata.gfac.monitor.HostMonitorData;
 import org.apache.airavata.gfac.ssh.security.SSHSecurityContext;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.JobStatus;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.model.workspace.experiment.JobState;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
index 1c52bae..8e5fe91 100644
--- a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
+++ b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
@@ -35,7 +35,7 @@ import org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
+import org.apache.airavata.credential.store.util.GSIAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
index 5488652..dfd851c 100644
--- a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
+++ b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
@@ -36,7 +36,7 @@ import org.apache.airavata.gfac.monitor.impl.pull.qstat.HPCPullMonitor;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
+import org.apache.airavata.credential.store.util.GSIAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPInputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPInputHandler.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPInputHandler.java
index 7e3ecbb..8118fdf 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPInputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPInputHandler.java
@@ -27,7 +27,6 @@ import org.apache.airavata.commons.gfac.type.MappingFactory;
 import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.context.MessageContext;
-import org.apache.airavata.gfac.core.handler.AbstractHandler;
 import org.apache.airavata.gfac.core.handler.AbstractRecoverableHandler;
 import org.apache.airavata.gfac.core.handler.GFacHandlerException;
 import org.apache.airavata.gfac.core.utils.GFacUtils;
@@ -36,7 +35,7 @@ import org.apache.airavata.gfac.ssh.util.GFACSSHUtils;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
index 193c2c5..74b2fdd 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
@@ -23,7 +23,6 @@ package org.apache.airavata.gfac.ssh.handler;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.MappingFactory;
-import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.handler.AbstractHandler;
 import org.apache.airavata.gfac.core.handler.GFacHandlerException;
@@ -32,7 +31,7 @@ import org.apache.airavata.gfac.ssh.util.GFACSSHUtils;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/security/TokenizedSSHAuthInfo.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/security/TokenizedSSHAuthInfo.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/security/TokenizedSSHAuthInfo.java
index 9e3fc58..cd2392d 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/security/TokenizedSSHAuthInfo.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/security/TokenizedSSHAuthInfo.java
@@ -25,9 +25,10 @@ import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.credential.store.credential.Credential;
 import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
 import org.apache.airavata.credential.store.store.CredentialReader;
+import org.apache.airavata.credential.store.util.Utility;
 import org.apache.airavata.gfac.Constants;
 import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.RequestData;
+import org.apache.airavata.common.utils.RequestData;
 import org.apache.airavata.gfac.core.utils.GFacUtils;
 import org.apache.airavata.gsi.ssh.api.authentication.SSHPublicKeyFileAuthentication;
 import org.slf4j.Logger;
@@ -114,7 +115,7 @@ public class TokenizedSSHAuthInfo implements SSHPublicKeyFileAuthentication {
     public SSHCredential getCredentialsFromStore() throws Exception {
 
         if (getCredentialReader() == null) {
-            credentialReader = GFacUtils.getCredentialReader();
+            credentialReader = Utility.getCredentialReader();
         }
 
         Credential credential = getCredentialReader().getCredential(getRequestData().getGatewayId(),

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
index 75bd724..8f3c616 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
@@ -27,23 +27,17 @@ import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.MappingFactory;
 import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
-import org.apache.airavata.gfac.Constants;
 import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.RequestData;
+import org.apache.airavata.common.utils.RequestData;
 import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.context.MessageContext;
-import org.apache.airavata.gfac.core.utils.GFacUtils;
 import org.apache.airavata.gfac.ssh.security.SSHSecurityContext;
 import org.apache.airavata.gfac.ssh.security.TokenizedSSHAuthInfo;
 import org.apache.airavata.gsi.ssh.api.Cluster;
-import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
 import org.apache.airavata.gsi.ssh.impl.GSISSHAbstractCluster;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
-import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
 import org.apache.airavata.gsi.ssh.util.CommonUtils;
 import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
 import org.apache.airavata.model.workspace.experiment.TaskDetails;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2TestWithSSHAuth.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2TestWithSSHAuth.java b/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2TestWithSSHAuth.java
index e84848c..e148d09 100644
--- a/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2TestWithSSHAuth.java
+++ b/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2TestWithSSHAuth.java
@@ -35,7 +35,7 @@ import org.apache.airavata.gfac.ssh.security.SSHSecurityContext;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.credential.store.util.AuthenticationInfo;
 import org.apache.airavata.gsi.ssh.api.job.JobManagerConfiguration;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/CredentialStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/CredentialStoreTest.java b/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/CredentialStoreTest.java
index d42ea52..9f62d0e 100644
--- a/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/CredentialStoreTest.java
+++ b/modules/gfac/gfac-ssh/src/test/java/org/apache/airavata/core/gfac/services/impl/CredentialStoreTest.java
@@ -33,7 +33,7 @@
 //import org.apache.airavata.credential.store.store.CredentialReader;
 //import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
 //import org.apache.airavata.gfac.GFacException;
-//import org.apache.airavata.gfac.RequestData;
+//import org.apache.airavata.common.utils.RequestData;
 //import org.apache.airavata.gfac.ssh.security.TokenizedSSHAuthInfo;
 //import org.apache.airavata.gsi.ssh.api.SSHApiException;
 //import org.apache.airavata.gsi.ssh.api.ServerInfo;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
index ed19d1f..4d1f1eb 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
@@ -97,8 +97,9 @@ import org.slf4j.LoggerFactory;
      * *
      * 
      * @param experimentId
+     * @param airavataCredStoreToken
      */
-    public boolean validateExperiment(String experimentId) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException;
+    public boolean validateExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException;
 
     /**
      *  *
@@ -123,7 +124,7 @@ import org.slf4j.LoggerFactory;
 
     public void launchTask(String taskId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void validateExperiment(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void terminateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
@@ -218,16 +219,17 @@ import org.slf4j.LoggerFactory;
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchTask failed: unknown result");
     }
 
-    public boolean validateExperiment(String experimentId) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException
+    public boolean validateExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException
     {
-      send_validateExperiment(experimentId);
+      send_validateExperiment(experimentId, airavataCredStoreToken);
       return recv_validateExperiment();
     }
 
-    public void send_validateExperiment(String experimentId) throws org.apache.thrift.TException
+    public void send_validateExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.thrift.TException
     {
       validateExperiment_args args = new validateExperiment_args();
       args.setExperimentId(experimentId);
+      args.setAiravataCredStoreToken(airavataCredStoreToken);
       sendBase("validateExperiment", args);
     }
 
@@ -381,24 +383,27 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void validateExperiment(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      validateExperiment_call method_call = new validateExperiment_call(experimentId, resultHandler, this, ___protocolFactory, ___transport);
+      validateExperiment_call method_call = new validateExperiment_call(experimentId, airavataCredStoreToken, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
     public static class validateExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
       private String experimentId;
-      public validateExperiment_call(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      private String airavataCredStoreToken;
+      public validateExperiment_call(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.experimentId = experimentId;
+        this.airavataCredStoreToken = airavataCredStoreToken;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
         prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("validateExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
         validateExperiment_args args = new validateExperiment_args();
         args.setExperimentId(experimentId);
+        args.setAiravataCredStoreToken(airavataCredStoreToken);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -544,7 +549,7 @@ import org.slf4j.LoggerFactory;
       public validateExperiment_result getResult(I iface, validateExperiment_args args) throws org.apache.thrift.TException {
         validateExperiment_result result = new validateExperiment_result();
         try {
-          result.success = iface.validateExperiment(args.experimentId);
+          result.success = iface.validateExperiment(args.experimentId, args.airavataCredStoreToken);
           result.setSuccessIsSet(true);
         } catch (org.apache.airavata.model.error.LaunchValidationException lve) {
           result.lve = lve;
@@ -804,7 +809,7 @@ import org.slf4j.LoggerFactory;
       }
 
       public void start(I iface, validateExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
-        iface.validateExperiment(args.experimentId,resultHandler);
+        iface.validateExperiment(args.experimentId, args.airavataCredStoreToken,resultHandler);
       }
     }
 
@@ -2964,6 +2969,7 @@ import org.slf4j.LoggerFactory;
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("validateExperiment_args");
 
     private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", org.apache.thrift.protocol.TType.STRING, (short)1);
+    private static final org.apache.thrift.protocol.TField AIRAVATA_CRED_STORE_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataCredStoreToken", org.apache.thrift.protocol.TType.STRING, (short)2);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -2972,10 +2978,12 @@ import org.slf4j.LoggerFactory;
     }
 
     public String experimentId; // required
+    public String airavataCredStoreToken; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-      EXPERIMENT_ID((short)1, "experimentId");
+      EXPERIMENT_ID((short)1, "experimentId"),
+      AIRAVATA_CRED_STORE_TOKEN((short)2, "airavataCredStoreToken");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -2992,6 +3000,8 @@ import org.slf4j.LoggerFactory;
         switch(fieldId) {
           case 1: // EXPERIMENT_ID
             return EXPERIMENT_ID;
+          case 2: // AIRAVATA_CRED_STORE_TOKEN
+            return AIRAVATA_CRED_STORE_TOKEN;
           default:
             return null;
         }
@@ -3037,6 +3047,8 @@ import org.slf4j.LoggerFactory;
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.AIRAVATA_CRED_STORE_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("airavataCredStoreToken", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(validateExperiment_args.class, metaDataMap);
     }
@@ -3045,10 +3057,12 @@ import org.slf4j.LoggerFactory;
     }
 
     public validateExperiment_args(
-      String experimentId)
+      String experimentId,
+      String airavataCredStoreToken)
     {
       this();
       this.experimentId = experimentId;
+      this.airavataCredStoreToken = airavataCredStoreToken;
     }
 
     /**
@@ -3058,6 +3072,9 @@ import org.slf4j.LoggerFactory;
       if (other.isSetExperimentId()) {
         this.experimentId = other.experimentId;
       }
+      if (other.isSetAiravataCredStoreToken()) {
+        this.airavataCredStoreToken = other.airavataCredStoreToken;
+      }
     }
 
     public validateExperiment_args deepCopy() {
@@ -3067,6 +3084,7 @@ import org.slf4j.LoggerFactory;
     @Override
     public void clear() {
       this.experimentId = null;
+      this.airavataCredStoreToken = null;
     }
 
     public String getExperimentId() {
@@ -3093,6 +3111,30 @@ import org.slf4j.LoggerFactory;
       }
     }
 
+    public String getAiravataCredStoreToken() {
+      return this.airavataCredStoreToken;
+    }
+
+    public validateExperiment_args setAiravataCredStoreToken(String airavataCredStoreToken) {
+      this.airavataCredStoreToken = airavataCredStoreToken;
+      return this;
+    }
+
+    public void unsetAiravataCredStoreToken() {
+      this.airavataCredStoreToken = null;
+    }
+
+    /** Returns true if field airavataCredStoreToken is set (has been assigned a value) and false otherwise */
+    public boolean isSetAiravataCredStoreToken() {
+      return this.airavataCredStoreToken != null;
+    }
+
+    public void setAiravataCredStoreTokenIsSet(boolean value) {
+      if (!value) {
+        this.airavataCredStoreToken = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case EXPERIMENT_ID:
@@ -3103,6 +3145,14 @@ import org.slf4j.LoggerFactory;
         }
         break;
 
+      case AIRAVATA_CRED_STORE_TOKEN:
+        if (value == null) {
+          unsetAiravataCredStoreToken();
+        } else {
+          setAiravataCredStoreToken((String)value);
+        }
+        break;
+
       }
     }
 
@@ -3111,6 +3161,9 @@ import org.slf4j.LoggerFactory;
       case EXPERIMENT_ID:
         return getExperimentId();
 
+      case AIRAVATA_CRED_STORE_TOKEN:
+        return getAiravataCredStoreToken();
+
       }
       throw new IllegalStateException();
     }
@@ -3124,6 +3177,8 @@ import org.slf4j.LoggerFactory;
       switch (field) {
       case EXPERIMENT_ID:
         return isSetExperimentId();
+      case AIRAVATA_CRED_STORE_TOKEN:
+        return isSetAiravataCredStoreToken();
       }
       throw new IllegalStateException();
     }
@@ -3150,6 +3205,15 @@ import org.slf4j.LoggerFactory;
           return false;
       }
 
+      boolean this_present_airavataCredStoreToken = true && this.isSetAiravataCredStoreToken();
+      boolean that_present_airavataCredStoreToken = true && that.isSetAiravataCredStoreToken();
+      if (this_present_airavataCredStoreToken || that_present_airavataCredStoreToken) {
+        if (!(this_present_airavataCredStoreToken && that_present_airavataCredStoreToken))
+          return false;
+        if (!this.airavataCredStoreToken.equals(that.airavataCredStoreToken))
+          return false;
+      }
+
       return true;
     }
 
@@ -3176,6 +3240,16 @@ import org.slf4j.LoggerFactory;
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetAiravataCredStoreToken()).compareTo(other.isSetAiravataCredStoreToken());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAiravataCredStoreToken()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataCredStoreToken, other.airavataCredStoreToken);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -3203,6 +3277,14 @@ import org.slf4j.LoggerFactory;
         sb.append(this.experimentId);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("airavataCredStoreToken:");
+      if (this.airavataCredStoreToken == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.airavataCredStoreToken);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -3212,6 +3294,9 @@ import org.slf4j.LoggerFactory;
       if (experimentId == null) {
         throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' was not present! Struct: " + toString());
       }
+      if (airavataCredStoreToken == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataCredStoreToken' was not present! Struct: " + toString());
+      }
       // check for sub-struct validity
     }
 
@@ -3257,6 +3342,14 @@ import org.slf4j.LoggerFactory;
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 2: // AIRAVATA_CRED_STORE_TOKEN
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.airavataCredStoreToken = iprot.readString();
+                struct.setAiravataCredStoreTokenIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -3277,6 +3370,11 @@ import org.slf4j.LoggerFactory;
           oprot.writeString(struct.experimentId);
           oprot.writeFieldEnd();
         }
+        if (struct.airavataCredStoreToken != null) {
+          oprot.writeFieldBegin(AIRAVATA_CRED_STORE_TOKEN_FIELD_DESC);
+          oprot.writeString(struct.airavataCredStoreToken);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -3295,6 +3393,7 @@ import org.slf4j.LoggerFactory;
       public void write(org.apache.thrift.protocol.TProtocol prot, validateExperiment_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         oprot.writeString(struct.experimentId);
+        oprot.writeString(struct.airavataCredStoreToken);
       }
 
       @Override
@@ -3302,6 +3401,8 @@ import org.slf4j.LoggerFactory;
         TTupleProtocol iprot = (TTupleProtocol) prot;
         struct.experimentId = iprot.readString();
         struct.setExperimentIdIsSet(true);
+        struct.airavataCredStoreToken = iprot.readString();
+        struct.setAiravataCredStoreTokenIsSet(true);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
index 9f62eeb..3fa2946 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
@@ -50,6 +50,6 @@ import org.slf4j.LoggerFactory;
 
 @SuppressWarnings("all") public class orchestrator_cpi_serviceConstants {
 
-  public static final String ORCHESTRATOR_CPI_VERSION = "0.12.0";
+  public static final String ORCHESTRATOR_CPI_VERSION = "0.13.0";
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index c1a00a8..55ed3be 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -231,7 +231,7 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface,
 	 * @return
 	 * @throws TException
 	 */
-	public boolean validateExperiment(String experimentId) throws TException,
+	public boolean validateExperiment(String experimentId, String airavataCredStoreToken) throws TException,
 			LaunchValidationException {
 		// TODO: Write the Orchestrator implementaion
 		try {
@@ -261,7 +261,7 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface,
 						return false;
 					}
 					return orchestrator.validateExperiment(experiment,
-							workflowNodeDetail, taskID).isSetValidationState();
+                            workflowNodeDetail, taskID, airavataCredStoreToken).isSetValidationState();
 				}
 			}
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/JobMetadataValidator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/JobMetadataValidator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/JobMetadataValidator.java
index 0a8b46a..47563a6 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/JobMetadataValidator.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/JobMetadataValidator.java
@@ -43,5 +43,6 @@ public interface JobMetadataValidator {
      * @param taskID
      * @return
      */
-    ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID);
+    ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID,
+                             String airavataCredStoreToken);
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/ExperimentStatusValidator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/ExperimentStatusValidator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/ExperimentStatusValidator.java
index 276a26f..4070e68 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/ExperimentStatusValidator.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/ExperimentStatusValidator.java
@@ -29,7 +29,8 @@ import org.slf4j.LoggerFactory;
 public class ExperimentStatusValidator implements JobMetadataValidator {
     private static Logger log = LoggerFactory.getLogger(ExperimentStatusValidator.class);
 
-    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
+    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID,
+                                    String credStoreToken) {
         String error = "During the validation step experiment status should be CREATED, But this experiment status is : ";
         ValidatorResult validatorResult = new ValidatorResult();
         if (!experiment.getExperimentStatus().getExperimentState().equals(ExperimentState.CREATED)) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/JobCountValidator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/JobCountValidator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/JobCountValidator.java
new file mode 100644
index 0000000..37890ec
--- /dev/null
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/JobCountValidator.java
@@ -0,0 +1,158 @@
+package org.apache.airavata.orchestrator.core.validator.impl;
+
+import org.airavata.appcatalog.cpi.AppCatalog;
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.airavata.appcatalog.cpi.ComputeResource;
+import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
+import org.apache.aiaravata.application.catalog.data.resources.AbstractResource;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.RequestData;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.credential.store.credential.AuditInfo;
+import org.apache.airavata.credential.store.store.CredentialReader;
+import org.apache.airavata.credential.store.store.CredentialReaderFactory;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.airavata.credential.store.util.TokenizedMyProxyAuthInfo;
+import org.apache.airavata.gfac.core.scheduler.HostScheduler;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
+import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
+import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
+import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface;
+import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
+import org.apache.airavata.model.error.ValidatorResult;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.model.workspace.experiment.TaskDetails;
+import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
+import org.apache.airavata.orchestrator.core.context.OrchestratorContext;
+import org.apache.airavata.orchestrator.core.validator.JobMetadataValidator;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Job count validator validate max job submission count for a given resource under given community user name.
+ */
+public class JobCountValidator implements JobMetadataValidator {
+    private static final Logger logger = LoggerFactory.getLogger(JobCountValidator.class);
+
+    @Override
+    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID,
+                                    String credStoreToken) {
+        ValidatorResult result;
+        try {
+            AppCatalog appCatalog = AppCatalogFactory.getAppCatalog();
+            ApplicationInterfaceDescription applicationInterface = appCatalog.getApplicationInterface().
+                    getApplicationInterface(taskID.getApplicationId());
+
+            List<String> applicationModules = applicationInterface.getApplicationModules();
+            String selectedModuleId = applicationModules.get(0);
+            Map<String, String> moduleIdFilter = new HashMap<String, String>();
+            moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, selectedModuleId);
+            if (taskID.getTaskScheduling()!=null && taskID.getTaskScheduling().getResourceHostId() != null) {
+                moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID,
+                        taskID.getTaskScheduling().getResourceHostId());
+            }
+            List<ApplicationDeploymentDescription> applicationDeployements = appCatalog.getApplicationDeployment()
+                    .getApplicationDeployements(moduleIdFilter);
+            Map<ComputeResourceDescription, ApplicationDeploymentDescription> deploymentMap =
+                    new HashMap<ComputeResourceDescription, ApplicationDeploymentDescription>();
+            ComputeResource computeResource = appCatalog.getComputeResource();
+            for (ApplicationDeploymentDescription deploymentDescription : applicationDeployements) {
+                deploymentMap.put(computeResource.getComputeResource(deploymentDescription.getComputeHostId()),
+                        deploymentDescription);
+            }
+            List<ComputeResourceDescription> computeHostList = new ArrayList<ComputeResourceDescription>();
+            computeHostList.addAll(deploymentMap.keySet());
+
+            Class<? extends HostScheduler> aClass = Class.forName(
+                    ServerSettings.getHostScheduler()).asSubclass(
+                    HostScheduler.class);
+            HostScheduler hostScheduler = aClass.newInstance();
+            ComputeResourceDescription ComputeResourceDescription = hostScheduler.schedule(computeHostList);
+            ApplicationDeploymentDescription applicationDeploymentDescription = deploymentMap.get(ComputeResourceDescription);
+
+            ComputeResourceDescription computeResourceDescription = appCatalog.getComputeResource().
+                    getComputeResource(applicationDeploymentDescription.getComputeHostId());
+            for (JobSubmissionInterface jobSubmissionInterface : computeResourceDescription.getJobSubmissionInterfaces()) {
+                switch (jobSubmissionInterface.getJobSubmissionProtocol()) {
+                    case LOCAL:
+                        // nothing to do
+                        return new ValidatorResult(true);
+                    case SSH:
+                        SSHJobSubmission sshJobSubmission =
+                                appCatalog.getComputeResource().getSSHJobSubmission(jobSubmissionInterface.getJobSubmissionInterfaceId());
+                        switch (sshJobSubmission.getSecurityProtocol()) {
+                            case GSI:
+                                // gsi
+                                RequestData requestData = new RequestData(ServerSettings.getDefaultUserGateway());
+                                requestData.setTokenId(credStoreToken);
+                                if (isJobSpaceAvailable(requestData.getMyProxyUserName(), computeHostList)) {
+                                    return new ValidatorResult(true);
+                                } else {
+                                    result = new ValidatorResult(false);
+                                    result.setErrorDetails("Please honour to the gobal max job count " + ServerSettings.getGlobalMaxJobCount());
+                                    return result;
+                                }
+//                                TokenizedMyProxyAuthInfo tokenizedMyProxyAuthInfo = new TokenizedMyProxyAuthInfo(requestData);
+                            case SSH_KEYS:
+                                result = new ValidatorResult(false);
+                                result.setErrorDetails("SSH_KEY base job count validation is not yet implemented");
+                                return result;
+                                // ssh
+                            default:
+                                result = new ValidatorResult(false);
+                                result.setErrorDetails("Doesn't support " + sshJobSubmission.getSecurityProtocol() + " protocol yet");
+                                return result;
+                        }
+                    default:
+                        result = new ValidatorResult(false);
+                        result.setErrorDetails("Doesn't support " + jobSubmissionInterface.getJobSubmissionProtocol() + " protocol yet");
+                        return result;
+                }
+            }
+            result = new ValidatorResult(false);
+            result.setErrorDetails("No JobSubmission interface found");
+            return result;
+        } catch (Exception e) {
+            result = new ValidatorResult(false);
+            result.setErrorDetails("Exception occur while running validation process ");
+            return result;
+        }
+
+    }
+
+    private boolean isJobSpaceAvailable(String communityUserName, List<ComputeResourceDescription> computeHostList) throws ApplicationSettingsException {
+        String keyPath = new StringBuilder("/" + Constants.STAT).append("/").append(communityUserName).append("/").toString();
+        for (ComputeResourceDescription computeResDesc : computeHostList) {
+            String key = keyPath + computeResDesc.getHostName() + "/" + Constants.JOB;
+            Map<String, Integer> jobCountMap = AiravataUtils.getJobCountMap(OrchestratorContext.getZk());
+            if (jobCountMap.containsKey(key)) {
+                int count = jobCountMap.get(key);
+                if (count < Integer.parseInt(ServerSettings.getGlobalMaxJobCount())) {
+                    return true;
+                }
+            }else {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private void getAppDeployment(String applicationId, TaskDetail taskData) throws AppCatalogException {
+        return;
+
+    }
+
+    private ApplicationDeploymentDescription getAppDeployment(AppCatalog appCatalog, TaskDetail taskData, String selectedModuleId) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/SimpleAppDataValidator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/SimpleAppDataValidator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/SimpleAppDataValidator.java
index 8847500..01e4bf1 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/SimpleAppDataValidator.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/SimpleAppDataValidator.java
@@ -45,7 +45,8 @@ public class SimpleAppDataValidator implements JobMetadataValidator {
         }
     }
 
-    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
+    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID,
+                                    String credStoreToken) {
         boolean result = false;
         if (experiment.getUserConfigurationData().isAiravataAutoSchedule()) {
             logger.error("We dont' support auto scheduling at this point, We will simply use user data as it is");

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
index 89393a8..916fa50 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
@@ -42,11 +42,12 @@ public interface Orchestrator {
      * @param experiment
      * @param workflowNodeDetail
      * @param taskID
+     * @param credStoreToken - airavata credential store token
      * @return boolean if the experiments are valids after executing all the validators return true otherwise it iwll return false
      * @throws OrchestratorException
      */
      ValidationResults validateExperiment(Experiment experiment, WorkflowNodeDetails workflowNodeDetail,
-                            TaskDetails taskID) throws OrchestratorException,LaunchValidationException;
+                            TaskDetails taskID, String credStoreToken) throws OrchestratorException,LaunchValidationException;
     /**
      * After creating the experiment Data user have the
      * experimentID as the handler to the experiment, during the launchExperiment

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index 0a2b5a3..a950469 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -44,27 +44,53 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
     
     // this is going to be null unless the thread count is 0
     private JobSubmitter jobSubmitter = null;
-
+    private List<JobMetadataValidator> validatorList = new ArrayList<JobMetadataValidator>();
 
     public SimpleOrchestratorImpl() throws OrchestratorException {
-        try {
-            try {
-                String submitterClass = this.orchestratorContext.getOrchestratorConfiguration().getNewJobSubmitterClass();
-                Class<? extends JobSubmitter> aClass = Class.forName(submitterClass.trim()).asSubclass(JobSubmitter.class);
-                jobSubmitter = aClass.newInstance();
-                jobSubmitter.initialize(this.orchestratorContext);
+        init();
+    }
 
-            } catch (Exception e) {
-                String error = "Error creating JobSubmitter in non threaded mode ";
-                logger.error(error);
-                throw new OrchestratorException(error, e);
-            }
+    public void init() throws OrchestratorException {
+        try {
+            loadSubmitter();
+            loadValidators();
         } catch (OrchestratorException e) {
             logger.error("Error Constructing the Orchestrator");
             throw e;
         }
     }
 
+    private void loadValidators() throws OrchestratorException {
+        List<String> validatorClzzez = this.orchestratorContext.getOrchestratorConfiguration().getValidatorClasses();
+        Class<? extends JobMetadataValidator> vClass;
+        boolean allValidatorsFailed = true;
+        for (String validator : validatorClzzez) {
+            try {
+                vClass = Class.forName(validator.trim()).asSubclass(JobMetadataValidator.class);
+                validatorList.add(vClass.newInstance());
+                allValidatorsFailed = false;
+            } catch (Exception e) {
+                logger.warn("Error loading the validation class: " + validator, e);
+            }
+        }
+        if (allValidatorsFailed && validatorClzzez.size() > 0) {
+            throw new OrchestratorException("Error loading all JobMetadataValidator implementation classes");
+        }
+    }
+
+    private void loadSubmitter() throws OrchestratorException {
+        try {
+            String submitterClass = this.orchestratorContext.getOrchestratorConfiguration().getNewJobSubmitterClass();
+            Class<? extends JobSubmitter> aClass = Class.forName(submitterClass.trim()).asSubclass(JobSubmitter.class);
+            jobSubmitter = aClass.newInstance();
+            jobSubmitter.initialize(this.orchestratorContext);
+
+        } catch (Exception e) {
+            String error = "Error creating JobSubmitter in non threaded mode ";
+            throw new OrchestratorException(error, e);
+        }
+    }
+
     public boolean launchExperiment(Experiment experiment, WorkflowNodeDetails workflowNode, TaskDetails task,String tokenId) throws OrchestratorException {
         // we give higher priority to userExperimentID
         String experimentId = experiment.getExperimentID();
@@ -107,44 +133,22 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
         return tasks;
     }
 
-    public ValidationResults validateExperiment(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) throws OrchestratorException,LaunchValidationException {
+    public ValidationResults validateExperiment(Experiment experiment, WorkflowNodeDetails workflowNodeDetail,
+                                                TaskDetails taskID , String airavataCredStoreToken) throws OrchestratorException,LaunchValidationException {
         org.apache.airavata.model.error.ValidationResults validationResults = new org.apache.airavata.model.error.ValidationResults();
         validationResults.setValidationState(true); // initially making it to success, if atleast one failed them simply mark it failed.
         if (this.orchestratorConfiguration.isEnableValidation()) {
-            List<String> validatorClzzez = this.orchestratorContext.getOrchestratorConfiguration().getValidatorClasses();
             ValidatorResult vResult = null;
-            for (String validator : validatorClzzez) {
-                try {
-                    Class<? extends JobMetadataValidator> vClass = Class.forName(validator.trim()).asSubclass(JobMetadataValidator.class);
-                    JobMetadataValidator jobMetadataValidator = vClass.newInstance();
-                    vResult = jobMetadataValidator.validate(experiment, workflowNodeDetail, taskID);
+            for (JobMetadataValidator jobMetadataValidator : validatorList) {
+                    vResult = jobMetadataValidator.validate(experiment, workflowNodeDetail, taskID, airavataCredStoreToken);
                     if (vResult.isResult()) {
-                        logger.info("Validation of " + validator + " is SUCCESSFUL");
+                        logger.info("Validation of " + jobMetadataValidator.getClass().getName() + " is SUCCESSFUL");
                     } else {
-                        logger.error("Validation of " + validator + " is FAILED:[error]" + vResult.getErrorDetails());
+                        logger.error("Validation of " + jobMetadataValidator.getClass().getName() + " is FAILED:[error]" + vResult.getErrorDetails());
                         //todo we need to store this message to registry
                         validationResults.setValidationState(false);
                         // we do not return immediately after the first failure
                     }
-                } catch (ClassNotFoundException e) {
-                    logger.error("Error loading the validation class: ", validator, e);
-                    vResult = new ValidatorResult();
-                    vResult.setResult(false);
-                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
-                    validationResults.setValidationState(false);
-                } catch (InstantiationException e) {
-                    logger.error("Error loading the validation class: ", validator, e);
-                    vResult = new ValidatorResult();
-                    vResult.setResult(false);
-                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
-                    validationResults.setValidationState(false);
-                } catch (IllegalAccessException e) {
-                    logger.error("Error loading the validation class: ", validator, e);
-                    vResult = new ValidatorResult();
-                    vResult.setResult(false);
-                    vResult.setErrorDetails("Error loading the validation class: " + e.getMessage());
-                    validationResults.setValidationState(false);
-                }
                 validationResults.addToValidationResultList(vResult);
             }
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/SecondValidator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/SecondValidator.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/SecondValidator.java
index f55e15d..e85a13a 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/SecondValidator.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/SecondValidator.java
@@ -28,7 +28,8 @@ import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
 import org.apache.airavata.orchestrator.core.validator.JobMetadataValidator;
 
 public class SecondValidator implements JobMetadataValidator {
-    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
+    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID,
+                                    String airavataCredStoreToken) {
         if(taskID.getTaskID() == null) {
             ValidatorResult validatorResult = new ValidatorResult(false);
             validatorResult.setErrorDetails("No taskID is set, so Validation failed");

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/TestValidator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/TestValidator.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/TestValidator.java
index 5845760..cb7e685 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/TestValidator.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/TestValidator.java
@@ -32,7 +32,8 @@ import org.slf4j.LoggerFactory;
 public class TestValidator implements JobMetadataValidator {
     private final static Logger logger = LoggerFactory.getLogger(TestValidator.class);
 
-    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID) {
+    public ValidatorResult validate(Experiment experiment, WorkflowNodeDetails workflowNodeDetail, TaskDetails taskID,
+                                    String airavataCredStoreToken) {
         if (experiment.getProjectID() == null) {
             logger.error("Project ID is not set");
             ValidatorResult validatorResult = new ValidatorResult(false);

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/orchestrator/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift b/modules/orchestrator/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift
index 781410c..7a9357b 100644
--- a/modules/orchestrator/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift
+++ b/modules/orchestrator/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift
@@ -64,7 +64,7 @@ service OrchestratorService {
      * @return sucess/failure
      *
     **/
-  bool validateExperiment(1: required string experimentId)
+  bool validateExperiment(1: required string experimentId, 2: required string airavataCredStoreToken)
   throws (1: airavataErrors.LaunchValidationException lve)
     /**
      *

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
index 204427b..db4229b 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
@@ -42,7 +42,7 @@
 //import org.apache.airavata.credential.store.store.CredentialReaderFactory;
 //import org.apache.airavata.gfac.Constants;
 //import org.apache.airavata.gfac.GFacConfiguration;
-//import org.apache.airavata.gfac.RequestData;
+//import org.apache.airavata.common.utils.RequestData;
 //import org.apache.airavata.gfac.context.ApplicationContext;
 //import org.apache.airavata.gfac.context.JobExecutionContext;
 //import org.apache.airavata.gfac.context.MessageContext;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/tools/gsissh/pom.xml
----------------------------------------------------------------------
diff --git a/tools/gsissh/pom.xml b/tools/gsissh/pom.xml
index bef33c8..0bc823d 100644
--- a/tools/gsissh/pom.xml
+++ b/tools/gsissh/pom.xml
@@ -93,8 +93,13 @@
 			<version>1.6.12</version>
 			<scope>runtime</scope>
 		</dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-credential-store</artifactId>
+            <version>0.14-SNAPSHOT</version>
+        </dependency>
 
-	</dependencies>
+    </dependencies>
 
 	<build>
 		<plugins>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9a138b54/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java b/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java
index f3ead64..284733d 100644
--- a/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java
+++ b/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java
@@ -21,7 +21,8 @@
 
 package com.jcraft.jsch;
 
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
+
+import org.apache.airavata.credential.store.util.GSIAuthenticationInfo;
 
 public class ExtendedSession extends Session {
 


Mime
View raw message