You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2015/03/19 16:02:27 UTC

[01/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Repository: airavata
Updated Branches:
  refs/heads/queue-gfac-rabbitmq 93ed077e8 -> 48be39fea


http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java
new file mode 100644
index 0000000..c4a2c47
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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.credentialstore.session;
+
+import org.apache.airavata.common.context.RequestContext;
+import org.apache.airavata.common.context.WorkflowContext;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.security.AuthenticationException;
+import org.apache.commons.codec.binary.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Helper class to extract request information.
+ */
+public class ServletRequestHelper {
+
+    /**
+     * Header names
+     */
+    public static final String AUTHORISATION_HEADER_NAME = "Authorization";
+    private final static Logger logger = LoggerFactory.getLogger(ServletRequestHelper.class);
+    protected void addIdentityInformationToSession(HttpServletRequest servletRequest) throws AuthenticationException {
+
+        addUserToSession(null, servletRequest);
+    }
+
+    public void addUserToSession(String userName, HttpServletRequest servletRequest) throws AuthenticationException {
+
+        if (userName == null) {
+            userName = getUserName(servletRequest);
+        }
+
+        String gatewayId = getGatewayId(servletRequest);
+
+        if (servletRequest.getSession() != null) {
+			try {
+				servletRequest.getSession().setAttribute(Constants.USER_IN_SESSION, userName);
+				servletRequest.getSession().setAttribute(ServerSettings.getDefaultUserGateway(), gatewayId);
+			} catch (ApplicationSettingsException e) {
+                logger.error(e.getMessage(), e);
+			}
+        }
+
+        addToContext(userName, gatewayId);
+    }
+
+    String getUserName(HttpServletRequest httpServletRequest) throws AuthenticationException {
+
+        String basicHeader = httpServletRequest.getHeader(AUTHORISATION_HEADER_NAME);
+
+        if (basicHeader == null) {
+            throw new AuthenticationException("Authorization Required");
+        }
+
+        String[] userNamePasswordArray = basicHeader.split(" ");
+
+        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
+            throw new AuthenticationException("Authorization Required");
+        }
+
+        String decodedString = decode(userNamePasswordArray[1]);
+
+        String[] array = decodedString.split(":");
+
+        if (array == null || array.length != 1) {
+            throw new AuthenticationException("Authorization Required");
+        }
+
+        return array[0];
+
+    }
+
+    public String decode(String encoded) {
+        return new String(Base64.decodeBase64(encoded.getBytes()));
+    }
+
+    String getGatewayId(HttpServletRequest request) throws AuthenticationException {
+        String gatewayId = null;
+		try {
+			gatewayId = request.getHeader(ServerSettings.getDefaultUserGateway());
+		} catch (ApplicationSettingsException e1) {
+            logger.error(e1.getMessage(), e1);
+		}
+
+        if (gatewayId == null) {
+            try {
+                gatewayId = ServerSettings.getDefaultUserGateway();
+            } catch (ApplicationSettingsException e) {
+                throw new AuthenticationException("Unable to retrieve default gateway", e);
+            }
+        }
+
+        return gatewayId;
+    }
+
+    public void addToContext(String userName, String gatewayId) {
+
+        RequestContext requestContext = new RequestContext();
+        requestContext.setUserIdentity(userName);
+        requestContext.setGatewayId(gatewayId);
+
+        WorkflowContext.set(requestContext);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties b/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
new file mode 100644
index 0000000..fb02901
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
@@ -0,0 +1,234 @@
+#
+#
+# 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.
+#
+
+###########################################################################
+#
+#  This properties file provides configuration for all Airavata Services:
+#  API Server, Registry, Workflow Interpreter, GFac, Orchestrator
+#
+###########################################################################
+
+###########################################################################
+#  API Server Registry Configuration
+###########################################################################
+
+#for derby [AiravataJPARegistry]
+registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+# MySql database configuration
+#registry.jdbc.driver=com.mysql.jdbc.Driver
+#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+registry.jdbc.user=airavata
+registry.jdbc.password=airavata
+start.derby.server.mode=true
+validationQuery=SELECT 1 from CONFIGURATION
+jpa.cache.size=5000
+#jpa.connection.properties=MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000,testWhileIdle=true,testOnBorrow=true
+
+# Properties for default user mode
+default.registry.user=admin
+default.registry.password=admin
+default.registry.password.hash.method=SHA
+default.registry.gateway=default
+
+#ip=127.0.0.1
+
+###########################################################################
+#  Application Catalog DB Configuration
+###########################################################################
+#for derby [AiravataJPARegistry]
+appcatalog.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+appcatalog.jdbc.url=jdbc:derby://localhost:1527/app_catalog;create=true;user=airavata;password=airavata
+# MySql database configuration
+#appcatalog.jdbc.driver=com.mysql.jdbc.Driver
+#appcatalog.jdbc.url=jdbc:mysql://localhost:3306/app_catalog
+appcatalog.jdbc.user=airavata
+appcatalog.jdbc.password=airavata
+appcatalog.validationQuery=SELECT 1 from CONFIGURATION
+
+###########################################################################
+#  Server module Configuration
+###########################################################################
+
+servers=apiserver,orchestrator,gfac,workflowserver
+#shutdown.trategy=NONE
+shutdown.trategy=SELF_TERMINATE
+
+
+apiserver.server.host=localhost
+apiserver.server.port=8930
+apiserver.server.min.threads=50
+workflow.server.host=localhost
+workflow.server.port=8931
+orchestrator.server.host=localhost
+orchestrator.server.port=8940
+gfac.server.host=localhost
+gfac.server.port=8950
+orchestrator.server.min.threads=50
+
+###########################################################################
+# Credential Store module Configuration
+###########################################################################
+credential.store.keystore.url=/Users/lahirugunathilake/Downloads/airavata_sym.jks
+credential.store.keystore.alias=airavata
+credential.store.keystore.password=airavata
+credential.store.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+credential.store.jdbc.user=airavata
+credential.store.jdbc.password=airavata
+credential.store.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+
+notifier.enabled=false
+#period in milliseconds
+notifier.duration=5000
+
+email.server=smtp.googlemail.com
+email.server.port=465
+email.user=airavata
+email.password=xxx
+email.ssl=true
+email.from=airavata@apache.org
+
+###########################################################################
+# Airavata GFac MyProxy GSI credentials to access Grid Resources.
+###########################################################################
+#
+# Security Configuration used by Airavata Generic Factory Service
+#  to interact with Computational Resources.
+#
+gfac=org.apache.airavata.gfac.server.GfacServer
+myproxy.server=myproxy.teragrid.org
+myproxy.username=ogce
+myproxy.password=
+myproxy.life=3600
+# XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz
+trusted.cert.location=/Users/lahirugunathilake/Downloads/certificates
+# SSH PKI key pair or ssh password can be used SSH based authentication is used.
+# if user specify both password authentication gets the higher preference
+
+################# ---------- For ssh key pair authentication ------------------- ################
+#public.ssh.key=/path to public key for ssh
+#ssh.username=username for ssh connection
+#private.ssh.key=/path to private key file for ssh
+#ssh.keypass=passphrase for the private key
+
+
+################# ---------- For ssh key pair authentication ------------------- ################
+#ssh.username=username for ssh connection
+#ssh.password=Password for ssh connection
+
+
+
+###########################################################################
+# Airavata Workflow Interpreter Configurations
+###########################################################################
+
+#runInThread=true
+#provenance=true
+#provenanceWriterThreadPoolSize=20
+#gfac.embedded=true
+#workflowserver=org.apache.airavata.api.server.WorkflowServer
+
+
+###########################################################################
+# API Server module Configuration
+###########################################################################
+apiserver=org.apache.airavata.api.server.AiravataAPIServer
+
+###########################################################################
+# Workflow Server module Configuration
+###########################################################################
+
+workflowserver=org.apache.airavata.api.server.WorkflowServer
+
+###########################################################################
+# Advance configuration to change service implementations
+###########################################################################
+# If false, disables two phase commit when submitting jobs
+TwoPhase=true
+#
+# Class which implemented HostScheduler interface. It will determine the which host to submit the request
+#
+host.scheduler=org.apache.airavata.gfac.core.scheduler.impl.SimpleHostScheduler
+
+###########################################################################
+# Monitoring module Configuration
+###########################################################################
+
+#This will be the primary monitoring tool which runs in airavata, in future there will be multiple monitoring
+#mechanisms and one would be able to start a monitor
+monitors=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor,org.apache.airavata.gfac.monitor.impl.LocalJobMonitor
+
+
+###########################################################################
+# AMQP Notification Configuration
+###########################################################################
+
+
+amqp.notification.enable=1
+
+amqp.broker.host=localhost
+amqp.broker.port=5672
+amqp.broker.username=guest
+amqp.broker.password=guest
+
+amqp.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPSenderImpl
+amqp.topic.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPTopicSenderImpl
+amqp.broadcast.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPBroadcastSenderImpl
+
+#,org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor
+#This is the amqp related configuration and this lists down the Rabbitmq host, this is an xsede specific configuration
+amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
+proxy.file.path=/Users/lahirugunathilake/Downloads/x509up_u503876
+connection.name=xsede
+#publisher
+activity.listeners=org.apache.airavata.gfac.core.monitor.AiravataJobStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataTaskStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataWorkflowNodeStatusUpdator,org.apache.airavata.api.server.listener.AiravataExperimentStatusUpdator,org.apache.airavata.gfac.core.monitor.GfacInternalStatusUpdator,org.apache.airavata.workflow.engine.util.ProxyMonitorPublisher
+publish.rabbitmq=false
+activity.publisher=org.apache.airavata.messaging.core.impl.RabbitMQPublisher
+rabbitmq.broker.url=amqp://localhost:5672
+rabbitmq.exchange.name=airavata_rabbitmq_exchange
+
+###########################################################################
+# Orchestrator module Configuration
+###########################################################################
+
+#job.submitter=org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter
+job.submitter=org.apache.airavata.orchestrator.core.impl.GFACServiceJobSubmitter
+job.validators=org.apache.airavata.orchestrator.core.validator.impl.SimpleAppDataValidator,org.apache.airavata.orchestrator.core.validator.impl.ExperimentStatusValidator
+submitter.interval=10000
+threadpool.size=10
+start.submitter=true
+embedded.mode=true
+enable.validation=true
+orchestrator=org.apache.airavata.orchestrator.server.OrchestratorServer
+
+###########################################################################
+# Zookeeper Server Configuration
+###########################################################################
+
+embedded.zk=true
+zookeeper.server.host=localhost
+zookeeper.server.port=2181
+airavata-server=/api-server
+orchestrator-server=/orchestrator-server
+gfac-server=/gfac-server
+gfac-experiments=/gfac-experiments
+gfac-server-name=gfac-node0
+orchestrator-server-name=orch-node0
+airavata-server-name=api-node0

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/client.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/client.xml b/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/client.xml
new file mode 100644
index 0000000..bc721ed
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/client.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--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. -->
+
+<config>
+    <client name="acs">
+        <logging
+                logFileName="../logs/oa4mp.log"
+                logName="oa4mp"
+                logSize="1000000"
+                logFileCount="2"
+                debug="true"/>
+        <id>myproxy:oa4mp,2012:/client/5a323fc6fcffcff7a95401046a303520</id>
+        <serviceUri>https://oa4mp.xsede.org/oauth</serviceUri>
+        <callbackUri>https://localhost:8443/credential-store/callback</callbackUri>
+        <!--callbackUri>http://149.165.228.118/PHP-Reference-Gateway/xsede_login.php</callbackUri-->
+        <lifetime>864000</lifetime>
+        <publicKeyFile>/Users/chathuri/dev/airavata/credential-store/oa4mp/oauth-pubkey.pem</publicKeyFile>
+        <privateKeyFile>/Users/chathuri/dev/airavata/credential-store/oa4mp/oauth-privkey.pk8</privateKeyFile>
+    </client>
+
+    <credential-store>
+        <successUri>http://gw120.iu.xsede.org/PHP-Reference-Gateway/</successUri>
+        <errorUri>/credential-store/error.jsp</errorUri>
+        <redirectUri>/credential-store/show-redirect.jsp</redirectUri>
+    </credential-store>
+
+</config>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8 b/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8
new file mode 100644
index 0000000..60f5b03
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCx/4hqCePa3scs
+oyGuwjnNdQCGfoPBlaCfl02Xq4L623EygIVo0faCX1ZZ/gA9ldw0TqZ6weCHfGck
+22TLeFQnJ4plAqJMMUbYwqmhnSsC9zTuc+c/yzcvdw2aCLPkMXnofFUasQEGhPI3
+/avTHOeUYBeu4ZU3u7G2Dp0jMDg1yh95v0FnGAjSPSBWQm1q4sxT90YB8jZyGvZ8
+kRs4S9Ik8Vz1VKNHJ16LZOuThfsRV4Af7vM8jXztjKUsrxQf1ZpKauAvXbJcDS2O
+pTjHWSvASk2pQxnDZDNcENE40MtG7V7qiDblMCuYumO8xnsJIGLreMKnSOQZKnDL
+uoBPNLB9AgMBAAECggEBAIJtcfHxaUr5rwygRJAftec88rOahMUW9Om8Hpkijglv
+PtT4o8kZAP6rCUVL/7Ug2IhjkU2mPvZIS/QP5x3JADDoolo9wdr+yKEQkuffmKLF
+rb2EpFB0ge1/2TGjat2s+11Frb6vMMcsJ6ircnpxVae9ed0lYwfBuwhiUPZ14NpY
+Figcq4mbM1fOmKIc035sR/fRVeuSEYPguw0sZkkx9LPGluvNXypwhfho60WCpxaB
+tgAadJRQgTEqz4kjHDD7xqY0w/KUJyqCOaJHnv2RmrdwrzDWFls6ETcc93PmINJU
+Mt2uLZZdd2nlZki91EhHA5XpPC1LoM2qXKaShfUMDWkCgYEA2oSVtz0ftT1njuX2
+OjsJi3ENOjmSuHaw81h72ZcIskCVrxZVeq0LGJdBQt361Q5ZhtnIgPA1bJXWtQ9s
+miFGkkPiPJb5GI45aLqpv+dJ/F/tXa0Q9LN++hfW8fKN8LejlM6tTiiYs3EqYEXO
+qqcLPoptxak8ZwDkOfj8yvJib6cCgYEA0IesCrCy8fpjVeDQdiAlIZqsecPJ2+Fz
+jLMik2hvAk6Yiyd8DmK8HMtSPfYMN4BhiphW49TXSyIoFEeCRQE8KMdSu3W4Z1wP
+AURZzQL78GRHc1n7EgCi2gzu38rSQDekmaQYr/hw+IlTpURjT68pDGKYXOybbjxu
+zUb67PHaAzsCgYADgs/ZAt1ojxUD4cQECYDMwcNBpT0rQ5TyRACxbVDRdGIzTvuO
+ngsomP2OcnyeQb3EgelL0RA6r2mkvRu0mkZFAVw4NwDHmTlo6l7h23h/2pa4w5gb
+Jmsq34kvmAMZ1AmH0Y5NTC+v6miQ5W49pbNzjMvYujBjQ0tndw2wwRY9zwKBgQDG
+FksgcI/b+z1Hg+Kig5CiJlr25DypibWJD1Wl74ucBmszrNNUmwgU1jOOtl8Ojf6a
+eHH5xOKq9YxbDz65LB4oood9masNTE7YpkQj0lTfG3MgKXatuDr6pVR49CLba8AJ
+Tu9AoeE2xsTVdmxccoiswi/3/a78fZ3HlEiism+lpwKBgCx7aX3MESqgxbf1kHgI
+Tu0nnvu06UwzAhBU6IpGKCqwu8zwfGN/PTTTz95hySUc1S4fSLuHVrdTAQTT3Zwr
+hwX85AxYdiyGhbeXFLue+eDWQ7PxAKXfRAwsKpdC72ixkXVqnVRh2yhRMPqKqnEu
+A5i3nuKHICZgD2fwQf+A8OL6
+-----END PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem b/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem
new file mode 100644
index 0000000..f094a6d
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsf+Iagnj2t7HLKMhrsI5
+zXUAhn6DwZWgn5dNl6uC+ttxMoCFaNH2gl9WWf4APZXcNE6mesHgh3xnJNtky3hU
+JyeKZQKiTDFG2MKpoZ0rAvc07nPnP8s3L3cNmgiz5DF56HxVGrEBBoTyN/2r0xzn
+lGAXruGVN7uxtg6dIzA4Ncofeb9BZxgI0j0gVkJtauLMU/dGAfI2chr2fJEbOEvS
+JPFc9VSjRydei2Trk4X7EVeAH+7zPI187YylLK8UH9WaSmrgL12yXA0tjqU4x1kr
+wEpNqUMZw2QzXBDRONDLRu1e6og25TArmLpjvMZ7CSBi63jCp0jkGSpwy7qATzSw
+fQIDAQAB
+-----END PUBLIC KEY-----

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/WEB-INF/web.xml b/modules/credential-store/credential-store-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..252f889
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ~ 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. -->
+
+<!-- This web.xml file is not required when using Servlet 3.0 container,
+     see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html#d4e194 -->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://java.sun.com/xml/ns/javaee"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         id="WebApp_ID" version="2.5">
+
+    <listener>
+        <listener-class>org.apache.airavata.credential.store.servlet.CredentialBootstrapper</listener-class>
+    </listener>
+
+    <context-param>
+        <param-name>oa4mp:client.config.file</param-name>
+        <param-value>${catalina.home}/webapps/credential-store/WEB-INF/classes/credential-store/client.xml</param-value>
+    </context-param>
+
+    <!-- Credential store parameters -->
+    <context-param>
+        <param-name>credential-store-jdbc-url</param-name>
+        <param-value>jdbc:mysql://localhost/airavata</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>credential-store-db-user</param-name>
+        <param-value>root</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>credential-store-db-password</param-name>
+        <param-value>root123</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>credential-store-db-driver</param-name>
+        <param-value>com.mysql.jdbc.Driver</param-value>
+    </context-param>
+
+    <!-- ========================= Security Related Configurations go here ================================== -->
+
+    <filter>
+        <filter-name>CORS Filter</filter-name>
+        <filter-class>org.ebaysf.web.cors.CORSFilter</filter-class>
+        <init-param>
+            <description>A comma separated list of allowed origins. Note: An '*' cannot be used for an allowed origin when using credentials.</description>
+            <param-name>cors.allowed.origins</param-name>
+            <param-value>*</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.allowed.methods</param-name>
+            <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.allowed.headers</param-name>
+            <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.exposed.headers</param-name>
+            <param-value></param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.support.credentials</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.logging.enabled</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.preflight.maxage</param-name>
+            <param-value>1800</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.request.decorate</param-name>
+            <param-value>true</param-value>
+        </init-param>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>CORS Filter</filter-name>
+        <url-pattern>/user-store/*</url-pattern>
+    </filter-mapping>
+
+    <!-- ================================ End Security Related Configurations =============================== -->
+
+    <!-- Credential Store Configurations -->
+    <servlet>
+        <servlet-name>credential-store-start</servlet-name>
+        <!--internal name of the servlet-->
+        <servlet-class>org.apache.airavata.credential.store.servlet.CredentialStoreStartServlet</servlet-class>
+
+        <load-on-startup>1</load-on-startup>
+        <!--load as soon as tomcat starts?-->
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>credential-store-start</servlet-name>
+        <!--the servlet-name above-->
+        <url-pattern>/acs-start-servlet</url-pattern>
+        <!--what needs to be in the url, so http://foo.org/client/simple-->
+    </servlet-mapping>
+
+    <servlet>
+        <servlet-name>callback</servlet-name>
+        <!--internal name of the servlet-->
+        <servlet-class>org.apache.airavata.credential.store.servlet.CredentialStoreCallbackServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+        <!--load as soon as tomcat starts?-->
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>callback</servlet-name>
+        <!--the servlet-name above-->
+        <url-pattern>/callback</url-pattern>
+        <!--what needs to be in the url, so http://foo.org/client/simple-->
+    </servlet-mapping>
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/acs/index.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/acs/index.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/acs/index.jsp
new file mode 100644
index 0000000..e7626fa
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/acs/index.jsp
@@ -0,0 +1,44 @@
+<%--
+  ~ 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.
+  --%>
+  
+<html>
+<body>
+<h2>Sample Portal</h2>
+<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
+<form name="input" action="../acs-start-servlet" method="post">
+
+    <table border="0">
+        <tr>
+            <td>Gateway Name</td>
+            <td><input type="text" name="gatewayName"></td>
+        </tr>
+        <tr>
+            <td>Portal Username</td>
+            <td><input type="text" name="portalUserName"></td>
+        </tr>
+        <tr>
+            <td>Contact Email</td>
+            <td><input type="text" name="email"></td>
+        </tr>
+    </table>
+
+    <input type="submit" value="Submit">
+</form>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/error.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/error.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/error.jsp
new file mode 100644
index 0000000..adc430d
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/error.jsp
@@ -0,0 +1,53 @@
+<%@ page import="org.apache.airavata.credential.store.util.CredentialStoreConstants" %>
+<%--
+  ~ 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.
+  --%>
+  
+
+<%
+    String gatewayName = request.getParameter(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER);
+    String portalUserName = request.getParameter(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER);
+    Throwable exception = (Throwable) request.getAttribute("exception");
+
+%>
+
+<html>
+<body>
+<h1>Credential Store</h1>
+<p>An error occurred while processing</p>
+<p>
+    Gateway Name - <%=gatewayName%>. Portal user name - <%=portalUserName%>.
+    Exception -
+
+</p>
+
+<p>
+    <%
+
+        out.println("Exception - " + exception.getMessage());
+        out.println();
+        StackTraceElement[] elements = exception.getStackTrace();
+        for (StackTraceElement element : elements) {
+            out.print("         ");
+            out.println(element.toString());
+        }
+
+    %>
+</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp
new file mode 100644
index 0000000..59a1e04
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp
@@ -0,0 +1,33 @@
+<%--
+  ~ 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.
+  --%>
+
+<html>
+<body>
+<h2>Store Passwords</h2>
+<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
+<form name="input" action="../airavata-registry-rest-services/credential-store" method="post">
+
+    Gateway Name   : <input type="text" name="gatewayName"><br>
+    Portal Username: <input type="text" name="portalUserName"><br>
+    Contact Email: <input type="text" name="email">
+
+    <input type="submit" value="Submit">
+</form>
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp
new file mode 100644
index 0000000..84b54cf
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp
@@ -0,0 +1,44 @@
+<%--
+  ~ 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.
+  --%>
+  
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+<%
+    String redirectUrlInRequest = (String) request.getAttribute("redirectUrl");
+%>
+
+<html>
+<head>
+    <script type="text/javascript">
+        <!--
+        function redirect(){
+            window.location = "<%=redirectUrlInRequest%>"
+        }
+        //-->
+    </script>
+</head>
+<body onLoad="setTimeout('redirect()', 1000)">
+<h2>You will be now redirect to MyProxy portal !</h2>
+<p>
+    If your browser didn't redirect to MyProxy Portal within 1 minute click following link,
+    <br><br> <a href="<%=redirectUrlInRequest%>"><%=redirectUrlInRequest%></a>
+</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/success.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/success.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/success.jsp
new file mode 100644
index 0000000..f2964d0
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/credential-store/success.jsp
@@ -0,0 +1,25 @@
+<%--
+  ~ 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.
+  --%>
+  
+<html>
+<body>
+<h1>Credential Store</h1>
+<p>Certificate Successfully Stored !</p>
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/acs.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/acs.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/acs.jsp
new file mode 100644
index 0000000..94bc6d9
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/acs.jsp
@@ -0,0 +1,62 @@
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
+<%--
+  Created by IntelliJ IDEA.
+  User: thejaka
+  Date: 8/5/13
+  Time: 4:48 PM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+  ~ 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.
+  --%>
+
+
+<html>
+<body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
+<h2>Sample Gateway</h2>
+
+
+
+<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
+<form name="input" action="https://localhost:8443/airavata/acs-start-servlet" method="post">
+
+    <table border="0">
+        <tr>
+            <td>Gateway Name</td>
+            <td><input type="text" name="gatewayName" value="default" readonly="readonly"></td>
+        </tr>
+        <tr>
+            <td>Portal Username</td>
+            <td><input type="text" name="portalUserName"></td>
+        </tr>
+        <tr>
+            <td>Contact Email</td>
+            <td><input type="text" name="email"></td>
+        </tr>
+    </table>
+
+    <input type="submit" value="Submit">
+</form>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/callback.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/callback.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/callback.jsp
new file mode 100644
index 0000000..560f64f
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/callback.jsp
@@ -0,0 +1,78 @@
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
+<%--
+  Created by IntelliJ IDEA.
+  User: thejaka
+  Date: 8/5/13
+  Time: 4:48 PM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+  ~ 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.
+  --%>
+
+<%
+    SampleGateway sampleGateway = (SampleGateway)session.getAttribute(SampleGateway.GATEWAY_SESSION);
+
+    boolean success = false;
+
+    String tokenId = request.getParameter("tokenId");
+
+    if (tokenId != null) {
+        sampleGateway.updateTokenId(tokenId);
+        success = true;
+    }
+%>
+
+<html>
+<body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
+<h2>Sample Gateway</h2>
+<%
+    out.println("The received token id - ");
+    out.println(tokenId);
+
+    if (success) {
+%>
+<p>Token id successfully updated.</p>
+
+<p>
+    View users who obtained token id.
+<ol>
+    <li><a href="list_users.jsp">List Users</a></li>
+</ol>
+</p>
+
+<%
+    } else {
+
+%>
+<p> Error updating token id.</p>
+<%
+
+    }
+
+%>
+
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/list_users.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/list_users.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/list_users.jsp
new file mode 100644
index 0000000..36883b7
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/list_users.jsp
@@ -0,0 +1,78 @@
+<%--
+  ~ 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.
+  --%>
+
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.apache.airavata.sample.gateway.userstore.User" %>
+<%--
+  Created by IntelliJ IDEA.
+  User: thejaka
+  Date: 8/5/13
+  Time: 12:30 PM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    SampleGateway sampleGateway = (SampleGateway)session.getAttribute(SampleGateway.GATEWAY_SESSION);
+%>
+
+<html>
+<head>
+    <title>List Users</title>
+</head>
+<body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
+<h1>Sample Gateway</h1>
+
+
+<p> This page lists all users and their attributes. </p>
+
+<table>
+    <tr>
+        <td>UserName</td>
+        <td>E-Mail</td>
+        <td>TokenId</td>
+    </tr>
+<%
+    List<User> userList = sampleGateway.getAllUsers();
+    for (User u : userList) {
+%>
+    <tr>
+        <td>
+            <%=u.getUserName() %>
+        </td>
+        <td>
+            <%=u.getEmail() %>
+        </td>
+        <td>
+            <%=u.getToken() %>
+        </td>
+
+    </tr>
+    <%
+        }
+    %>
+</table>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/logout.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/logout.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/logout.jsp
new file mode 100644
index 0000000..63d90be
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/logout.jsp
@@ -0,0 +1,35 @@
+<%--
+  ~ 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.
+  --%>
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %><%
+    session.removeAttribute("userName");
+    session.removeAttribute(SampleGateway.GATEWAY_SESSION);
+    session.invalidate();
+%>
+
+<html>
+<head>
+    <script language=javascript>
+        function redirect(){
+            window.location = "../index.jsp";
+        }
+    </script>
+</head>
+<body onload="redirect()">
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/user.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/user.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/user.jsp
new file mode 100644
index 0000000..1fd1957
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/gateway/user.jsp
@@ -0,0 +1,102 @@
+<%--
+  ~ 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.
+  --%>
+
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
+<%--
+  Created by IntelliJ IDEA.
+  User: thejaka
+  Date: 7/31/13
+  Time: 5:08 PM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    String loginScreen = request.getParameter("loginScreen");
+
+    String user = (String)session.getAttribute("userName");
+    boolean authenticate = false;
+
+    if (loginScreen != null && loginScreen.equals("true")) {
+        SampleGateway sampleGateway = null;
+        sampleGateway = (SampleGateway) session.getAttribute(SampleGateway.GATEWAY_SESSION);
+
+        if (sampleGateway == null) {
+            sampleGateway = new SampleGateway(session.getServletContext());
+        }
+
+        session.setAttribute(SampleGateway.GATEWAY_SESSION, sampleGateway);
+
+        user = request.getParameter("username");
+        String password = request.getParameter("password");
+
+        authenticate = sampleGateway.authenticate(user, password);
+    } else {
+        authenticate = true;
+    }
+
+%>
+<html>
+
+<head>
+    <title>Manage</title>
+</head>
+<body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
+<h1>Sample Gateway</h1>
+
+<%
+    if (authenticate) {
+
+        session.setAttribute("userName", user);
+
+        if (SampleGateway.isAdmin(user)) {
+%>
+<h1>Administration</h1>
+<p>
+    This page allows administration functionality.
+<ol>
+    <li><a href="acs.jsp">Retrieve Credentials</a></li>
+    <li><a href="list_users.jsp">List Users</a></li>
+</ol>
+</p>
+
+
+<%
+     } else {
+%>
+
+<p> You are a normal user. Click <a href="job.jsp">here</a> to configure and run "Echo" workflow on a GRID machine.</p>
+
+<%
+     }
+    } else {
+%>
+
+<h1>Authentication failed</h1>
+
+<%
+    }
+%>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png b/modules/credential-store/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png
new file mode 100644
index 0000000..4baf51b
Binary files /dev/null and b/modules/credential-store/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/index.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/index.jsp
new file mode 100644
index 0000000..1bf0ed6
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/index.jsp
@@ -0,0 +1,26 @@
+<%--
+  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.
+--%>
+
+<html>
+<body>
+<img src="images/airavata-logo-2.png">
+<h2>Airavata Credential Store</h2>
+<p>Welcome to Airavata Credential Store Web Application</p>
+
+<p><a href="user-store/add.jsp"><b>Manage Local User Store</b></a></p>
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/add.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/add.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/add.jsp
new file mode 100644
index 0000000..f37684d
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/add.jsp
@@ -0,0 +1,142 @@
+<%--
+  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.
+--%>
+<%@ page import="org.apache.airavata.credentialstore.local.LocalUserStore" %>
+
+<html>
+
+<head>
+    <script language="javascript" type="text/javascript">
+        function validatePassword(fld1name, regString) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+            if(regString != "null" && !stringValue.match(new RegExp(regString))){
+                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
+                        "characters.";
+                return errorMessage;
+            }else if(regString != "null" && stringValue == ''){
+                return errorMessage;
+            }
+
+            if (stringValue == '') {
+                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function validateUsername(fld1name) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue == '') {
+                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function checkPasswordsMatching(fld1name, fld2name) {
+
+            var stringValue1 = document.getElementsByName(fld1name)[0].value;
+            var stringValue2 = document.getElementsByName(fld2name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue1 != stringValue2) {
+                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+
+        }
+
+        function validate() {
+            var reason = "";
+
+            reason = validateUsername("username");
+
+            if (reason != "") {
+                alert(reason);
+                return false;
+            }
+
+            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                return false;
+            }
+
+            reason = checkPasswordsMatching("newPassword", "confirmPassword");
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                document.getElementsByName("confirmPassword")[0].clear();
+                return false;
+            }
+
+            return true;
+        }
+
+        function doProcess() {
+            if (validate() == true) {
+                document.registration.submit();
+            }
+        }
+
+
+    </script>
+</head>
+
+<body>
+<img src="../images/airavata-logo-2.png">
+<h2>Airavata Credential Store - Local User Store</h2>
+<p><b>Manage Local User Store - Add New User</b></p>
+
+<form action="index.jsp" name="registration" method="POST">
+
+    <input type="hidden" name="operation" value="addUser">
+    <table>
+        <tr>
+            <td>User Name</td>
+            <td><input type="text" name="username" maxlength="150"></td>
+        </tr>
+        <tr>
+            <td>Password</td>
+            <td><input type="password" name="newPassword"/></td>
+        </tr>
+        <tr>
+            <td>Re-Type Password</td>
+            <td><input type="password" name="confirmPassword"/></td>
+        </tr>
+    </table>
+
+    <table>
+        <tr>
+            <td><input type="button" value="Add" onclick= 'doProcess()'></td>
+            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
+        </tr>
+    </table>
+
+</form>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/index.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/index.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/index.jsp
new file mode 100644
index 0000000..732c0c7
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/index.jsp
@@ -0,0 +1,138 @@
+<%--
+  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.
+--%>
+
+<%@ page import = "org.apache.airavata.credentialstore.local.LocalUserStore" %>
+<%@ page import="org.apache.airavata.credentialstore.basic.BasicAccessAuthenticator" %>
+<%@ page import="org.apache.airavata.credentialstore.session.HttpAuthenticatorFilter" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.apache.airavata.common.utils.Constants" %>
+<%
+
+    LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
+
+    if (localUserStore == null) {
+
+        String operatingUser = (String) session.getAttribute(Constants.USER_IN_SESSION);
+
+        if (operatingUser == null || !operatingUser.equals("admin")) {
+            HttpAuthenticatorFilter.sendUnauthorisedError(response, "Insufficient privileges to perform user operations." +
+                    " Only admin user is allowed to perform user operations.");
+
+            return;
+        }
+
+        localUserStore = new LocalUserStore(application);
+
+        session.setAttribute("LocalUserStore", localUserStore);
+    }
+
+    String operation = request.getParameter("operation");
+    if (operation != null) {
+        if (operation.equals("addUser")) {
+            String userName = request.getParameter("username");
+            String password = request.getParameter("newPassword");
+
+            localUserStore.addUser(userName, password);
+        } else if (operation.equals("deleteUser")) {
+            String[] usersToDelete = request.getParameterValues("user-id");
+
+            for (String deleteUser : usersToDelete) {
+                localUserStore.deleteUser(deleteUser);
+            }
+        }
+    }
+
+    List<String> allUsers = localUserStore.getUsers();
+
+%>
+
+<html>
+<head>
+    <script language="javascript" type="text/javascript">
+
+        function validate() {
+            var checkSelected = false;
+            for (var i = 0; i < <%=allUsers.size()%>; i++) {
+                if (document.main["user-id"][i].checked) {
+                    checkSelected = true;
+                }
+            }
+            if (checkSelected) {
+                var answer = confirm("Are you sure you want to delete selected users from the system ?");
+                if (answer) {
+                    return true;
+                }
+            } else {
+                alert("Select at least one user to delete.");
+            }
+            return false;
+        }
+
+        function doProcess() {
+            if (validate() == true) {
+                document.main.submit();
+            }
+        }
+
+    </script>
+</head>
+<body>
+<img src="../images/airavata-logo-2.png">
+<h2>Airavata REST API - Local User Store</h2>
+<p><b>Manage Local User Store</b></p>
+
+
+<form action="index.jsp" name="main" method="POST">
+    <table>
+        <tr>
+            <td>&nbsp;</td>
+            <td>All Users</td>
+        </tr>
+        <%
+            for (String user : allUsers) {
+        %>
+
+        <tr>
+            <td><input type="checkbox" name="user-id" value="<%=user%>"></td>
+            <td><%=user%>
+            </td>
+            <td><a href="password.jsp?username=<%=user%>">Change Password</a></td>
+        </tr>
+
+        <%
+            }
+        %>
+    </table>
+
+    <br>
+
+    <table width="100">
+        <tr>
+            <td>
+                <a href="add.jsp"><input type="button" value="Add" name="Add"/></a>
+            </td>
+            <td>&nbsp;</td>
+            <input type="hidden" name="operation" value="deleteUser">
+            <td><input type="button" value="Delete" onclick="doProcess()"></td>
+        </tr>
+    </table>
+
+</form>
+
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/password.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/password.jsp b/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/password.jsp
new file mode 100644
index 0000000..9a316ee
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/webapp/user-store/password.jsp
@@ -0,0 +1,157 @@
+<%--
+  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.
+--%>
+
+<%@ page import="org.apache.airavata.credentialstore.local.LocalUserStore" %>
+
+<%
+    String userName = request.getParameter("username");
+    if (userName == null) {
+        response.sendRedirect("index.jsp");
+    }
+
+    String password = request.getParameter("newPassword");
+    String confirmPassword = request.getParameter("confirmPassword");
+
+    if (password != null && confirmPassword != null && password.equals(confirmPassword)) {
+        LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
+        localUserStore.changePasswordByAdmin(userName, password);
+
+        response.sendRedirect("password.jsp?message=\"Password successfully change for user "
+                + userName + "\"&username=" + userName);
+    }
+
+%>
+
+<html>
+<head>
+    <script language="javascript" type="text/javascript">
+        function validatePassword(fld1name, regString) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+            if(regString != "null" && !stringValue.match(new RegExp(regString))){
+                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
+                        "characters.";
+                return errorMessage;
+            }else if(regString != "null" && stringValue == ''){
+                return errorMessage;
+            }
+
+            if (stringValue == '') {
+                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function validateUsername(fld1name) {
+            var stringValue = document.getElementsByName(fld1name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue == '') {
+                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+        }
+
+        function checkPasswordsMatching(fld1name, fld2name) {
+
+            var stringValue1 = document.getElementsByName(fld1name)[0].value;
+            var stringValue2 = document.getElementsByName(fld2name)[0].value;
+            var errorMessage = "";
+
+            if (stringValue1 != stringValue2) {
+                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
+                return errorMessage;
+            }
+
+            return errorMessage;
+
+        }
+
+        function validate() {
+            var reason = "";
+
+            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                return false;
+            }
+
+            reason = checkPasswordsMatching("newPassword", "confirmPassword");
+
+            if (reason != "") {
+                alert(reason);
+                document.getElementsByName("newPassword")[0].clear();
+                document.getElementsByName("confirmPassword")[0].clear();
+                return false;
+            }
+
+            return true;
+        }
+
+        function doProcess() {
+            if (validate() == true) {
+                document.passwordForm.submit();
+            }
+        }
+
+        function displayMessage() {
+            var msg = <%=request.getParameter("message")%>;
+            if (msg != null) {
+                alert(msg);
+            }
+        }
+
+
+    </script>
+</head>
+
+<body onload="displayMessage()">
+<img src="../images/airavata-logo-2.png">
+<h2>Airavata REST API - Local User Store</h2>
+<p><b>Manage Local User Store - Change Password of user - <%=userName%></b></p>
+
+<form action="password.jsp" name="passwordForm" method="POST">
+
+    <input type="hidden" name="username" value="<%=userName%>">
+    <table>
+        <tr>
+            <td>New Password</td>
+            <td><input type="password" name="newPassword"/></td>
+        </tr>
+        <tr>
+            <td>Re-Type Password</td>
+            <td><input type="password" name="confirmPassword"/></td>
+        </tr>
+    </table>
+
+    <table>
+        <tr>
+            <td><input type="button" value="Change" onclick= 'doProcess()'></td>
+            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
+        </tr>
+    </table>
+
+</form>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/cs-thrift-descriptions/credentialStoreCPI.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store/cs-thrift-descriptions/credentialStoreCPI.thrift b/modules/credential-store/cs-thrift-descriptions/credentialStoreCPI.thrift
new file mode 100644
index 0000000..f35e884
--- /dev/null
+++ b/modules/credential-store/cs-thrift-descriptions/credentialStoreCPI.thrift
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+ * Component Programming Interface definition for Apache Airavata GFac Service.
+ *
+*/
+
+include "credentialStoreDataModel.thrift"
+include "credentialStoreErrors.thrift"
+
+namespace java org.apache.airavata.credential.store.cpi
+
+const string CS_CPI_VERSION = "0.15.0"
+
+service CredentialStoreService {
+
+  /** Query CS server to fetch the CPI version */
+  string getCSServiceVersion(),
+
+  /**
+  * This method is to add SSHCredential which will return the token Id in success
+  **/
+  string addSSHCredential (1: required credentialStoreDataModel.SSHCredential sshCredential)
+                        throws (1:credentialStoreErrors.CredentialStoreException csException);
+
+  string addCertificateCredential (1: required credentialStoreDataModel.CertificateCredential certificateCredential)
+                        throws (1:credentialStoreErrors.CredentialStoreException csException);
+
+  string addPasswordCredential (1: required credentialStoreDataModel.PasswordCredential passwordCredential)
+                        throws (1:credentialStoreErrors.CredentialStoreException csException);
+
+  credentialStoreDataModel.SSHCredential getSSHCredential (1: required string tokenId, 2: required string gatewayId)
+                        throws (1:credentialStoreErrors.CredentialStoreException csException);
+
+  credentialStoreDataModel.CertificateCredential getCertificateCredential (1: required string tokenId, 2: required string gatewayId)
+                        throws (1:credentialStoreErrors.CredentialStoreException csException);
+
+  credentialStoreDataModel.PasswordCredential getPasswordCredential (1: required string tokenId, 2: required string gatewayId)
+                        throws (1:credentialStoreErrors.CredentialStoreException csException);
+
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/cs-thrift-descriptions/credentialStoreDataModel.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store/cs-thrift-descriptions/credentialStoreDataModel.thrift b/modules/credential-store/cs-thrift-descriptions/credentialStoreDataModel.thrift
new file mode 100644
index 0000000..ce4dc46
--- /dev/null
+++ b/modules/credential-store/cs-thrift-descriptions/credentialStoreDataModel.thrift
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ *
+ */
+
+
+namespace java org.apache.airavata.credential.store.datamodel
+namespace php Airavata.Model.Credential.Store
+
+
+const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS"
+
+
+struct SSHCredential {
+    1: required string gatewayId,
+    2: required string username,
+    3: required string passphrase,
+    4: optional string publicKey,
+    5: optional string privateKey,
+    6: optional i64 persistedTime,
+    7: optional string token
+}
+
+struct CommunityUser {
+    1: required string gatewayName,
+    2: required string username,
+    3: required string userEmail
+}
+
+struct CertificateCredential {
+    1: required CommunityUser communityUser,
+    2: required string x509Cert,
+    3: optional string notAfter,
+    4: optional string privateKey,
+    5: optional i64 lifeTime,
+    6: optional string notBefore
+    7: optional i64 persistedTime,
+    8: optional string token
+}
+
+struct PasswordCredential {
+    1: required string username,
+    2: required string password,
+    3: optional i64 persistedTime,
+    4: optional string token
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/cs-thrift-descriptions/credentialStoreErrors.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store/cs-thrift-descriptions/credentialStoreErrors.thrift b/modules/credential-store/cs-thrift-descriptions/credentialStoreErrors.thrift
new file mode 100644
index 0000000..148d7f2
--- /dev/null
+++ b/modules/credential-store/cs-thrift-descriptions/credentialStoreErrors.thrift
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+* This file describes the definitions of the Error Messages that can occur
+*  when invoking Apache Airavata Services through the API. In addition Thrift provides
+*  built in funcationality to raise TApplicationException for all internal server errors.
+*/
+
+namespace java org.apache.airavata.credential.store.exception
+namespace php Airavata.Credential.Store.Error
+
+exception CredentialStoreException {
+  1: required string message
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/cs-thrift-descriptions/generate-cs-stubs.sh
----------------------------------------------------------------------
diff --git a/modules/credential-store/cs-thrift-descriptions/generate-cs-stubs.sh b/modules/credential-store/cs-thrift-descriptions/generate-cs-stubs.sh
new file mode 100755
index 0000000..a1ca01f
--- /dev/null
+++ b/modules/credential-store/cs-thrift-descriptions/generate-cs-stubs.sh
@@ -0,0 +1,134 @@
+#! /usr/bin/env bash
+
+# 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.
+
+# This script will regenerate the thrift code for Airavata Credential Store Server Skeltons and Client Stubs.
+
+
+# Global Constants used across the script
+REQUIRED_THRIFT_VERSION='0.9.1'
+BASE_TARGET_DIR='target'
+CS_SERVICE_DIR='../credential-store-stubs/src/main/java'
+
+# The Function fail prints error messages on failure and quits the script.
+fail() {
+    echo $@
+    exit 1
+}
+
+# The function add_license_header adds the ASF V2 license header to all java files within the specified generated
+#   directory. The function also adds suppress all warnings annotation to all public classes and enums
+#  To Call:
+#   add_license_header $generated_code_directory
+add_license_header() {
+
+    # Fetch the generated code directory passed as the argument
+    GENERATED_CODE_DIR=$1
+
+    # For all generated thrift code, add the suppress all warnings annotation
+    #  NOTE: In order to save the original file as a backup, use sed -i.orig in place of sed -i ''
+    find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /'
+    find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /'
+
+    # For each java file within the generated directory, add the ASF V2 LICENSE header
+    for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do
+      cat - ${f} >${f}-with-license <<EOF
+    /*
+     * 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.
+     */
+EOF
+    mv ${f}-with-license ${f}
+    done
+}
+
+# The function compares every generated java file with the one in specified existing source location. If the comparison
+#   shows a difference, then it replaces with the newly generated file (with added license header).
+#  To Call:
+#   copy_changed_files $generated_code_directory $existing_source_directory
+copy_changed_files() {
+
+    # Read all the function arguments
+    GENERATED_CODE_DIR=$1
+    WORKSPACE_SRC_DIR=$2
+
+    echo "Generated sources are in ${GENERATED_CODE_DIR}"
+    echo "Destination workspace is in ${WORKSPACE_SRC_DIR}"
+
+    # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced.
+    #  the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied.
+    rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR}
+}
+
+# Generation of thrift files will require installing Apache Thrift. Please add thrift to your path.
+#  Verify is thrift is installed, is in the path is at a specified version.
+VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" |  wc -l)
+if [ "$VERSION" -ne 1 ] ; then
+    echo "****************************************************"
+    echo "*** thrift is not installed or is not in the path"
+    echo "***   expecting 'thrift -version' to return ${REQUIRED_THRIFT_VERSION}"
+    echo "*** generated code will not be updated"
+    fail "****************************************************"
+fi
+
+# Initialize the thrift arguments.
+#  Since most of the Airavata API and Data Models have includes, use recursive option by default.
+#  Generate all the files in target directory
+THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}"
+# Ensure the required target directories exists, if not create.
+mkdir -p ${BASE_TARGET_DIR}
+
+#######################################################################
+# Generate/Update the Credential Store CPI service stubs
+#  To start with both the servicer and client are in same package, but
+#  needs to be split using a common generated api-boilerplate-code
+#######################################################################
+
+#Java generation directory
+JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java
+
+# As a precaution  remove and previously generated files if exists
+rm -rf ${JAVA_GEN_DIR}
+
+# Using thrift Java generator, generate the java classes based on Airavata API. This
+#   The airavataAPI.thrift includes rest of data models.
+thrift ${THRIFT_ARGS} --gen java credentialStoreCPI.thrift || fail unable to generate java thrift classes
+thrift ${THRIFT_ARGS} --gen java credentialStoreDataModel.thrift || fail unable to generate java thrift classes
+
+
+# For the generated java classes add the ASF V2 License header
+add_license_header $JAVA_GEN_DIR
+
+# Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones.
+copy_changed_files ${JAVA_GEN_DIR} ${CS_SERVICE_DIR}
+
+# CleanUp: Delete the base target build directory
+#rm -rf ${BASE_TARGET_DIR}
+
+echo "Successfully generated new sources, compared against exiting code and replaced the changed files"
+exit 0

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/pom.xml b/modules/credential-store/pom.xml
new file mode 100644
index 0000000..370cc9b
--- /dev/null
+++ b/modules/credential-store/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata</artifactId>
+        <version>0.15-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>credential-store</artifactId>
+    <packaging>pom</packaging>
+    <name>Airavata Credential Store</name>
+    <url>http://airavata.apache.org/</url>
+
+    <profiles>
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <modules>
+                <module>credential-store-service</module>
+                <module>credential-store-stubs</module>
+                <module>credential-store-webapp</module>
+            </modules>
+        </profile>
+    </profiles>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 512f21d..8f48edc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -520,7 +520,7 @@
 				<module>modules/registry</module>
 				<module>modules/app-catalog</module>
 				<module>modules/security</module>
-				<module>modules/credential-store-service</module>
+				<module>modules/credential-store</module>
 				<module>modules/orchestrator</module>
 				<module>tools</module>
 				<module>modules/server</module>
@@ -605,7 +605,7 @@
 				<module>modules/workflow-model</module>
 				<module>modules/registry</module>
 				<module>modules/security</module>
-				<module>modules/credential-store-service</module>
+				<module>modules/credential-store</module>
 				<module>modules/orchestrator</module>
 				<module>tools</module>
 				<module>modules/server</module>


[27/62] [abbrv] airavata git commit: change persistent_data to experiment_catalog

Posted by la...@apache.org.
change persistent_data to experiment_catalog


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9385c4eb
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9385c4eb
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9385c4eb

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 9385c4eb0ad9df573e62657bacecc552fdeb97bb
Parents: e9468ca
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 6 14:20:18 2015 -0500
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 6 14:20:18 2015 -0500

----------------------------------------------------------------------
 .../org/apache/airavata/common/utils/DatabaseTestCases.java    | 2 +-
 .../client/src/main/resources/airavata-client.properties       | 2 +-
 .../server/src/main/resources/airavata-server.properties       | 6 +++---
 .../credential/store/store/impl/db/SSHCredentialTest.java      | 2 +-
 .../src/main/resources/airavata-server.properties              | 4 ++--
 modules/security/src/test/resources/jdbc-authenticator.xml     | 2 +-
 modules/security/src/test/resources/session-authenticator.xml  | 2 +-
 tools/registry-tool/README                                     | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/DatabaseTestCases.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/DatabaseTestCases.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/DatabaseTestCases.java
index 019a53c..6ff528d 100644
--- a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/DatabaseTestCases.java
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/DatabaseTestCases.java
@@ -62,7 +62,7 @@ public class DatabaseTestCases {
 
     public static String getJDBCUrl() {
         return new StringBuilder().append("jdbc:derby://").append(getHostAddress()).append(":").append(getPort())
-                .append("/persistent_data;create=true;user=").append(getUserName()).append(";password=")
+                .append("/experiment_catalog;create=true;user=").append(getUserName()).append(";password=")
                 .append(getPassword()).toString();
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/modules/configuration/client/src/main/resources/airavata-client.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/client/src/main/resources/airavata-client.properties b/modules/configuration/client/src/main/resources/airavata-client.properties
index 98972cd..70f2bae 100644
--- a/modules/configuration/client/src/main/resources/airavata-client.properties
+++ b/modules/configuration/client/src/main/resources/airavata-client.properties
@@ -39,7 +39,7 @@
 
 #for derby [AiravataJPARegistry]
 registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.url=jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata
 registry.jdbc.user=airavata
 registry.jdbc.password=airavata
 start.derby.server.mode=true

http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-server.properties b/modules/configuration/server/src/main/resources/airavata-server.properties
index c493752..55fbba6 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -31,10 +31,10 @@
 
 #for derby [AiravataJPARegistry]
 registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.url=jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata
 # MySql database configuration
 #registry.jdbc.driver=com.mysql.jdbc.Driver
-#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+#registry.jdbc.url=jdbc:mysql://localhost:3306/experiment_catalog
 registry.jdbc.user=airavata
 registry.jdbc.password=airavata
 start.derby.server.mode=true
@@ -100,7 +100,7 @@ start.credential.store=false
 credential.store.keystore.url=/Users/chathuri/dev/airavata/credential-store/oa4mp/airavata_sym.jks
 credential.store.keystore.alias=airavata
 credential.store.keystore.password=airavata
-credential.store.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+credential.store.jdbc.url=jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata
 credential.store.jdbc.user=airavata
 credential.store.jdbc.password=airavata
 credential.store.jdbc.driver=org.apache.derby.jdbc.ClientDriver

http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
index 7f44125..84b6bd3 100644
--- a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
@@ -38,7 +38,7 @@ import java.io.IOException;
 public class SSHCredentialTest {
 
     public static void main(String[] args) {
-        String jdbcURL = "jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata";
+        String jdbcURL = "jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata";
         String jdbcDriver = "org.apache.derby.jdbc.ClientDriver";
         String userName = "airavata";
         String password = "airavata";

http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties b/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
index fb02901..badf28d 100644
--- a/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
+++ b/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
@@ -31,7 +31,7 @@
 
 #for derby [AiravataJPARegistry]
 registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.url=jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata
 # MySql database configuration
 #registry.jdbc.driver=com.mysql.jdbc.Driver
 #registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
@@ -89,7 +89,7 @@ orchestrator.server.min.threads=50
 credential.store.keystore.url=/Users/lahirugunathilake/Downloads/airavata_sym.jks
 credential.store.keystore.alias=airavata
 credential.store.keystore.password=airavata
-credential.store.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+credential.store.jdbc.url=jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata
 credential.store.jdbc.user=airavata
 credential.store.jdbc.password=airavata
 credential.store.jdbc.driver=org.apache.derby.jdbc.ClientDriver

http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/modules/security/src/test/resources/jdbc-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/jdbc-authenticator.xml b/modules/security/src/test/resources/jdbc-authenticator.xml
index c27b60f..fccf8b8 100644
--- a/modules/security/src/test/resources/jdbc-authenticator.xml
+++ b/modules/security/src/test/resources/jdbc-authenticator.xml
@@ -26,7 +26,7 @@
         <specificConfigurations>
             <database>
                 <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
+                <jdbcUrl>jdbc:derby://localhost:20000/experiment_catalog;create=true</jdbcUrl>
                 <userName>admin</userName>
                 <password>admin</password>
                 <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/modules/security/src/test/resources/session-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/session-authenticator.xml b/modules/security/src/test/resources/session-authenticator.xml
index 670913e..2c3fd2e 100644
--- a/modules/security/src/test/resources/session-authenticator.xml
+++ b/modules/security/src/test/resources/session-authenticator.xml
@@ -28,7 +28,7 @@
             <database>
                 <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
                 <!-- Points to /Users/thejaka/development/apache/airavata/trunk/modules/commons/airavata-registry-rest/target/tomcat6x/. -->
-                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
+                <jdbcUrl>jdbc:derby://localhost:20000/experiment_catalog;create=true</jdbcUrl>
 
                 <!--jdbcUrl>jdbc:h2:modules/security/src/test/resources/testdb/test</jdbcUrl-->
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9385c4eb/tools/registry-tool/README
----------------------------------------------------------------------
diff --git a/tools/registry-tool/README b/tools/registry-tool/README
index d21be0f..40a8e65 100644
--- a/tools/registry-tool/README
+++ b/tools/registry-tool/README
@@ -6,4 +6,4 @@
 3. Copy db-migrate.sh file to <AIRAVATA_HOME>/bin
 4. Make sure previous version of airavata database is up and running
 5. Run db-migrate.sh script file
-        ./db-migrate.sh -url jdbc:mysql://localhost:3306/persistent_data -user airavata -pwd airavata -v 0.7
\ No newline at end of file
+        ./db-migrate.sh -url jdbc:mysql://localhost:3306/experiment_catalog -user airavata -pwd airavata -v 0.7
\ No newline at end of file


[34/62] [abbrv] airavata git commit: more fixed to support LSF

Posted by la...@apache.org.
more fixed to support LSF


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: fcbda21f3fbbbc75afa01f4b590afe873c192de2
Parents: 04cecb4
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Mon Mar 9 17:03:33 2015 -0400
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Mon Mar 9 17:03:33 2015 -0400

----------------------------------------------------------------------
 .../airavata/api/server/AiravataAPIServer.java  | 38 +++++++++---------
 .../client/samples/CreateLaunchExperiment.java  | 20 +++++++---
 .../tools/RegisterSampleApplications.java       | 10 +++--
 .../store/store/impl/db/SSHCredentialTest.java  |  2 +-
 .../airavata/gfac/server/GfacServerHandler.java | 39 +++++++++---------
 .../monitor/impl/pull/qstat/HPCPullMonitor.java | 42 +++++++++++++++++---
 .../airavata/gfac/monitor/util/CommonUtils.java |  1 +
 .../gfac/ssh/security/TokenizedSSHAuthInfo.java |  5 ++-
 .../impl/DefaultSSHApiTestWithMyProxyAuth.java  | 14 ++++---
 .../gsi/ssh/impl/VanilaTestWithSSHAuth.java     |  4 +-
 10 files changed, 112 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
index 0e6da90..4d465f7 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
@@ -302,26 +302,26 @@ public class AiravataAPIServer implements IServer, Watcher{
         synchronized (mutex) {
             Event.KeeperState state = watchedEvent.getState();
             logger.info(state.name());
-            if (state == Event.KeeperState.SyncConnected) {
-                mutex.notify();
-            } else if(state == Event.KeeperState.Expired ||
-                    state == Event.KeeperState.Disconnected){
-                try {
-                    mutex = -1;
-                    zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), 6000, this);
-                    synchronized (mutex) {
-                        mutex.wait();  // waiting for the syncConnected event
+            switch(state){
+                case SyncConnected:
+                    mutex.notify();
+                case Expired:case Disconnected:
+                    try {
+                        mutex = -1;
+                        zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), 6000, this);
+                        synchronized (mutex) {
+                            mutex.wait();  // waiting for the syncConnected event
+                        }
+                        storeServerConfig();
+                    } catch (IOException e) {
+                        logger.error("Error while synchronizing with zookeeper", e);
+                    } catch (ApplicationSettingsException e) {
+                        logger.error("Error while synchronizing with zookeeper", e);
+                    } catch (InterruptedException e) {
+                        logger.error("Error while synchronizing with zookeeper", e);
+                    } catch (AiravataSystemException e) {
+                        logger.error("Error while synchronizing with zookeeper", e);
                     }
-                    storeServerConfig();
-                } catch (IOException e) {
-                    logger.error("Error while synchronizing with zookeeper", e);
-                } catch (ApplicationSettingsException e) {
-                    logger.error("Error while synchronizing with zookeeper", e);
-                } catch (InterruptedException e) {
-                    logger.error("Error while synchronizing with zookeeper", e);
-                } catch (AiravataSystemException e) {
-                    logger.error("Error while synchronizing with zookeeper", e);
-                }
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index bb2ae6e..3d58197 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -58,7 +58,7 @@ public class CreateLaunchExperiment {
     private static final String DEFAULT_GATEWAY = "php_reference_gateway";
     private static Airavata.Client airavataClient;
 
-    private static String echoAppId = "Echo_802454e5-6358-4371-9a04-3d5d59cecbc7";
+    private static String echoAppId = "Echo_8506337e-ab7a-46b6-9b71-4a461b6c5e35";
     private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
     private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
@@ -1348,27 +1348,37 @@ public class CreateLaunchExperiment {
 
     public static String createExperimentForLSF(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+            List<InputDataObjectType> exInputs = client.getApplicationInputs(echoAppId);
+
+            for (InputDataObjectType inputDataObjectType : exInputs) {
+                inputDataObjectType.setValue("Hello World");
+            }
+            /*List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
             InputDataObjectType input = new InputDataObjectType();
             input.setName("Input_to_Echo");
             input.setType(DataType.STRING);
             input.setValue("Echoed_Output=Hello World");
             input.setRequiredToAddedToCommandLine(true);
-            exInputs.add(input);
+            exInputs.add(input);*/
 
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
+            /*
             List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
             OutputDataObjectType output = new OutputDataObjectType();
             output.setName("output_file");
             output.setType(DataType.URI);
             output.setValue("");
-            exOut.add(output);
+
+            exOut.add(output);*/
 
             Project project = ProjectModelUtil.createProject("default", "lg11w", "test project");
             String projectId = client.createProject(DEFAULT_GATEWAY, project);
 
+
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment(projectId, "lg11w", "sshEchoExperiment", "StressMem", echoAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
+            simpleExperiment.setExperimentInputs(exInputs);
 
             Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(echoAppId);
             if (computeResources != null && computeResources.size() != 0) {
@@ -1598,7 +1608,7 @@ public class CreateLaunchExperiment {
     public static void launchExperiment(Airavata.Client client, String expId)
             throws TException {
         try {
-        	String tokenId ="aa-dcdb-48e3-9cd5-ac90b710d55e";
+        	String tokenId ="-0bbb-403b-a88a-42b6dbe198e9";
             client.launchExperiment(expId, tokenId);
         } catch (ExperimentNotFoundException e) {
             logger.error("Error occured while launching the experiment...", e.getMessage());

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index 8ae2dd2..55dbcf8 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -497,11 +497,15 @@ public class RegisterSampleApplications {
 //            applicationInputs.add(input2); applicationInputs.add(input3);
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output",
-                    "", DataType.STRING, false, false);
-            
+                    "", DataType.STDOUT, false, false);
+
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Error",
+                    "", DataType.STDERR, false, false);
+
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
-            
+            applicationOutputs.add(output2);
+
 
             echoInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(echoName, echoDescription,

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
index e78ab7a..e6969e6 100644
--- a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
@@ -67,7 +67,7 @@ public class SSHCredentialTest {
             pubKeyStream.close();
             sshCredential.setPrivateKey(bFilePub);
             sshCredential.setPublicKey(bFilePub);
-            sshCredential.setPassphrase("gjtlmiJdas7wph");
+            sshCredential.setPassphrase("ljclqowueqllad_lqlj");
             writer.writeCredentials(sshCredential);
             System.out.println(token);
         } catch (ClassNotFoundException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
index 1687462..4973a41 100644
--- a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
+++ b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
@@ -156,27 +156,26 @@ public class GfacServerHandler implements GfacService.Iface, Watcher{
         synchronized (mutex) {
             Event.KeeperState state = watchedEvent.getState();
             logger.info(state.name());
-            if (state == Event.KeeperState.SyncConnected) {
-                mutex.notify();
-                connected = true;
-            } else if(state == Event.KeeperState.Expired ||
-                    state == Event.KeeperState.Disconnected){
-                try {
-                    mutex = -1;
-                    zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), 6000, this);
-                    synchronized (mutex) {
-                        mutex.wait();  // waiting for the syncConnected event
+            switch (state){
+                case SyncConnected:
+                    mutex.notify();
+                    break;
+                case Expired:case Disconnected:
+                    try {
+                        zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), 6000, this);
+                        synchronized (mutex) {
+                            mutex.wait();  // waiting for the syncConnected event
+                        }
+                        storeServerConfig();
+                    } catch (IOException e) {
+                        logger.error(e.getMessage(), e);
+                    } catch (ApplicationSettingsException e) {
+                        logger.error(e.getMessage(), e);
+                    } catch (InterruptedException e) {
+                        logger.error(e.getMessage(), e);
+                    } catch (KeeperException e) {
+                        logger.error(e.getMessage(), e);
                     }
-                    storeServerConfig();
-                } catch (IOException e) {
-                    logger.error(e.getMessage(), e);
-                } catch (ApplicationSettingsException e) {
-                    logger.error(e.getMessage(), e);
-                } catch (InterruptedException e) {
-                    logger.error(e.getMessage(), e);
-                } catch (KeeperException e) {
-                    logger.error(e.getMessage(), e);
-                }
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/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 b7f08a6..f0b447e 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
@@ -74,6 +74,8 @@ public class HPCPullMonitor extends PullMonitor {
 
     private AuthenticationInfo authenticationInfo;
 
+    private ArrayList<MonitorID> removeList;
+
     public HPCPullMonitor() {
         connections = new HashMap<String, ResourceConnection>();
         queue = new LinkedBlockingDeque<UserMonitorData>();
@@ -81,6 +83,7 @@ public class HPCPullMonitor extends PullMonitor {
         cancelJobList = new LinkedBlockingQueue<String>();
         completedJobsFromPush = new ArrayList<String>();
         (new SimpleJobFinishConsumer(this.completedJobsFromPush)).listen();
+        removeList = new ArrayList<MonitorID>();
     }
 
     public HPCPullMonitor(MonitorPublisher monitorPublisher, AuthenticationInfo authInfo) {
@@ -91,6 +94,7 @@ public class HPCPullMonitor extends PullMonitor {
         cancelJobList = new LinkedBlockingQueue<String>();
         this.completedJobsFromPush = new ArrayList<String>();
         (new SimpleJobFinishConsumer(this.completedJobsFromPush)).listen();
+        removeList = new ArrayList<MonitorID>();
     }
 
     public HPCPullMonitor(BlockingQueue<UserMonitorData> queue, MonitorPublisher publisher) {
@@ -100,6 +104,7 @@ public class HPCPullMonitor extends PullMonitor {
         cancelJobList = new LinkedBlockingQueue<String>();
         this.completedJobsFromPush = new ArrayList<String>();
         (new SimpleJobFinishConsumer(this.completedJobsFromPush)).listen();
+        removeList = new ArrayList<MonitorID>();
     }
 
 
@@ -182,20 +187,23 @@ public class HPCPullMonitor extends PullMonitor {
                             String cancelMId = iterator1.next();
                             if (cancelMId.equals(iMonitorID.getExperimentID() + "+" + iMonitorID.getTaskID())) {
                                 iMonitorID.setStatus(JobState.CANCELED);
-                                CommonUtils.removeMonitorFromQueue(take, iMonitorID);
+//                                CommonUtils.removeMonitorFromQueue(take, iMonitorID);
+                                removeList.add(iMonitorID);
                                 logger.debugId(cancelMId, "Found a match in cancel monitor queue, hence moved to the " +
                                                 "completed job queue, experiment {}, task {} , job {}",
                                         iMonitorID.getExperimentID(), iMonitorID.getTaskID(), iMonitorID.getJobID());
                                 logger.info("Job cancelled: marking the Job as ************CANCELLED************ experiment {}, task {}, job name {} .",
                                         iMonitorID.getExperimentID(), iMonitorID.getTaskID(), iMonitorID.getJobName());
                                 sendNotification(iMonitorID);
-                                monitorIDListIterator.remove();
                                 GFacThreadPoolExecutor.getFixedThreadPool().submit(new OutHandlerWorker(gfac, iMonitorID, publisher));
                                 break;
                             }
                         }
                         iterator1 = cancelJobList.iterator();
                     }
+
+                    cleanup(take);
+
                     synchronized (completedJobsFromPush) {
                         for (ListIterator<String> iterator = completedJobsFromPush.listIterator(); iterator.hasNext(); ) {
                             String completeId = iterator.next();
@@ -204,14 +212,14 @@ public class HPCPullMonitor extends PullMonitor {
                                 if (completeId.equals(iMonitorID.getUserName() + "," + iMonitorID.getJobName())) {
                                     logger.info("This job is finished because push notification came with <username,jobName> " + completeId);
                                     iMonitorID.setStatus(JobState.COMPLETE);
-                                    CommonUtils.removeMonitorFromQueue(take, iMonitorID);//we have to make this empty everytime we iterate, otherwise this list will accumulate and will lead to a memory leak
+//                                    CommonUtils.removeMonitorFromQueue(take, iMonitorID);//we have to make this empty everytime we iterate, otherwise this list will accumulate and will lead to a memory leak
+                                    removeList.add(iMonitorID);
                                     logger.debugId(completeId, "Push notification updated job {} status to {}. " +
                                                     "experiment {} , task {}.", iMonitorID.getJobID(), JobState.COMPLETE.toString(),
                                             iMonitorID.getExperimentID(), iMonitorID.getTaskID());
                                     logger.info("AMQP message recieved: marking the Job as ************COMPLETE************ experiment {}, task {}, job name {} .",
                                             iMonitorID.getExperimentID(), iMonitorID.getTaskID(), iMonitorID.getJobName());
 
-                                    iterator.remove();
                                     sendNotification(iMonitorID);
                                     GFacThreadPoolExecutor.getFixedThreadPool().submit(new OutHandlerWorker(gfac, iMonitorID, publisher));
                                     break;
@@ -220,6 +228,8 @@ public class HPCPullMonitor extends PullMonitor {
                         }
                     }
 
+                    cleanup(take);
+
                     // we have to get this again because we removed the already completed jobs with amqp messages
                     monitorID = iHostMonitorData.getMonitorIDs();
                     Map<String, JobState> jobStatuses = connection.getJobStatuses(monitorID);
@@ -232,7 +242,8 @@ public class HPCPullMonitor extends PullMonitor {
                         } else if (JobState.COMPLETE.equals(iMonitorID.getStatus())) {
                             logger.debugId(iMonitorID.getJobID(), "Moved job {} to completed jobs map, experiment {}, " +
                                     "task {}", iMonitorID.getJobID(), iMonitorID.getExperimentID(), iMonitorID.getTaskID());
-                            CommonUtils.removeMonitorFromQueue(take, iMonitorID);
+//                            CommonUtils.removeMonitorFromQueue(take, iMonitorID);
+                            removeList.add(iMonitorID);
                             logger.info("PULL Notification is complete: marking the Job as ************COMPLETE************ experiment {}, task {}, job name {} .",
                                     iMonitorID.getExperimentID(), iMonitorID.getTaskID(), iMonitorID.getJobName());
                             GFacThreadPoolExecutor.getFixedThreadPool().submit(new OutHandlerWorker(gfac, iMonitorID, publisher));
@@ -244,6 +255,9 @@ public class HPCPullMonitor extends PullMonitor {
                         iMonitorID.setLastMonitored(new Timestamp((new Date()).getTime()));
                     }
 
+                    cleanup(take);
+
+
                     for (Iterator<MonitorID> iterator = monitorID.listIterator(); iterator.hasNext(); ) {
                         MonitorID iMonitorID = iterator.next();
                         if (iMonitorID.getFailedCount() > FAILED_COUNT) {
@@ -268,7 +282,8 @@ public class HPCPullMonitor extends PullMonitor {
                                 logger.info("Listing directory came as complete: marking the Job as ************COMPLETE************ experiment {}, task {}, job name {} .",
                                         iMonitorID.getExperimentID(), iMonitorID.getTaskID(), iMonitorID.getJobName());
                                 sendNotification(iMonitorID);
-                                CommonUtils.removeMonitorFromQueue(take, iMonitorID);
+//                                CommonUtils.removeMonitorFromQueue(take, iMonitorID);
+                                removeList.add(iMonitorID);
                                 GFacThreadPoolExecutor.getFixedThreadPool().submit(new OutHandlerWorker(gfac, iMonitorID, publisher));
                             } else {
                                 iMonitorID.setFailedCount(0);
@@ -281,6 +296,8 @@ public class HPCPullMonitor extends PullMonitor {
                         }
                     }
 
+                    cleanup(take);
+
 
                 } else {
                     logger.debug("Qstat Monitor doesn't handle non-gsissh hosts , host {}", iHostMonitorData.
@@ -434,4 +451,17 @@ public class HPCPullMonitor extends PullMonitor {
     public void setCancelJobList(LinkedBlockingQueue<String> cancelJobList) {
         this.cancelJobList = cancelJobList;
     }
+
+
+    private void cleanup(UserMonitorData userMonitorData){
+        for(MonitorID iMonitorId:removeList){
+            try {
+                CommonUtils.removeMonitorFromQueue(userMonitorData, iMonitorId);
+            } catch (AiravataMonitorException e) {
+                logger.error(e.getMessage(), e);
+                logger.error("Error deleting the monitor data: " + iMonitorId.getJobID());
+            }
+        }
+        removeList.clear();
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
index 135349f..cbac726 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
@@ -157,6 +157,7 @@ public class CommonUtils {
         logger.info("This might not be an error because someone else removed this job from the queue");
     }
 
+
     public static void invokeOutFlowHandlers(JobExecutionContext jobExecutionContext) throws GFacException {
         List<GFacHandlerConfig> handlers = jobExecutionContext.getGFacConfiguration().getOutHandlers();
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/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 683985f..a416dbd 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
@@ -21,6 +21,7 @@
 package org.apache.airavata.gfac.ssh.security;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.IOUtil;
 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;
@@ -148,7 +149,7 @@ public class TokenizedSSHAuthInfo implements SSHPublicKeyFileAuthentication {
      * @throws org.apache.airavata.gfac.GFacException                            If an error occurred while retrieving credentials.
      * @throws org.apache.airavata.common.exception.ApplicationSettingsException
      */
-    public SSHCredential getDefaultCredentials() throws GFacException, ApplicationSettingsException {
+    public SSHCredential getDefaultCredentials() throws GFacException, ApplicationSettingsException, IOException {
         Properties configurationProperties = ServerSettings.getProperties();
         String sshUserName = configurationProperties.getProperty(Constants.SSH_USER_NAME);
         this.getRequestData().setRequestUser(sshUserName);
@@ -156,7 +157,7 @@ public class TokenizedSSHAuthInfo implements SSHPublicKeyFileAuthentication {
         this.publicKeyFile = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
         this.passPhrase = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS);
         this.getRequestData().setRequestUser(sshUserName);
-        return new SSHCredential(null, null, null, requestData.getGatewayId(), sshUserName);
+        return new SSHCredential(IOUtil.readToByteArray(new File(this.privateKeyFile)), IOUtil.readToByteArray(new File(this.publicKeyFile)), this.passPhrase, requestData.getGatewayId(), sshUserName);
     }
 
     public CredentialReader getCredentialReader() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
index 0ca7546..7a2fce3 100644
--- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
+++ b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
@@ -27,16 +27,17 @@ import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
 import org.apache.airavata.gsi.ssh.config.ConfigReader;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyAuthentication;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.util.CommonUtils;
+import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 
-import java.io.File;
-import java.io.IOException;
+import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -49,11 +50,14 @@ public class DefaultSSHApiTestWithMyProxyAuth {
     }
 
 
-    public static void main(String[]ars){
+    public static void main(String[]ars) throws IOException {
          String myProxyUserName = "lg11w";
 
-        DefaultPasswordAuthenticationInfo authenticationInfo
-                = new DefaultPasswordAuthenticationInfo("");
+//        DefaultPasswordAuthenticationInfo authenticationInfo
+//                = new DefaultPasswordAuthenticationInfo("");
+        byte[] privateKey = IOUtils.toByteArray(new BufferedInputStream(new FileInputStream("/Users/lginnali/.ssh/id_dsa")));
+        byte[] publicKey = IOUtils.toByteArray(new BufferedInputStream(new FileInputStream("/Users/lginnali/.ssh/id_dsa.pub")));
+        DefaultPublicKeyAuthentication authenticationInfo = new DefaultPublicKeyAuthentication(privateKey,publicKey,"");
 
         // Create command
         CommandInfo commandInfo = new RawCommandInfo("source /etc/bashrc; bsub </home/lg11w/mywork/sshEchoExperiment_9d267072-ca65-4ca8-847a-cd3d130f6050/366787899.lsf");

http://git-wip-us.apache.org/repos/asf/airavata/blob/fcbda21f/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java
index 8d70a21..186aca6 100644
--- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java
+++ b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java
@@ -75,8 +75,8 @@ public class VanilaTestWithSSHAuth {
         
         System.setProperty("ssh.host",hostName);
         System.setProperty("ssh.username", userName);
-        System.setProperty("private.ssh.key", "/home/user/.ssh/id_dsa");
-        System.setProperty("public.ssh.key", "/home/user/.ssh/id_dsa.pub");
+        System.setProperty("private.ssh.key", "/home/lginnali/.ssh/id_dsa");
+        System.setProperty("public.ssh.key", "/home/lginnali/.ssh/id_dsa.pub");
         System.setProperty("ssh.working.directory", "/tmp");
 
         this.hostName = System.getProperty("ssh.host");


[41/62] [abbrv] airavata git commit: fixing compilation isssue, bug in getAvailableAppInterfaceComputeResources(), fixing AIRAVATA-1226, AIRAVATA-1626

Posted by la...@apache.org.
fixing compilation isssue, bug in getAvailableAppInterfaceComputeResources(), fixing AIRAVATA-1226, AIRAVATA-1626


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/56efa8e5
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/56efa8e5
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/56efa8e5

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 56efa8e5e7b1bdbc69a8238968ca305c2d8f5ad0
Parents: 7ef8800
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Tue Mar 10 13:30:28 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Tue Mar 10 13:30:28 2015 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |   30 +-
 .../java/org/apache/airavata/api/Airavata.java  | 5264 +++++++++++-------
 .../main/resources/lib/airavata/Airavata.cpp    |  381 ++
 .../src/main/resources/lib/airavata/Airavata.h  |  161 +
 .../lib/airavata/Airavata_server.skeleton.cpp   |    5 +
 .../resources/lib/Airavata/API/Airavata.php     |  296 +
 .../client/samples/CreateLaunchExperiment.java  |   31 +-
 .../computeresource/AuthenticationMode.java     |   70 +
 .../airavataAPI.thrift                          |    6 +
 9 files changed, 4246 insertions(+), 1998 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index c111a07..f250f37 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -337,9 +337,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             return (Project)registry.get(RegistryModelType.PROJECT, projectId);
         } catch (RegistryException e) {
-            logger.error("Error while updating the project", e);
+            logger.error("Error while retrieving the project", e);
             ProjectNotFoundException exception = new ProjectNotFoundException();
-            exception.setMessage("Error while updating the project. More info : " + e.getMessage());
+            exception.setMessage("Error while retrieving the project. More info : " + e.getMessage());
             throw exception;
         }
     }
@@ -1868,8 +1868,10 @@ public class AiravataServerHandler implements Airavata.Iface {
                     List<ApplicationDeploymentDescription> applicationDeployments =
                             applicationDeployment.getApplicationDeployements(filters);
                     for (ApplicationDeploymentDescription deploymentDescription : applicationDeployments) {
-                        availableComputeResources.put(deploymentDescription.getComputeHostId(),
-                                allComputeResources.get(deploymentDescription.getComputeHostId()));
+                        if (allComputeResources.get(deploymentDescription.getComputeHostId()) != null){
+                            availableComputeResources.put(deploymentDescription.getComputeHostId(),
+                                    allComputeResources.get(deploymentDescription.getComputeHostId()));
+                        }
                     }
                 }
             }
@@ -3096,4 +3098,24 @@ public class AiravataServerHandler implements Airavata.Iface {
 		return workflowCatalog;
 	}
 
+    @Override
+    public boolean deleteProject(String projectId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, ProjectNotFoundException, TException {
+        try {
+            registry = RegistryFactory.getDefaultRegistry();
+            if (!registry.isExist(RegistryModelType.PROJECT, projectId)){
+                logger.error("Project does not exist in the system. Please provide a valid project ID...");
+                ProjectNotFoundException exception = new ProjectNotFoundException();
+                exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
+                throw exception;
+            }
+            registry.remove(RegistryModelType.PROJECT, projectId);
+            return true;
+        } catch (RegistryException e) {
+            logger.error("Error while removing the project", e);
+            ProjectNotFoundException exception = new ProjectNotFoundException();
+            exception.setMessage("Error while removing the project. More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
 }


[24/62] [abbrv] airavata git commit: adding chessis number to database and test issue in CS

Posted by la...@apache.org.
adding chessis number to database and test issue in CS


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: ac574c942c91a76bd0d9fccfc9350dfcd29f9cb0
Parents: 7c10349
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 6 10:43:09 2015 -0500
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 6 10:43:09 2015 -0500

----------------------------------------------------------------------
 .../store/store/impl/db/CommunityUserDAOTest.java         |  4 ++--
 .../jpa/model/Computational_Resource_Scheduling.java      | 10 ++++++++++
 .../jpa/resources/ComputationSchedulingResource.java      | 10 ++++++++++
 .../persistance/registry/jpa/resources/Utils.java         |  1 +
 .../registry/jpa/utils/ThriftDataModelConversion.java     |  1 +
 .../src/main/resources/registry-derby.sql                 |  1 +
 .../src/main/resources/registry-mysql.sql                 |  1 +
 .../src/test/resources/registry-derby.sql                 |  1 +
 8 files changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
index 8ed8a6a..787cc54 100644
--- a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
@@ -45,11 +45,11 @@ public class CommunityUserDAOTest extends DatabaseTestCases {
         waitTillServerStarts();
 
         String createTable = "CREATE TABLE COMMUNITY_USER\n" + "                (\n"
-                + "                        GATEWAY_NAME VARCHAR(256) NOT NULL,\n"
+                + "                        GATEWAY_ID VARCHAR(256) NOT NULL,\n"
                 + "                        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,\n"
                 + "                        TOKEN_ID VARCHAR(256) NOT NULL,\n"
                 + "                        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,\n"
-                + "                        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)\n"
+                + "                        PRIMARY KEY (GATEWAY_ID, COMMUNITY_USER_NAME, TOKEN_ID)\n"
                 + "                )";
 
         String dropTable = "drop table COMMUNITY_USER";

http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
index 01c0bca..e440510 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Computational_Resource_Scheduling.java
@@ -57,6 +57,8 @@ public class Computational_Resource_Scheduling implements Serializable {
     private int totalPhysicalmemory;
     @Column(name = "COMPUTATIONAL_PROJECT_ACCOUNT")
     private String projectName;
+    @Column(name = "CHESSIS_NAME")
+    private String chessisName;
 
     @ManyToOne(cascade= CascadeType.MERGE)
     @JoinColumn(name = "EXPERIMENT_ID")
@@ -66,6 +68,14 @@ public class Computational_Resource_Scheduling implements Serializable {
     @JoinColumn(name = "TASK_ID")
     private TaskDetail task;
 
+    public String getChessisName() {
+        return chessisName;
+    }
+
+    public void setChessisName(String chessisName) {
+        this.chessisName = chessisName;
+    }
+
     public int getSchedulingId() {
         return schedulingId;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
index dae5dd3..7c0327f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
@@ -49,6 +49,15 @@ public class ComputationSchedulingResource extends AbstractResource {
     private Timestamp jobStartTime;
     private int physicalMemory;
     private String projectName;
+    private String chessisName;
+
+    public String getChessisName() {
+        return chessisName;
+    }
+
+    public void setChessisName(String chessisName) {
+        this.chessisName = chessisName;
+    }
 
     public int getSchedulingId() {
         return schedulingId;
@@ -200,6 +209,7 @@ public class ComputationSchedulingResource extends AbstractResource {
             scheduling.setJobStartTime(jobStartTime);
             scheduling.setTotalPhysicalmemory(physicalMemory);
             scheduling.setProjectName(projectName);
+            scheduling.setChessisName(chessisName);
             em.persist(scheduling);
             schedulingId = scheduling.getSchedulingId();
             em.getTransaction().commit();

http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
index 9add15b..7c4850a 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
@@ -746,6 +746,7 @@ public class Utils {
             schedulingResource.setJobStartTime(o.getJobStartTime());
             schedulingResource.setPhysicalMemory(o.getTotalPhysicalmemory());
             schedulingResource.setProjectName(o.getProjectName());
+            schedulingResource.setChessisName(o.getChessisName());
         }
 
         return schedulingResource;

http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
index 7aec17e..95c0e29 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
@@ -664,6 +664,7 @@ public class ThriftDataModelConversion {
             scheduling.setJobStartTime((int)csr.getJobStartTime().getTime());
             scheduling.setTotalPhysicalMemory(csr.getPhysicalMemory());
             scheduling.setComputationalProjectAccount(csr.getProjectName());
+            scheduling.setChassisName(csr.getChessisName());
             return scheduling;
         }
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
index b7c8a7d..2fd1283 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
@@ -318,6 +318,7 @@ CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
         JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
         TOTAL_PHYSICAL_MEMORY INTEGER,
         COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
+        CHESSIS_NAME VARCHAR(255),
         PRIMARY KEY(RESOURCE_SCHEDULING_ID),
         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
         FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE

http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
index 442a47b..750067b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
@@ -319,6 +319,7 @@ CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
         JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
         TOTAL_PHYSICAL_MEMORY INTEGER,
         COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
+        CHESSIS_NAME VARCHAR(255),
         PRIMARY KEY(RESOURCE_SCHEDULING_ID),
         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
         FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE

http://git-wip-us.apache.org/repos/asf/airavata/blob/ac574c94/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
index b7c8a7d..2fd1283 100644
--- a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
@@ -318,6 +318,7 @@ CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
         JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
         TOTAL_PHYSICAL_MEMORY INTEGER,
         COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
+        CHESSIS_NAME VARCHAR(255),
         PRIMARY KEY(RESOURCE_SCHEDULING_ID),
         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
         FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE


[23/62] [abbrv] airavata git commit: adding chassisName for compute resource scheduling

Posted by la...@apache.org.
adding chassisName for compute resource scheduling


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/7c103499
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/7c103499
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/7c103499

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 7c10349962bdce8c06f6905f226da488017c4930
Parents: 9d960f7
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 6 10:23:07 2015 -0500
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 6 10:23:07 2015 -0500

----------------------------------------------------------------------
 .../lib/airavata/experimentModel_types.cpp      |  34 ++++--
 .../lib/airavata/experimentModel_types.h        |  35 ++++--
 .../Model/Workspace/Experiment/Types.php        |  20 ++++
 .../ComputationalResourceScheduling.java        | 109 ++++++++++++++++++-
 .../experimentModel.thrift                      |   3 +-
 5 files changed, 174 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/7c103499/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
index d6e6b07..2f1d21b 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
@@ -719,8 +719,8 @@ void swap(ApplicationStatus &a, ApplicationStatus &b) {
   swap(a.__isset, b.__isset);
 }
 
-const char* ComputationalResourceScheduling::ascii_fingerprint = "32AC7AC41AD3753A7224A32FD6EB4B5D";
-const uint8_t ComputationalResourceScheduling::binary_fingerprint[16] = {0x32,0xAC,0x7A,0xC4,0x1A,0xD3,0x75,0x3A,0x72,0x24,0xA3,0x2F,0xD6,0xEB,0x4B,0x5D};
+const char* ComputationalResourceScheduling::ascii_fingerprint = "F43E914A611D39345BCC729678C1C696";
+const uint8_t ComputationalResourceScheduling::binary_fingerprint[16] = {0xF4,0x3E,0x91,0x4A,0x61,0x1D,0x39,0x34,0x5B,0xCC,0x72,0x96,0x78,0xC1,0xC6,0x96};
 
 uint32_t ComputationalResourceScheduling::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -814,6 +814,14 @@ uint32_t ComputationalResourceScheduling::read(::apache::thrift::protocol::TProt
           xfer += iprot->skip(ftype);
         }
         break;
+      case 10:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->chassisName);
+          this->__isset.chassisName = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -875,6 +883,11 @@ uint32_t ComputationalResourceScheduling::write(::apache::thrift::protocol::TPro
     xfer += oprot->writeString(this->computationalProjectAccount);
     xfer += oprot->writeFieldEnd();
   }
+  if (this->__isset.chassisName) {
+    xfer += oprot->writeFieldBegin("chassisName", ::apache::thrift::protocol::T_STRING, 10);
+    xfer += oprot->writeString(this->chassisName);
+    xfer += oprot->writeFieldEnd();
+  }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
   return xfer;
@@ -891,6 +904,7 @@ void swap(ComputationalResourceScheduling &a, ComputationalResourceScheduling &b
   swap(a.jobStartTime, b.jobStartTime);
   swap(a.totalPhysicalMemory, b.totalPhysicalMemory);
   swap(a.computationalProjectAccount, b.computationalProjectAccount);
+  swap(a.chassisName, b.chassisName);
   swap(a.__isset, b.__isset);
 }
 
@@ -1181,8 +1195,8 @@ void swap(QualityOfServiceParams &a, QualityOfServiceParams &b) {
   swap(a.__isset, b.__isset);
 }
 
-const char* UserConfigurationData::ascii_fingerprint = "4E5EF84AE34A2F52BCD6617A229780E0";
-const uint8_t UserConfigurationData::binary_fingerprint[16] = {0x4E,0x5E,0xF8,0x4A,0xE3,0x4A,0x2F,0x52,0xBC,0xD6,0x61,0x7A,0x22,0x97,0x80,0xE0};
+const char* UserConfigurationData::ascii_fingerprint = "A39B8E6345C677771D939D170C65720F";
+const uint8_t UserConfigurationData::binary_fingerprint[16] = {0xA3,0x9B,0x8E,0x63,0x45,0xC6,0x77,0x77,0x1D,0x93,0x9D,0x17,0x0C,0x65,0x72,0x0F};
 
 uint32_t UserConfigurationData::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -1843,8 +1857,8 @@ void swap(DataTransferDetails &a, DataTransferDetails &b) {
   swap(a.__isset, b.__isset);
 }
 
-const char* TaskDetails::ascii_fingerprint = "6EAEEB62655ECD5CA7A24BFDE46F678C";
-const uint8_t TaskDetails::binary_fingerprint[16] = {0x6E,0xAE,0xEB,0x62,0x65,0x5E,0xCD,0x5C,0xA7,0xA2,0x4B,0xFD,0xE4,0x6F,0x67,0x8C};
+const char* TaskDetails::ascii_fingerprint = "88276CFCC9B30CA0B93A5931F93CACC4";
+const uint8_t TaskDetails::binary_fingerprint[16] = {0x88,0x27,0x6C,0xFC,0xC9,0xB3,0x0C,0xA0,0xB9,0x3A,0x59,0x31,0xF9,0x3C,0xAC,0xC4};
 
 uint32_t TaskDetails::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -2238,8 +2252,8 @@ void swap(TaskDetails &a, TaskDetails &b) {
   swap(a.__isset, b.__isset);
 }
 
-const char* WorkflowNodeDetails::ascii_fingerprint = "CDDA44A784FD60829B4F4EAA67D71C72";
-const uint8_t WorkflowNodeDetails::binary_fingerprint[16] = {0xCD,0xDA,0x44,0xA7,0x84,0xFD,0x60,0x82,0x9B,0x4F,0x4E,0xAA,0x67,0xD7,0x1C,0x72};
+const char* WorkflowNodeDetails::ascii_fingerprint = "940AB958A2909A83261C2016BD466838";
+const uint8_t WorkflowNodeDetails::binary_fingerprint[16] = {0x94,0x0A,0xB9,0x58,0xA2,0x90,0x9A,0x83,0x26,0x1C,0x20,0x16,0xBD,0x46,0x68,0x38};
 
 uint32_t WorkflowNodeDetails::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -2694,8 +2708,8 @@ void swap(ValidationResults &a, ValidationResults &b) {
   swap(a.validationResultList, b.validationResultList);
 }
 
-const char* Experiment::ascii_fingerprint = "145D3134FA7C46D3D99051850C4984FF";
-const uint8_t Experiment::binary_fingerprint[16] = {0x14,0x5D,0x31,0x34,0xFA,0x7C,0x46,0xD3,0xD9,0x90,0x51,0x85,0x0C,0x49,0x84,0xFF};
+const char* Experiment::ascii_fingerprint = "C610216A34DE0B4389362B3D5236F6F6";
+const uint8_t Experiment::binary_fingerprint[16] = {0xC6,0x10,0x21,0x6A,0x34,0xDE,0x0B,0x43,0x89,0x36,0x2B,0x3D,0x52,0x36,0xF6,0xF6};
 
 uint32_t Experiment::read(::apache::thrift::protocol::TProtocol* iprot) {
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/7c103499/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
index 1b5306e..15c0d4c 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
@@ -495,7 +495,7 @@ class ApplicationStatus {
 void swap(ApplicationStatus &a, ApplicationStatus &b);
 
 typedef struct _ComputationalResourceScheduling__isset {
-  _ComputationalResourceScheduling__isset() : resourceHostId(false), totalCPUCount(false), nodeCount(false), numberOfThreads(false), queueName(false), wallTimeLimit(false), jobStartTime(false), totalPhysicalMemory(false), computationalProjectAccount(false) {}
+  _ComputationalResourceScheduling__isset() : resourceHostId(false), totalCPUCount(false), nodeCount(false), numberOfThreads(false), queueName(false), wallTimeLimit(false), jobStartTime(false), totalPhysicalMemory(false), computationalProjectAccount(false), chassisName(false) {}
   bool resourceHostId;
   bool totalCPUCount;
   bool nodeCount;
@@ -505,15 +505,16 @@ typedef struct _ComputationalResourceScheduling__isset {
   bool jobStartTime;
   bool totalPhysicalMemory;
   bool computationalProjectAccount;
+  bool chassisName;
 } _ComputationalResourceScheduling__isset;
 
 class ComputationalResourceScheduling {
  public:
 
-  static const char* ascii_fingerprint; // = "32AC7AC41AD3753A7224A32FD6EB4B5D";
-  static const uint8_t binary_fingerprint[16]; // = {0x32,0xAC,0x7A,0xC4,0x1A,0xD3,0x75,0x3A,0x72,0x24,0xA3,0x2F,0xD6,0xEB,0x4B,0x5D};
+  static const char* ascii_fingerprint; // = "F43E914A611D39345BCC729678C1C696";
+  static const uint8_t binary_fingerprint[16]; // = {0xF4,0x3E,0x91,0x4A,0x61,0x1D,0x39,0x34,0x5B,0xCC,0x72,0x96,0x78,0xC1,0xC6,0x96};
 
-  ComputationalResourceScheduling() : resourceHostId(), totalCPUCount(0), nodeCount(0), numberOfThreads(0), queueName(), wallTimeLimit(0), jobStartTime(0), totalPhysicalMemory(0), computationalProjectAccount() {
+  ComputationalResourceScheduling() : resourceHostId(), totalCPUCount(0), nodeCount(0), numberOfThreads(0), queueName(), wallTimeLimit(0), jobStartTime(0), totalPhysicalMemory(0), computationalProjectAccount(), chassisName() {
   }
 
   virtual ~ComputationalResourceScheduling() throw() {}
@@ -527,6 +528,7 @@ class ComputationalResourceScheduling {
   int32_t jobStartTime;
   int32_t totalPhysicalMemory;
   std::string computationalProjectAccount;
+  std::string chassisName;
 
   _ComputationalResourceScheduling__isset __isset;
 
@@ -575,6 +577,11 @@ class ComputationalResourceScheduling {
     __isset.computationalProjectAccount = true;
   }
 
+  void __set_chassisName(const std::string& val) {
+    chassisName = val;
+    __isset.chassisName = true;
+  }
+
   bool operator == (const ComputationalResourceScheduling & rhs) const
   {
     if (__isset.resourceHostId != rhs.__isset.resourceHostId)
@@ -613,6 +620,10 @@ class ComputationalResourceScheduling {
       return false;
     else if (__isset.computationalProjectAccount && !(computationalProjectAccount == rhs.computationalProjectAccount))
       return false;
+    if (__isset.chassisName != rhs.__isset.chassisName)
+      return false;
+    else if (__isset.chassisName && !(chassisName == rhs.chassisName))
+      return false;
     return true;
   }
   bool operator != (const ComputationalResourceScheduling &rhs) const {
@@ -856,8 +867,8 @@ typedef struct _UserConfigurationData__isset {
 class UserConfigurationData {
  public:
 
-  static const char* ascii_fingerprint; // = "4E5EF84AE34A2F52BCD6617A229780E0";
-  static const uint8_t binary_fingerprint[16]; // = {0x4E,0x5E,0xF8,0x4A,0xE3,0x4A,0x2F,0x52,0xBC,0xD6,0x61,0x7A,0x22,0x97,0x80,0xE0};
+  static const char* ascii_fingerprint; // = "A39B8E6345C677771D939D170C65720F";
+  static const uint8_t binary_fingerprint[16]; // = {0xA3,0x9B,0x8E,0x63,0x45,0xC6,0x77,0x77,0x1D,0x93,0x9D,0x17,0x0C,0x65,0x72,0x0F};
 
   UserConfigurationData() : airavataAutoSchedule(false), overrideManualScheduledParams(false), shareExperimentPublicly(false), throttleResources(false) {
   }
@@ -1296,8 +1307,8 @@ typedef struct _TaskDetails__isset {
 class TaskDetails {
  public:
 
-  static const char* ascii_fingerprint; // = "6EAEEB62655ECD5CA7A24BFDE46F678C";
-  static const uint8_t binary_fingerprint[16]; // = {0x6E,0xAE,0xEB,0x62,0x65,0x5E,0xCD,0x5C,0xA7,0xA2,0x4B,0xFD,0xE4,0x6F,0x67,0x8C};
+  static const char* ascii_fingerprint; // = "88276CFCC9B30CA0B93A5931F93CACC4";
+  static const uint8_t binary_fingerprint[16]; // = {0x88,0x27,0x6C,0xFC,0xC9,0xB3,0x0C,0xA0,0xB9,0x3A,0x59,0x31,0xF9,0x3C,0xAC,0xC4};
 
   TaskDetails() : taskID("DO_NOT_SET_AT_CLIENTS"), creationTime(0), applicationId(), applicationVersion(), applicationDeploymentId(), enableEmailNotification(0) {
   }
@@ -1495,8 +1506,8 @@ typedef struct _WorkflowNodeDetails__isset {
 class WorkflowNodeDetails {
  public:
 
-  static const char* ascii_fingerprint; // = "CDDA44A784FD60829B4F4EAA67D71C72";
-  static const uint8_t binary_fingerprint[16]; // = {0xCD,0xDA,0x44,0xA7,0x84,0xFD,0x60,0x82,0x9B,0x4F,0x4E,0xAA,0x67,0xD7,0x1C,0x72};
+  static const char* ascii_fingerprint; // = "940AB958A2909A83261C2016BD466838";
+  static const uint8_t binary_fingerprint[16]; // = {0x94,0x0A,0xB9,0x58,0xA2,0x90,0x9A,0x83,0x26,0x1C,0x20,0x16,0xBD,0x46,0x68,0x38};
 
   WorkflowNodeDetails() : nodeInstanceId("DO_NOT_SET_AT_CLIENTS"), creationTime(0), nodeName("SINGLE_APP_NODE"), executionUnit((ExecutionUnit::type)1), executionUnitData() {
     executionUnit = (ExecutionUnit::type)1;
@@ -1736,8 +1747,8 @@ typedef struct _Experiment__isset {
 class Experiment {
  public:
 
-  static const char* ascii_fingerprint; // = "145D3134FA7C46D3D99051850C4984FF";
-  static const uint8_t binary_fingerprint[16]; // = {0x14,0x5D,0x31,0x34,0xFA,0x7C,0x46,0xD3,0xD9,0x90,0x51,0x85,0x0C,0x49,0x84,0xFF};
+  static const char* ascii_fingerprint; // = "C610216A34DE0B4389362B3D5236F6F6";
+  static const uint8_t binary_fingerprint[16]; // = {0xC6,0x10,0x21,0x6A,0x34,0xDE,0x0B,0x43,0x89,0x36,0x2B,0x3D,0x52,0x36,0xF6,0xF6};
 
   Experiment() : experimentID("DO_NOT_SET_AT_CLIENTS"), projectID("DEFAULT"), creationTime(0), userName(), name(), description(), applicationId(), applicationVersion(), workflowTemplateId(), workflowTemplateVersion(), enableEmailNotification(0), workflowExecutionInstanceId() {
   }

http://git-wip-us.apache.org/repos/asf/airavata/blob/7c103499/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
index 1fbcd0b..ea7aa19 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
@@ -780,6 +780,7 @@ class ComputationalResourceScheduling {
   public $jobStartTime = null;
   public $totalPhysicalMemory = null;
   public $computationalProjectAccount = null;
+  public $chassisName = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -820,6 +821,10 @@ class ComputationalResourceScheduling {
           'var' => 'computationalProjectAccount',
           'type' => TType::STRING,
           ),
+        10 => array(
+          'var' => 'chassisName',
+          'type' => TType::STRING,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -850,6 +855,9 @@ class ComputationalResourceScheduling {
       if (isset($vals['computationalProjectAccount'])) {
         $this->computationalProjectAccount = $vals['computationalProjectAccount'];
       }
+      if (isset($vals['chassisName'])) {
+        $this->chassisName = $vals['chassisName'];
+      }
     }
   }
 
@@ -935,6 +943,13 @@ class ComputationalResourceScheduling {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 10:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->chassisName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -993,6 +1008,11 @@ class ComputationalResourceScheduling {
       $xfer += $output->writeString($this->computationalProjectAccount);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->chassisName !== null) {
+      $xfer += $output->writeFieldBegin('chassisName', TType::STRING, 10);
+      $xfer += $output->writeString($this->chassisName);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata/blob/7c103499/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ComputationalResourceScheduling.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ComputationalResourceScheduling.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ComputationalResourceScheduling.java
index fb6e0f6..51ef625 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ComputationalResourceScheduling.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ComputationalResourceScheduling.java
@@ -65,6 +65,7 @@ import org.slf4j.LoggerFactory;
   private static final org.apache.thrift.protocol.TField JOB_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("jobStartTime", org.apache.thrift.protocol.TType.I32, (short)7);
   private static final org.apache.thrift.protocol.TField TOTAL_PHYSICAL_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("totalPhysicalMemory", org.apache.thrift.protocol.TType.I32, (short)8);
   private static final org.apache.thrift.protocol.TField COMPUTATIONAL_PROJECT_ACCOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("computationalProjectAccount", org.apache.thrift.protocol.TType.STRING, (short)9);
+  private static final org.apache.thrift.protocol.TField CHASSIS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("chassisName", org.apache.thrift.protocol.TType.STRING, (short)10);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -81,6 +82,7 @@ import org.slf4j.LoggerFactory;
   private int jobStartTime; // optional
   private int totalPhysicalMemory; // optional
   private String computationalProjectAccount; // optional
+  private String chassisName; // optional
 
   /** 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 {
@@ -92,7 +94,8 @@ import org.slf4j.LoggerFactory;
     WALL_TIME_LIMIT((short)6, "wallTimeLimit"),
     JOB_START_TIME((short)7, "jobStartTime"),
     TOTAL_PHYSICAL_MEMORY((short)8, "totalPhysicalMemory"),
-    COMPUTATIONAL_PROJECT_ACCOUNT((short)9, "computationalProjectAccount");
+    COMPUTATIONAL_PROJECT_ACCOUNT((short)9, "computationalProjectAccount"),
+    CHASSIS_NAME((short)10, "chassisName");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -125,6 +128,8 @@ import org.slf4j.LoggerFactory;
           return TOTAL_PHYSICAL_MEMORY;
         case 9: // COMPUTATIONAL_PROJECT_ACCOUNT
           return COMPUTATIONAL_PROJECT_ACCOUNT;
+        case 10: // CHASSIS_NAME
+          return CHASSIS_NAME;
         default:
           return null;
       }
@@ -172,7 +177,7 @@ import org.slf4j.LoggerFactory;
   private static final int __JOBSTARTTIME_ISSET_ID = 4;
   private static final int __TOTALPHYSICALMEMORY_ISSET_ID = 5;
   private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.RESOURCE_HOST_ID,_Fields.TOTAL_CPUCOUNT,_Fields.NODE_COUNT,_Fields.NUMBER_OF_THREADS,_Fields.QUEUE_NAME,_Fields.WALL_TIME_LIMIT,_Fields.JOB_START_TIME,_Fields.TOTAL_PHYSICAL_MEMORY,_Fields.COMPUTATIONAL_PROJECT_ACCOUNT};
+  private _Fields optionals[] = {_Fields.RESOURCE_HOST_ID,_Fields.TOTAL_CPUCOUNT,_Fields.NODE_COUNT,_Fields.NUMBER_OF_THREADS,_Fields.QUEUE_NAME,_Fields.WALL_TIME_LIMIT,_Fields.JOB_START_TIME,_Fields.TOTAL_PHYSICAL_MEMORY,_Fields.COMPUTATIONAL_PROJECT_ACCOUNT,_Fields.CHASSIS_NAME};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -194,6 +199,8 @@ import org.slf4j.LoggerFactory;
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.COMPUTATIONAL_PROJECT_ACCOUNT, new org.apache.thrift.meta_data.FieldMetaData("computationalProjectAccount", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.CHASSIS_NAME, new org.apache.thrift.meta_data.FieldMetaData("chassisName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComputationalResourceScheduling.class, metaDataMap);
   }
@@ -221,6 +228,9 @@ import org.slf4j.LoggerFactory;
     if (other.isSetComputationalProjectAccount()) {
       this.computationalProjectAccount = other.computationalProjectAccount;
     }
+    if (other.isSetChassisName()) {
+      this.chassisName = other.chassisName;
+    }
   }
 
   public ComputationalResourceScheduling deepCopy() {
@@ -244,6 +254,7 @@ import org.slf4j.LoggerFactory;
     setTotalPhysicalMemoryIsSet(false);
     this.totalPhysicalMemory = 0;
     this.computationalProjectAccount = null;
+    this.chassisName = null;
   }
 
   public String getResourceHostId() {
@@ -447,6 +458,29 @@ import org.slf4j.LoggerFactory;
     }
   }
 
+  public String getChassisName() {
+    return this.chassisName;
+  }
+
+  public void setChassisName(String chassisName) {
+    this.chassisName = chassisName;
+  }
+
+  public void unsetChassisName() {
+    this.chassisName = null;
+  }
+
+  /** Returns true if field chassisName is set (has been assigned a value) and false otherwise */
+  public boolean isSetChassisName() {
+    return this.chassisName != null;
+  }
+
+  public void setChassisNameIsSet(boolean value) {
+    if (!value) {
+      this.chassisName = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case RESOURCE_HOST_ID:
@@ -521,6 +555,14 @@ import org.slf4j.LoggerFactory;
       }
       break;
 
+    case CHASSIS_NAME:
+      if (value == null) {
+        unsetChassisName();
+      } else {
+        setChassisName((String)value);
+      }
+      break;
+
     }
   }
 
@@ -553,6 +595,9 @@ import org.slf4j.LoggerFactory;
     case COMPUTATIONAL_PROJECT_ACCOUNT:
       return getComputationalProjectAccount();
 
+    case CHASSIS_NAME:
+      return getChassisName();
+
     }
     throw new IllegalStateException();
   }
@@ -582,6 +627,8 @@ import org.slf4j.LoggerFactory;
       return isSetTotalPhysicalMemory();
     case COMPUTATIONAL_PROJECT_ACCOUNT:
       return isSetComputationalProjectAccount();
+    case CHASSIS_NAME:
+      return isSetChassisName();
     }
     throw new IllegalStateException();
   }
@@ -680,6 +727,15 @@ import org.slf4j.LoggerFactory;
         return false;
     }
 
+    boolean this_present_chassisName = true && this.isSetChassisName();
+    boolean that_present_chassisName = true && that.isSetChassisName();
+    if (this_present_chassisName || that_present_chassisName) {
+      if (!(this_present_chassisName && that_present_chassisName))
+        return false;
+      if (!this.chassisName.equals(that.chassisName))
+        return false;
+    }
+
     return true;
   }
 
@@ -786,6 +842,16 @@ import org.slf4j.LoggerFactory;
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetChassisName()).compareTo(other.isSetChassisName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetChassisName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chassisName, other.chassisName);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -871,6 +937,16 @@ import org.slf4j.LoggerFactory;
       }
       first = false;
     }
+    if (isSetChassisName()) {
+      if (!first) sb.append(", ");
+      sb.append("chassisName:");
+      if (this.chassisName == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.chassisName);
+      }
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }
@@ -988,6 +1064,14 @@ import org.slf4j.LoggerFactory;
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 10: // CHASSIS_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.chassisName = iprot.readString();
+              struct.setChassisNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1052,6 +1136,13 @@ import org.slf4j.LoggerFactory;
           oprot.writeFieldEnd();
         }
       }
+      if (struct.chassisName != null) {
+        if (struct.isSetChassisName()) {
+          oprot.writeFieldBegin(CHASSIS_NAME_FIELD_DESC);
+          oprot.writeString(struct.chassisName);
+          oprot.writeFieldEnd();
+        }
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1097,7 +1188,10 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetComputationalProjectAccount()) {
         optionals.set(8);
       }
-      oprot.writeBitSet(optionals, 9);
+      if (struct.isSetChassisName()) {
+        optionals.set(9);
+      }
+      oprot.writeBitSet(optionals, 10);
       if (struct.isSetResourceHostId()) {
         oprot.writeString(struct.resourceHostId);
       }
@@ -1125,12 +1219,15 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetComputationalProjectAccount()) {
         oprot.writeString(struct.computationalProjectAccount);
       }
+      if (struct.isSetChassisName()) {
+        oprot.writeString(struct.chassisName);
+      }
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, ComputationalResourceScheduling struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(9);
+      BitSet incoming = iprot.readBitSet(10);
       if (incoming.get(0)) {
         struct.resourceHostId = iprot.readString();
         struct.setResourceHostIdIsSet(true);
@@ -1167,6 +1264,10 @@ import org.slf4j.LoggerFactory;
         struct.computationalProjectAccount = iprot.readString();
         struct.setComputationalProjectAccountIsSet(true);
       }
+      if (incoming.get(9)) {
+        struct.chassisName = iprot.readString();
+        struct.setChassisNameIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/7c103499/airavata-api/thrift-interface-descriptions/experimentModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/experimentModel.thrift b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
index 93a961a..0801695 100644
--- a/airavata-api/thrift-interface-descriptions/experimentModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
@@ -197,7 +197,8 @@ struct ComputationalResourceScheduling {
     6: optional i32 wallTimeLimit,
     7: optional i32 jobStartTime,
     8: optional i32 totalPhysicalMemory,
-    9: optional string computationalProjectAccount
+    9: optional string computationalProjectAccount,
+    10: optional string chassisName
 }
 
 /**


[25/62] [abbrv] airavata git commit: adding test class to save ssh credentials

Posted by la...@apache.org.
adding test class to save ssh credentials


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: e9468ca5b68083527cb918c2ce195ec0d4f2a8a1
Parents: ac574c9
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 6 12:26:14 2015 -0500
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 6 12:26:14 2015 -0500

----------------------------------------------------------------------
 .../credential-store-service/pom.xml            |  6 ++
 .../store/store/impl/db/SSHCredentialTest.java  | 92 ++++++++++++++++++++
 2 files changed, 98 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e9468ca5/modules/credential-store/credential-store-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/pom.xml b/modules/credential-store/credential-store-service/pom.xml
index 1595ed6..7f9e329 100644
--- a/modules/credential-store/credential-store-service/pom.xml
+++ b/modules/credential-store/credential-store-service/pom.xml
@@ -80,6 +80,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-server-configuration</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derbyclient</artifactId>
             <version>${derby.version}</version>

http://git-wip-us.apache.org/repos/asf/airavata/blob/e9468ca5/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
new file mode 100644
index 0000000..7f44125
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
@@ -0,0 +1,92 @@
+/*
+ *
+ * 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.credential.store.store.impl.db;
+
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.airavata.credential.store.store.impl.SSHCredentialWriter;
+import org.apache.airavata.credential.store.util.TokenGenerator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+public class SSHCredentialTest {
+
+    public static void main(String[] args) {
+        String jdbcURL = "jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata";
+        String jdbcDriver = "org.apache.derby.jdbc.ClientDriver";
+        String userName = "airavata";
+        String password = "airavata";
+        String gatewayId = "default";
+        String privateKeyPath = "/Users/chathuri/.ssh/id_dsa";
+        String pubKeyPath = "/Users/chathuri/.ssh/id_dsa.pub";
+
+        try {
+            AiravataUtils.setExecutionAsServer();
+            DBUtil dbUtil = new DBUtil(jdbcURL, userName, password, jdbcDriver);
+            SSHCredentialWriter writer = new SSHCredentialWriter(dbUtil);
+            SSHCredential sshCredential = new SSHCredential();
+            sshCredential.setGateway(gatewayId);
+            String token = TokenGenerator.generateToken(gatewayId, null);
+            sshCredential.setToken(token);
+            sshCredential.setPortalUserName("admin");
+            FileInputStream privateKeyStream = new FileInputStream(privateKeyPath);
+            File filePri = new File(privateKeyPath);
+            byte[] bFilePri = new byte[(int) filePri.length()];
+            privateKeyStream.read(bFilePri);
+            FileInputStream pubKeyStream = new FileInputStream(pubKeyPath);
+            File filePub = new File(pubKeyPath);
+            byte[] bFilePub = new byte[(int) filePub.length()];
+            pubKeyStream.read(bFilePub);
+            privateKeyStream.close();
+            pubKeyStream.close();
+            sshCredential.setPrivateKey(bFilePub);
+            sshCredential.setPublicKey(bFilePub);
+            sshCredential.setPassphrase("test");
+            writer.writeCredentials(sshCredential);
+            System.out.println(token);
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        } catch (InstantiationException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (ApplicationSettingsException e) {
+            e.printStackTrace();
+        } catch (CredentialStoreException e) {
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+
+    }
+
+}


[43/62] [abbrv] airavata git commit: Fixed AIRAVATA-1596

Posted by la...@apache.org.
Fixed AIRAVATA-1596

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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: b746118e5cc06ac5698c9504f6a4b1c29bc802ca
Parents: 4000b82
Author: raminder <ra...@apache.org>
Authored: Tue Mar 10 23:28:07 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Tue Mar 10 23:28:07 2015 -0400

----------------------------------------------------------------------
 .../tools/RegisterSampleApplications.java       | 158 +++++++++++++++++--
 1 file changed, 143 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b746118e/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index 55dbcf8..58dafbb 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -55,6 +55,8 @@ public class RegisterSampleApplications {
     private static String trestlesResourceId = "trestles.sdsc.xsede.org_db29986e-5a27-4949-ae7f-04a6012d0d35";
     private static String bigredResourceId = "bigred2.uits.iu.edu_3eae6e9d-a1a7-44ec-ac85-3796ef726ef1";
     private static String lsfResourceId = "lsf_3eae6e9d-a1a7-44ec-ac85-3796ef726ef1";
+    private static String alamoResourceId;
+
 
     private static String fsdResourceId;
  // unicore service endpoint url
@@ -76,7 +78,8 @@ public class RegisterSampleApplications {
     private static final String gaussianName = "Gaussian";
     private static final String gamessName = "Gamess";
     private static final String stressMemName = "StressMem";
-
+    private static final String ultrascanName = "Ultrascan";
+   
     //Appplication Descriptions
     private static final String echoDescription = "A Simple Echo Application";
     private static final String amberDescription = "Assisted Model Building with Energy Refinement MD Package";
@@ -92,8 +95,8 @@ public class RegisterSampleApplications {
     private static final String monteXDescription = "Grid Chem Tinker Monte Application";
     private static final String gaussianDescription = "Grid Chem Gaussian Application";
     private static final String gamessDescription = "A Gamess Application";
-
-
+    private static final String ultrascanDescription = "Ultrascan Application";
+    
     //App Module Id's
     private static String echoModuleId;
     private static String amberModuleId;
@@ -124,6 +127,8 @@ public class RegisterSampleApplications {
     private static String wrfInterfaceId;
     private static String phastaInterfaceId;
     private static String gamessInterfaceId;
+    private static String ultrascanModuleId;
+    private static String ultrascanInterfaceId;
 
     public RegisterSampleApplications(Airavata.Client airavataClient) {
            this.airavataClient = airavataClient;
@@ -209,6 +214,12 @@ public class RegisterSampleApplications {
             fsdResourceId = registerUnicoreEndpoint("fsd-cloud15.zam.kfa-juelich.de", "interop host", JobSubmissionProtocol.UNICORE, SecurityProtocol.GSI);
             System.out.println("FSd Resource Id: "+fsdResourceId);
 
+            //Register Alamo
+            alamoResourceId = registerComputeHost("alamo.uthscsa.edu", "Alamo Cluster",
+                    ResourceJobManagerType.PBS, "push", "/usr/bin/", SecurityProtocol.SSH_KEYS, 22, "/usr/bin/mpiexec -np");
+            System.out.println("Alamo Cluster " + alamoResourceId);
+            
+
         } catch (TException e) {
             e.printStackTrace();
         }
@@ -335,6 +346,11 @@ public class RegisterSampleApplications {
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             gamessName, "17May13", gamessDescription));
             System.out.println("Gamess Module Id " + gamessModuleId);
+            //Register Ultrascan
+            ultrascanModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationModule(
+                            ultrascanName, "1.0", ultrascanDescription));
+            System.out.println("Ultrascan Module Id " + ultrascanModuleId);
 
         } catch (TException e) {
             e.printStackTrace();
@@ -360,6 +376,9 @@ public class RegisterSampleApplications {
         registerFSDApps();
 
         registerLSFApps();
+        
+        //Registering Alamo Apps
+        registerAlamoApps();
 
     }
 
@@ -404,6 +423,9 @@ public class RegisterSampleApplications {
         registerTinkerMonteInterface();
 
         registerGaussianInterface();
+        
+        // Register Ultrascan
+        registerUltrascanInterface();
 
     }
 
@@ -432,7 +454,10 @@ public class RegisterSampleApplications {
                     "", DataType.URI, false, true));
             applicationOutputs.add(RegisterSampleApplicationsUtils.createAppOutput("f10_file",
                     "", DataType.URI, false, true));
-
+            applicationOutputs.add(RegisterSampleApplicationsUtils.createAppOutput("STDOUT",
+                    "", DataType.STDOUT, false, true));
+            applicationOutputs.add(RegisterSampleApplicationsUtils.createAppOutput("STDERR",
+                    "", DataType.STDERR, false, true));
 
             gamessInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("gamess", "gamess",
@@ -458,11 +483,14 @@ public class RegisterSampleApplications {
             List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
             applicationInputs.add(input1);
 
-            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("echo_output",
-                    "", DataType.STRING, false, false);
+            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",
+                    "", DataType.STDOUT, false, false);
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",
+                    "", DataType.STDERR, false, false);
 
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
+            applicationOutputs.add(output2);
 
             echoLocalInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(echoName, echoDescription,
@@ -531,11 +559,14 @@ public class RegisterSampleApplications {
             List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
             applicationInputs.add(input1);
             
-            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Sample_Output",
-                    "", DataType.STRING, false, false);
+            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("STDOutput",
+                    "", DataType.STDOUT, true, true);
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDErr",
+                    "", DataType.STDERR, true, true);
             
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
+            applicationOutputs.add(output2);
  
             
             mpiInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
@@ -609,17 +640,19 @@ public class RegisterSampleApplications {
 
             InputDataObjectType input3 = RegisterSampleApplicationsUtils.createAppInput("Parameter_Topology_File", null,
                     DataType.URI, null, 3,true, true, false, "Parameter and Topology coordinates", null);
-
+            
             List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
             applicationInputs.add(input1);
             applicationInputs.add(input2);
             applicationInputs.add(input3);
 
-            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output",
-                    "", DataType.STRING, true, true);
+            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
+          
 
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
+            applicationOutputs.add(output2);
 
             autoDockInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(autoDockName, autoDockDescription,
@@ -723,9 +756,14 @@ public class RegisterSampleApplications {
             applicationInputs.add(input1);
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("LAMMPS_Simulation_Log",null,DataType.URI, true, true);
-
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
+       
+          
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
+            applicationOutputs.add(output2);
+            applicationOutputs.add(output3);
 
             lammpsInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(lammpsName, lammpsDescription,
@@ -752,9 +790,14 @@ public class RegisterSampleApplications {
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("NWChem_Execution_Log",
                     null, DataType.URI, true, false);
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
+           
 
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
+            applicationOutputs.add(output2);
+            applicationOutputs.add(output3);
 
             nwChemInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(nwChemName, nwChemDescription,
@@ -786,10 +829,14 @@ public class RegisterSampleApplications {
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Trinity_Execution_Log",null,DataType.URI, true, true);
             OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("Trinity_FASTA_File",null,DataType.URI, true, true);
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output4 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
 
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
+            applicationOutputs.add(output3);
+            applicationOutputs.add(output4);
 
             trinityInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(trinityName, trinityDescription,
@@ -828,11 +875,16 @@ public class RegisterSampleApplications {
 
             OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("WRF_Execution_Log",
                     "", DataType.URI, true, true);
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output4 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
 
+            
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
-
+            applicationOutputs.add(output3);
+            applicationOutputs.add(output4);
+            
             wrfInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(wrfName, wrfDescription,
                             appModules, applicationInputs, applicationOutputs));
@@ -866,12 +918,18 @@ public class RegisterSampleApplications {
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("PHASTA_Execution_Log",null,DataType.URI, true, true);
             OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("PHASTA_Output_tar",null,DataType.URI, true, true);
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output4 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
 
+            
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
             applicationOutputs.add(output2);
+            applicationOutputs.add(output3);
+            applicationOutputs.add(output4);
 
-            amberInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+
+            phastaInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(phastaName, phastaDescription,
                             appModules, applicationInputs, applicationOutputs));
             System.out.println("phasta Application Interface Id " + phastaInterfaceId);
@@ -911,10 +969,15 @@ public class RegisterSampleApplications {
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("gaussian.out",
                     "", DataType.URI, true, true );
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
+
 
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
-
+            applicationOutputs.add(output2);
+            applicationOutputs.add(output3);
+            
             String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Gaussian", "Gaussian application",
                             appModules, applicationInputs, applicationOutputs));
@@ -958,9 +1021,14 @@ public class RegisterSampleApplications {
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Diskoutputfile_with_dir",
                     "", DataType.URI, false, false);
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",null,DataType.STDOUT, true, true);
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",null,DataType.STDERR, true, true);
 
+            
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
+            applicationOutputs.add(output2);
+            applicationOutputs.add(output3);
 
             String addApplicationInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Tinker_Monte", "Monte application",
@@ -1254,6 +1322,9 @@ public class RegisterSampleApplications {
             ComputeResourcePreference fsdResourcePreferences = RegisterSampleApplicationsUtils.
                     createComputeResourcePreference(fsdResourceId, null, false, null, JobSubmissionProtocol.UNICORE, DataMovementProtocol.UNICORE_STORAGE_SERVICE,null);
             
+            ComputeResourcePreference alamoResourcePreferences = RegisterSampleApplicationsUtils.
+                    createComputeResourcePreference(alamoResourceId, null, false, null, JobSubmissionProtocol.SSH, DataMovementProtocol.SCP,"/home/us3/work/uslims3_cauma3-03896");
+          
             GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
             gatewayResourceProfile.setGatewayID(DEFAULT_GATEWAY);
             gatewayResourceProfile.addToComputeResourcePreferences(stampedeResourcePreferences);
@@ -1298,5 +1369,62 @@ public class RegisterSampleApplications {
             e.printStackTrace();
         }
     }
+    public void registerAlamoApps() {
+        try {
+            System.out.println("#### Registering Application Deployments on Alamo #### \n");
+
+            //Register Ultrascan on Alamo
+            List<String> ultrascanMouldes = new ArrayList<String>();
+            ultrascanMouldes.add("module load intel/2015/64");
+            ultrascanMouldes.add("module load openmpi/intel/1.8.4");
+            ultrascanMouldes.add("module load qt4/4.8.6");
+            ultrascanMouldes.add("module load ultrascan3/3.3");
+
+            String ultrascanAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationDeployment(ultrascanModuleId, alamoResourceId,
+                            "/home/us3/bin/us_mpi_analysis", ApplicationParallelismType.OPENMP, ultrascanDescription, ultrascanMouldes , null, null));
+            System.out.println("Ultrascan on alamo deployment Id " + ultrascanAppDeployId);
+
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+    }
+    
+     private void registerUltrascanInterface() {
+        try {
+            System.out.println("#### Registering Ultrascan Application Interface ####");
+
+            List<String> appModules = new ArrayList<String>();
+            appModules.add(ultrascanModuleId);
+
+            InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("input", null,
+                    DataType.URI, null, 1, true, true,  false, "input file", null);
+
+            List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
+            applicationInputs.add(input1);
+
+            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("output/analysis-results.tar",
+                    "", DataType.URI, true, true );
+
+            OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT",
+                    "", DataType.STDOUT, true, true );
+
+            OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDERR",
+                    "", DataType.STDERR, true, true );
+
+            List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
+            applicationOutputs.add(output1);
+            applicationOutputs.add(output2);
+            applicationOutputs.add(output3);
+
+            String ultrascanInterfaceId = airavataClient.registerApplicationInterface(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Ultrascan", "Ultrascan application",
+                            appModules, applicationInputs, applicationOutputs));
+            System.out.println("Ultrascan Application Interface Id " + ultrascanInterfaceId);
+
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+    }
 }
 


[45/62] [abbrv] airavata git commit: fixing more issues with LSF

Posted by la...@apache.org.
fixing more issues with LSF


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: c2bacf2d724cc4c0a58c3956f8b1fd3d54577d29
Parents: 34b06cc
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Wed Mar 11 16:20:17 2015 -0400
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Wed Mar 11 16:20:17 2015 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 83 +++++++++++++++-----
 .../tools/RegisterSampleApplications.java       | 22 +++++-
 .../server/src/main/resources/LSFTemplate.xslt  |  3 +-
 .../gfac/ssh/provider/impl/SSHProvider.java     |  1 +
 .../gsissh/src/main/resources/LSFTemplate.xslt  |  2 +-
 5 files changed, 87 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 3d58197..b5a5bcc 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -58,13 +58,13 @@ public class CreateLaunchExperiment {
     private static final String DEFAULT_GATEWAY = "php_reference_gateway";
     private static Airavata.Client airavataClient;
 
-    private static String echoAppId = "Echo_8506337e-ab7a-46b6-9b71-4a461b6c5e35";
+    private static String echoAppId = "Echo_61988d1f-7ca9-47ba-9212-a0ac2e973cf1";
     private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
     private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
     private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
     private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
-    private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f";
+    private static String lammpsAppId = "LAMMPS_2472685b-8acf-497e-aafe-cc66fe5f4cb6";
     private static String nwchemAppId = "NWChem_2c8fee64-acf9-4a89-b6d3-91eb53c7640c";
     private static String trinityAppId = "Trinity_e894acf5-9bca-46e8-a1bd-7e2d5155191a";
     private static String autodockAppId = "AutoDock_43d9fdd0-c404-49f4-b913-3abf9080a8c9";
@@ -161,7 +161,8 @@ public class CreateLaunchExperiment {
 //                final String expId = createExperimentNWCHEMStampede(airavataClient);
 //                final String expId = createExperimentTRINITYStampede(airavataClient);
 //                final String expId = createExperimentAUTODOCKStampede(airavataClient); // this is not working , we need to register AutoDock app on stampede
-                final String expId = createExperimentForLSF(airavataClient);
+//                final String expId = createExperimentForLSF(airavataClient);
+                final String expId = createExperimentLAMMPSForLSF(airavataClient);
 //            	  final String expId = "Ultrascan_ln_eb029947-391a-4ccf-8ace-9bafebe07cc0";
                 System.out.println("Experiment ID : " + expId);
 //                updateExperiment(airavata, expId);
@@ -741,6 +742,8 @@ public class CreateLaunchExperiment {
         return null;
     }
 
+
+
     public static String createExperimentLAMMPSStampede(Airavata.Client client) throws TException {
         try {
             List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
@@ -1353,23 +1356,7 @@ public class CreateLaunchExperiment {
             for (InputDataObjectType inputDataObjectType : exInputs) {
                 inputDataObjectType.setValue("Hello World");
             }
-            /*List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Input_to_Echo");
-            input.setType(DataType.STRING);
-            input.setValue("Echoed_Output=Hello World");
-            input.setRequiredToAddedToCommandLine(true);
-            exInputs.add(input);*/
-
             List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
-            /*
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("output_file");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            exOut.add(output);*/
 
             Project project = ProjectModelUtil.createProject("default", "lg11w", "test project");
             String projectId = client.createProject(DEFAULT_GATEWAY, project);
@@ -1411,6 +1398,64 @@ public class CreateLaunchExperiment {
         }
         return null;
     }
+    public static String createExperimentLAMMPSForLSF(Airavata.Client client) throws TException {
+        try {
+            List<InputDataObjectType> exInputs = client.getApplicationInputs(lammpsAppId);
+
+            for (InputDataObjectType inputDataObjectType : exInputs) {
+                inputDataObjectType.setName("Friction_Simulation_Input");
+                inputDataObjectType.setValue("/Users/lginnali/Downloads/data/in.friction");
+                inputDataObjectType.setType(DataType.URI);
+            }
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
+
+            /*OutputDataObjectType outputDataObjectType = exOut.get(0);
+            outputDataObjectType.setName("LAMMPS_Simulation_Log");
+            outputDataObjectType.setType(DataType.URI);
+            outputDataObjectType.setValue("");
+
+            OutputDataObjectType output1 = exOut.get(1);
+            output1.setName("LAMMPS.oJobID");
+            output1.setType(DataType.URI);
+            output1.setValue("");
+
+            exOut.add(outputDataObjectType);
+            exOut.add(output1);*/
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment("default", "lg11w", "LAMMPSExperiment", "Testing", lammpsAppId, exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(lammpsAppId);
+            if (computeResources != null && computeResources.size() != 0) {
+                for (String id : computeResources.keySet()) {
+                    String resourceName = computeResources.get(id);
+                    if (resourceName.equals(umassrcHostName)) {
+                        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling(id, 10, 16, 1, "long", 60, 0, 1000, "airavata");
+                        UserConfigurationData userConfigurationData = new UserConfigurationData();
+                        userConfigurationData.setAiravataAutoSchedule(false);
+                        userConfigurationData.setOverrideManualScheduledParams(false);
+                        userConfigurationData.setComputationalResourceScheduling(scheduling);
+                        simpleExperiment.setUserConfigurationData(userConfigurationData);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
+                    }
+                }
+            }
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        } catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+        return null;
+    }
 
 
     public static String createExperimentForBR2Amber(Airavata.Client client) throws TException {

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index 55dbcf8..990fce7 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -101,6 +101,7 @@ public class RegisterSampleApplications {
     private static String espressoModuleId = "ESPRESSO_54dc94da-5e2b-4add-b054-41ad88891fdc";
     private static String gromacsModuleId = "GROMACS_417271fd-7ac1-4f40-b2a5-ed0908a743eb";
     private static String lammpsModuleId;
+    private static String lammpsModuleId1;
     private static String nwChemModuleId = "NWChem_edbc318d-4c41-46a7-b216-32bad71eabdd";
     private static String trinityModuleId = "Trinity_8af45ca0-b628-4614-9087-c7b73f5f2fb6";
     private static String wrfModuleId;
@@ -221,7 +222,7 @@ public class RegisterSampleApplications {
 
             //Register LSF resource
             lsfResourceId = registerComputeHost("ghpcc06.umassrc.org", "LSF Cluster",
-                    ResourceJobManagerType.LSF, "push", "source /etc/bashrc;/lsf/9.1/linux2.6-glibc2.3-x86_64/bin", SecurityProtocol.SSH_KEYS, 22, null);
+                    ResourceJobManagerType.LSF, "push", "source /etc/bashrc;/lsf/9.1/linux2.6-glibc2.3-x86_64/bin", SecurityProtocol.SSH_KEYS, 22, "mpiexec");
             System.out.println("LSF Resource Id is " + lsfResourceId);
 
         } catch (TException e) {
@@ -296,8 +297,15 @@ public class RegisterSampleApplications {
             lammpsModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             lammpsName, "20Mar14", lammpsDescription));
+
+            lammpsModuleId1 = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationModule(
+                            lammpsName, "28Jun14-base", lammpsDescription));
+
             System.out.println("LAMMPS Module Id " + lammpsModuleId);
 
+            System.out.println("LAMMPS Module Id for LSF " + lammpsModuleId1);
+
             //Register NWChem
             nwChemModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
@@ -715,6 +723,7 @@ public class RegisterSampleApplications {
 
             List<String> appModules = new ArrayList<String>();
             appModules.add(lammpsModuleId);
+            appModules.add(lammpsModuleId1);
 
             InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Friction_Simulation_Input", null,
                     DataType.URI, "<", 1,true, true, false, "Friction Simulation Input - in.friction", null);
@@ -1116,8 +1125,17 @@ public class RegisterSampleApplications {
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, lsfResourceId,
                             "/home/lg11w/executables/echo.sh", ApplicationParallelismType.SERIAL,
                             echoDescription, null, null, null));
-            System.out.println("Echo on trestles deployment Id " + echoAppDeployId);
 
+            List<String> moduleLoadCmd = new ArrayList<String>();
+            moduleLoadCmd.add("module load LAMMPS/28Jun14-base");
+            //Register Echo
+
+            String lammpsDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, lsfResourceId,
+                            "lmp_ghpcc", ApplicationParallelismType.MPI,
+                            echoDescription, moduleLoadCmd, null, null));
+            System.out.println("Echo on LSF deployment Id " + echoAppDeployId);
+            System.out.println("LAMMPS on LSF deployment Id " + lammpsDeployId);
         } catch (TException e) {
             e.printStackTrace();
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/modules/configuration/server/src/main/resources/LSFTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/LSFTemplate.xslt b/modules/configuration/server/src/main/resources/LSFTemplate.xslt
index 7081260..3ed9285 100644
--- a/modules/configuration/server/src/main/resources/LSFTemplate.xslt
+++ b/modules/configuration/server/src/main/resources/LSFTemplate.xslt
@@ -68,14 +68,13 @@
         </xsl:choose>
 
         <xsl:text>&#xa;</xsl:text>
-
         <xsl:text>&#xa;</xsl:text>
         <xsl:for-each select="ns:moduleLoadCommands/ns:command">
             <xsl:text>&#xa;</xsl:text>
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
         </xsl:for-each>
         <xsl:text>&#xa;</xsl:text>
-
+cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text>&#xa;</xsl:text>
         <xsl:for-each select="ns:preJobCommands/ns:command">
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
             <xsl:text>&#xa;</xsl:text>

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
index b1000c5..4c3abde 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
@@ -154,6 +154,7 @@ public class SSHProvider extends AbstractProvider {
                     }
                     // This installed path is a mandetory field, because this could change based on the computing resource
                     JobDescriptor jobDescriptor = GFACSSHUtils.createJobDescriptor(jobExecutionContext, cluster);
+
                     jobDetails.setJobName(jobDescriptor.getJobName());
                     log.info(jobDescriptor.toXML());
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/tools/gsissh/src/main/resources/LSFTemplate.xslt
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/resources/LSFTemplate.xslt b/tools/gsissh/src/main/resources/LSFTemplate.xslt
index 7081260..c548d8e 100644
--- a/tools/gsissh/src/main/resources/LSFTemplate.xslt
+++ b/tools/gsissh/src/main/resources/LSFTemplate.xslt
@@ -75,7 +75,7 @@
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
         </xsl:for-each>
         <xsl:text>&#xa;</xsl:text>
-
+cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text>&#xa;</xsl:text>
         <xsl:for-each select="ns:preJobCommands/ns:command">
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
             <xsl:text>&#xa;</xsl:text>


[42/62] [abbrv] airavata git commit: fixing bug in clone experiment - AIRAVATA-1626

Posted by la...@apache.org.
fixing bug in clone experiment - AIRAVATA-1626


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/4000b82c
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/4000b82c
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/4000b82c

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 4000b82c0dbbbae8fe54c396114ea84da5c09dde
Parents: 56efa8e
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Tue Mar 10 15:18:04 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Tue Mar 10 15:18:04 2015 -0400

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java       | 4 ++--
 .../persistance/registry/jpa/impl/ExperimentRegistry.java        | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4000b82c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index f250f37..a2bd3c7 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -85,7 +85,6 @@ import org.apache.airavata.registry.cpi.RegistryModelType;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.airavata.workflow.catalog.WorkflowCatalogFactory;
 import org.apache.thrift.TException;
-import org.python.antlr.ast.Str;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -1360,6 +1359,7 @@ public class AiravataServerHandler implements Airavata.Iface {
                 throw new ExperimentNotFoundException("Requested experiment id " + existingExperimentID + " does not exist in the system..");
             }
             Experiment existingExperiment = (Experiment)registry.get(RegistryModelType.EXPERIMENT, existingExperimentID);
+            String gatewayId = (String)registry.getValue(RegistryModelType.EXPERIMENT, existingExperimentID, Constants.FieldConstants.ExperimentConstants.GATEWAY);
             existingExperiment.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
             if (validateString(newExperiementName)){
                 existingExperiment.setName(newExperiementName);
@@ -1370,7 +1370,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             if (existingExperiment.getErrors() != null ){
                 existingExperiment.getErrors().clear();
             }
-            return (String)registry.add(ParentDataType.EXPERIMENT, existingExperiment, null);
+            return (String)registry.add(ParentDataType.EXPERIMENT, existingExperiment, gatewayId);
         } catch (Exception e) {
             logger.errorId(existingExperimentID, "Error while cloning the experiment with existing configuration...", e);
             AiravataSystemException exception = new AiravataSystemException();

http://git-wip-us.apache.org/repos/asf/airavata/blob/4000b82c/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 0c90322..0da148b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -62,6 +62,7 @@ public class ExperimentRegistry {
             if (!ResourceUtils.isUserExist(experiment.getUserName())) {
                 ResourceUtils.addUser(experiment.getUserName(), null);
             }
+
             experimentID = getExperimentID(experiment.getName());
             experiment.setExperimentID(experimentID);
             ExperimentResource experimentResource = new ExperimentResource();
@@ -2002,6 +2003,8 @@ public class ExperimentRegistry {
                 return ThriftDataModelConversion.getExperiment(resource);
             } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.USER_NAME)) {
                 return resource.getExecutionUser();
+            }else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.GATEWAY)) {
+                return resource.getGateway().getGatewayId();
             } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_NAME)) {
                 return resource.getExpName();
             } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_DESC)) {


[11/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java
deleted file mode 100644
index b9dc2ef..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java
+++ /dev/null
@@ -1,458 +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.credential.store.store.impl.db;
-
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.KeyStorePasswordCallback;
-import org.apache.airavata.common.utils.SecurityUtil;
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-
-import java.io.*;
-import java.security.GeneralSecurityException;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Data access class for credential store.
- */
-public class CredentialsDAO extends ParentDAO {
-
-    private String keyStorePath = null;
-    private String secretKeyAlias = null;
-    private KeyStorePasswordCallback keyStorePasswordCallback = null;
-
-    public CredentialsDAO() {
-    }
-
-    public CredentialsDAO(String keyStore, String alias, KeyStorePasswordCallback passwordCallback) {
-        this.keyStorePath = keyStore;
-        this.secretKeyAlias = alias;
-        this.keyStorePasswordCallback = passwordCallback;
-    }
-
-    public String getKeyStorePath() {
-        return keyStorePath;
-    }
-
-    public void setKeyStorePath(String keyStorePath) {
-        this.keyStorePath = keyStorePath;
-    }
-
-    public String getSecretKeyAlias() {
-        return secretKeyAlias;
-    }
-
-    public void setSecretKeyAlias(String secretKeyAlias) {
-        this.secretKeyAlias = secretKeyAlias;
-    }
-
-    public KeyStorePasswordCallback getKeyStorePasswordCallback() {
-        return keyStorePasswordCallback;
-    }
-
-    public void setKeyStorePasswordCallback(KeyStorePasswordCallback keyStorePasswordCallback) {
-        this.keyStorePasswordCallback = keyStorePasswordCallback;
-    }
-
-    /**
-     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
-     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
-     * + ")";
-     */
-
-    public void addCredentials(String gatewayId, Credential credential, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "INSERT INTO CREDENTIALS VALUES (?, ?, ?, ?, ?)";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, gatewayId);
-            preparedStatement.setString(2, credential.getToken());
-
-            InputStream isCert = new ByteArrayInputStream(convertObjectToByteArray(credential));
-            preparedStatement.setBinaryStream(3, isCert);
-
-            preparedStatement.setString(4, credential.getPortalUserName());
-
-            java.util.Date date = new java.util.Date();
-            Timestamp timestamp = new Timestamp(date.getTime());
-
-            preparedStatement.setTimestamp(5, timestamp);
-
-            preparedStatement.executeUpdate();
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error persisting credentials.");
-            stringBuilder.append(" gateway - ").append(gatewayId);
-            stringBuilder.append(" token id - ").append(credential.getToken());
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-
-            DBUtil.cleanup(preparedStatement);
-        }
-    }
-
-    public void deleteCredentials(String gatewayName, String tokenId, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "DELETE FROM CREDENTIALS WHERE GATEWAY_ID=? AND TOKEN_ID=?";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, gatewayName);
-            preparedStatement.setString(2, tokenId);
-
-            preparedStatement.executeUpdate();
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error deleting credentials for .");
-            stringBuilder.append("gateway - ").append(gatewayName);
-            stringBuilder.append("token id - ").append(tokenId);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement);
-        }
-    }
-
-    /**
-     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
-     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
-     * + ")";
-     */
-    public void updateCredentials(String gatewayId, Credential credential, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "UPDATE CREDENTIALS set CREDENTIAL = ?, PORTAL_USER_ID = ?, TIME_PERSISTED = ? where GATEWAY_ID = ? and TOKEN_ID = ?";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            InputStream isCert = new ByteArrayInputStream(convertObjectToByteArray(credential));
-            preparedStatement.setBinaryStream(1, isCert);
-
-            preparedStatement.setString(2, credential.getPortalUserName());
-
-            preparedStatement.setTimestamp(3, new Timestamp(new java.util.Date().getTime()));
-            preparedStatement.setString(4, gatewayId);
-            preparedStatement.setString(5, credential.getToken());
-
-            preparedStatement.executeUpdate();
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
-            stringBuilder.append(" gateway - ").append(gatewayId);
-            stringBuilder.append(" token id - ").append(credential.getToken());
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-
-            DBUtil.cleanup(preparedStatement);
-        }
-
-    }
-
-    /**
-     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
-     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
-     * + ")";
-     */
-    public Credential getCredential(String gatewayName, String tokenId, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "SELECT * FROM CREDENTIALS WHERE GATEWAY_ID=? AND TOKEN_ID=?";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, gatewayName);
-            preparedStatement.setString(2, tokenId);
-
-            resultSet = preparedStatement.executeQuery();
-
-            if (resultSet.next()) {
-                // CertificateCredential certificateCredential = new CertificateCredential();
-
-                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
-                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());
-
-                Credential certificateCredential = (Credential) convertByteArrayToObject(certificate);
-
-                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
-                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));
-
-                return certificateCredential;
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving credentials for user.");
-            stringBuilder.append("gateway - ").append(gatewayName);
-            stringBuilder.append("token id - ").append(tokenId);
-
-            log.debug(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement, resultSet);
-        }
-
-        return null;
-    }
-    /**
-     * 
-     */
-    public String getGatewayID(String tokenId, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "SELECT GATEWAY_ID FROM CREDENTIALS WHERE TOKEN_ID=?";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, tokenId);
-         
-            resultSet = preparedStatement.executeQuery();
-
-            if (resultSet.next()) {
-            	return resultSet.getString("GATEWAY_ID");
-              }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving credentials for user.");
-            stringBuilder.append("token id - ").append(tokenId);
-
-            log.debug(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement, resultSet);
-        }
-
-        return null;
-    }
-    /**
-     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
-     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
-     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
-     * + ")";
-     */
-    public List<Credential> getCredentials(String gatewayName, Connection connection) throws CredentialStoreException {
-
-        List<Credential> credentialList = new ArrayList<Credential>();
-
-        String sql = "SELECT * FROM CREDENTIALS WHERE GATEWAY_ID=?";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, gatewayName);
-
-            resultSet = preparedStatement.executeQuery();
-
-            Credential certificateCredential;
-
-            while (resultSet.next()) {
-
-                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
-                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());
-
-                certificateCredential = (Credential) convertByteArrayToObject(certificate);
-
-                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
-                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));
-
-                credentialList.add(certificateCredential);
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving credential list for ");
-            stringBuilder.append("gateway - ").append(gatewayName);
-
-            log.debug(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement, resultSet);
-        }
-
-        return credentialList;
-    }
-
-    /**
-     * Gets all credentials.
-     * @param connection The database connection
-     * @return All credentials as a list
-     * @throws CredentialStoreException If an error occurred while rerieving credentials.
-     */
-    public List<Credential> getCredentials(Connection connection) throws CredentialStoreException {
-
-        List<Credential> credentialList = new ArrayList<Credential>();
-
-        String sql = "SELECT * FROM CREDENTIALS";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            resultSet = preparedStatement.executeQuery();
-
-            Credential certificateCredential;
-
-            while (resultSet.next()) {
-
-                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
-                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());
-
-                certificateCredential = (Credential) convertByteArrayToObject(certificate);
-
-                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
-                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));
-
-                credentialList.add(certificateCredential);
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving all credentials");
-
-            log.debug(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement, resultSet);
-        }
-
-        return credentialList;
-    }
-
-    public Object convertByteArrayToObject(byte[] data) throws CredentialStoreException {
-        ObjectInputStream objectInputStream = null;
-        Object o = null;
-        try {
-            try {
-                //decrypt the data first
-                if (encrypt()) {
-                    data = SecurityUtil.decrypt(this.keyStorePath, this.secretKeyAlias, this.keyStorePasswordCallback, data);
-                }
-
-                objectInputStream = new ObjectInputStream(new ByteArrayInputStream(data));
-                o = objectInputStream.readObject();
-
-            } catch (IOException e) {
-                throw new CredentialStoreException("Error de-serializing object.", e);
-            } catch (ClassNotFoundException e) {
-                throw new CredentialStoreException("Error de-serializing object.", e);
-            } catch (GeneralSecurityException e) {
-                throw new CredentialStoreException("Error decrypting data.", e);
-            }
-        } finally {
-            if (objectInputStream != null) {
-                try {
-                    objectInputStream.close();
-                } catch (IOException e) {
-                    log.error("Error occurred while closing the stream", e);
-                }
-            }
-        }
-        return o;
-    }
-
-    public byte[] convertObjectToByteArray(Serializable o) throws CredentialStoreException {
-        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-
-        ObjectOutputStream objectOutputStream = null;
-        try {
-            objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
-            objectOutputStream.writeObject(o);
-            objectOutputStream.flush();
-        } catch (IOException e) {
-            throw new CredentialStoreException("Error serializing object.", e);
-        } finally {
-            if (objectOutputStream != null) {
-                try {
-                    objectOutputStream.close();
-                } catch (IOException e) {
-                    log.error("Error occurred while closing object output stream", e);
-                }
-            }
-        }
-
-        // encrypt the byte array
-        if (encrypt()) {
-            byte[] array = byteArrayOutputStream.toByteArray();
-            try {
-                return SecurityUtil.encrypt(this.keyStorePath, this.secretKeyAlias, this.keyStorePasswordCallback, array);
-            } catch (GeneralSecurityException e) {
-                throw new CredentialStoreException("Error encrypting data", e);
-            } catch (IOException e) {
-                throw new CredentialStoreException("Error encrypting data. IO exception.", e);
-            }
-        } else {
-            return byteArrayOutputStream.toByteArray();
-        }
-    }
-
-    /**
-     * Says whether to encrypt data or not. if alias, keystore is set
-     * we treat encryption true.
-     * @return true if data should encrypt else false.
-     */
-    private boolean encrypt() {
-        return this.keyStorePath != null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java
deleted file mode 100644
index 8ef0d69..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java
+++ /dev/null
@@ -1,37 +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.credential.store.store.impl.db;
-
-import org.apache.airavata.common.utils.DBUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Super class to abstract out Data access classes.
- */
-public class ParentDAO {
-    protected static Logger log = LoggerFactory.getLogger(ParentDAO.class);
-
-    public ParentDAO() {
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java
deleted file mode 100644
index e44d4d8..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java
+++ /dev/null
@@ -1,121 +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.credential.store.util;
-
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/25/13
- * Time: 6:40 AM
- */
-
-/**
- * Reads credential store specific configurations from the client.xml file.
- */
-public class ConfigurationReader {
-
-    private String successUrl;
-
-    private String errorUrl;
-
-    private String portalRedirectUrl;
-
-    public String getPortalRedirectUrl() {
-        return portalRedirectUrl;
-    }
-
-    public void setPortalRedirectUrl(String portalRedirectUrl) {
-        this.portalRedirectUrl = portalRedirectUrl;
-    }
-
-    public ConfigurationReader() throws CredentialStoreException {
-
-        try {
-            loadConfigurations();
-        } catch (Exception e) {
-            throw new CredentialStoreException("Unable to read credential store specific configurations." , e);
-        }
-
-
-    }
-
-    private void loadConfigurations() throws ParserConfigurationException,
-            IOException, SAXException {
-        InputStream inputStream
-                = this.getClass().getClassLoader().getResourceAsStream("credential-store/client.xml");
-
-        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
-        Document doc = dBuilder.parse(inputStream);
-
-        doc.getDocumentElement().normalize();
-
-        NodeList nodeList = doc.getElementsByTagName("credential-store");
-
-        readElementValue(nodeList);
-
-    }
-
-    private void readElementValue(NodeList nodeList) {
-        for (int temp = 0; temp < nodeList.getLength(); temp++) {
-
-            Node nNode = nodeList.item(temp);
-
-            if (nNode.getNodeType() == Node.ELEMENT_NODE) {
-
-                Element eElement = (Element) nNode;
-
-                this.successUrl = eElement.getElementsByTagName("successUri").item(0).getTextContent();
-                this.errorUrl =  eElement.getElementsByTagName("errorUri").item(0).getTextContent();
-                this.portalRedirectUrl = eElement.getElementsByTagName("redirectUri").item(0).getTextContent();
-            }
-        }
-    }
-
-    public String getSuccessUrl() {
-        return successUrl;
-    }
-
-    public void setSuccessUrl(String successUrl) {
-        this.successUrl = successUrl;
-    }
-
-    public String getErrorUrl() {
-        return errorUrl;
-    }
-
-    public void setErrorUrl(String errorUrl) {
-        this.errorUrl = errorUrl;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java
deleted file mode 100644
index de3c59c..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java
+++ /dev/null
@@ -1,37 +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.credential.store.util;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/25/13
- * Time: 4:34 PM
- */
-
-public class CredentialStoreConstants {
-
-    public static final String GATEWAY_NAME_QUERY_PARAMETER = "gatewayName";
-    public static final String PORTAL_USER_QUERY_PARAMETER = "portalUserName";
-    public static final String PORTAL_USER_EMAIL_QUERY_PARAMETER = "email";
-    public static final String PORTAL_TOKEN_ID_ASSIGNED = "associatedToken";
-    public static final String DURATION_QUERY_PARAMETER = "duration";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java
deleted file mode 100644
index cd6db7e..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java
+++ /dev/null
@@ -1,70 +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.credential.store.util;
-
-import java.security.PrivateKey;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 9/5/13
- * Time: 6:47 PM
- */
-
-public class PrivateKeyStore {
-
-    private Map<String, PrivateKey> privateKeyMap;
-
-    private static PrivateKeyStore privateKeyStore = null;
-
-    private PrivateKeyStore() {
-        privateKeyMap = new HashMap<String, PrivateKey>();
-    }
-
-    public static PrivateKeyStore getPrivateKeyStore() {
-
-        if (privateKeyStore == null) {
-            privateKeyStore = new PrivateKeyStore();
-        }
-
-        return privateKeyStore;
-    }
-
-    public synchronized void addKey(String tokenId, PrivateKey privateKey) {
-
-        privateKeyMap.put(tokenId, privateKey);
-    }
-
-    public synchronized PrivateKey getKey(String tokenId) {
-
-        PrivateKey privateKey = privateKeyMap.get(tokenId);
-
-        if (privateKey != null) {
-            privateKeyMap.remove(tokenId);
-        }
-
-        return privateKey;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java
deleted file mode 100644
index 1c36f8d..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java
+++ /dev/null
@@ -1,57 +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.credential.store.util;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 5/21/13
- * Time: 3:07 PM
- */
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Timestamp;
-import java.util.UUID;
-
-/**
- * Generates tokens for users.
- */
-public class TokenGenerator {
-
-    protected static Logger log = LoggerFactory.getLogger(TokenGenerator.class);
-
-
-    public TokenGenerator() {
-
-    }
-
-    public static String generateToken(String gatewayId, String metadata) {
-
-        return UUID.randomUUID().toString();
-    }
-
-    public String encryptToken(String token) {
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/Utility.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/Utility.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/Utility.java
deleted file mode 100644
index 0ea7bc1..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/util/Utility.java
+++ /dev/null
@@ -1,110 +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.credential.store.util;
-
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.KeyPair;
-import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
-import org.apache.commons.io.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.security.KeyStore;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Contains some utility methods.
- */
-public class Utility {
-
-    protected static Logger log = LoggerFactory.getLogger(Utility.class);
-
-    private static final String DATE_FORMAT = "MM/dd/yyyy HH:mm:ss";
-
-    public static String convertDateToString(Date date) {
-
-        DateFormat df = new SimpleDateFormat(DATE_FORMAT);
-        return df.format(date);
-    }
-
-    public static Date convertStringToDate(String date) throws ParseException {
-
-        DateFormat df = new SimpleDateFormat(DATE_FORMAT);
-        return df.parse(date);
-    }
-
-    public static String encrypt(String stringToEncrypt) {
-        return null;
-
-    }
-
-    public static KeyStore loadKeyStore(String keyStoreFile) throws Exception {
-        KeyStore ks = KeyStore.getInstance("JKS");
-        // get user password and file input stream
-        char[] password = getPassword();
-
-        java.io.FileInputStream fis = null;
-        try {
-            fis = new FileInputStream(keyStoreFile);
-            ks.load(fis, password);
-
-            return ks;
-        } finally {
-            if (fis != null) {
-                fis.close();
-            }
-        }
-    }
-
-    public static char[] getPassword() {
-        return new char[0];
-    }
-
-    public static org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential generateKeyPair(SSHCredential credential) throws Exception{
-        JSch jsch=new JSch();
-        try{
-            KeyPair kpair=KeyPair.genKeyPair(jsch, KeyPair.RSA);
-            File file = File.createTempFile("id_rsa", "");
-            String fileName = file.getAbsolutePath();
-
-            kpair.writePrivateKey(fileName,credential.getPassphrase().getBytes());
-            kpair.writePublicKey(fileName + ".pub"  , "");
-            kpair.dispose();
-            byte[] priKey = FileUtils.readFileToByteArray(new File(fileName));
-
-            byte[] pubKey = FileUtils.readFileToByteArray(new File(fileName + ".pub"));
-            credential.setPrivateKey(priKey);
-            credential.setPublicKey(pubKey);
-            return credential;
-        }
-        catch(Exception e){
-            log.error("Error while creating key pair", e);
-            throw new Exception("Error while creating key pair", e);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java b/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java
deleted file mode 100644
index 05d7a10..0000000
--- a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java
+++ /dev/null
@@ -1,56 +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.credential.store.notifier.impl;
-
-import junit.framework.TestCase;
-import org.apache.airavata.credential.store.notifier.NotificationMessage;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 12/27/13
- * Time: 1:54 PM
- */
-
-public class EmailNotifierTest extends TestCase {
-    public void setUp() throws Exception {
-        super.setUp();
-
-    }
-
-    // Test is disabled. Need to fill in parameters to send mails
-    public void xtestNotifyMessage() throws Exception {
-
-        EmailNotifierConfiguration emailNotifierConfiguration = new EmailNotifierConfiguration("smtp.googlemail.com",
-                465, "yyy", "xxx", true, "yyy@gmail.com");
-
-        EmailNotifier notifier = new EmailNotifier(emailNotifierConfiguration);
-        EmailNotificationMessage emailNotificationMessage = new EmailNotificationMessage("Test",
-                "ggg@gmail.com", "Testing credential store");
-        notifier.notifyMessage(emailNotificationMessage);
-
-    }
-
-    // Just to ignore test failures.
-    public void testIgnore() {
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java b/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
deleted file mode 100644
index 8ed8a6a..0000000
--- a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
+++ /dev/null
@@ -1,207 +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.credential.store.store.impl.db;
-
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-import org.junit.*;
-
-import java.sql.Connection;
-import java.util.List;
-
-/**
- * Test for community user DAO.
- */
-public class CommunityUserDAOTest extends DatabaseTestCases {
-
-    private CommunityUserDAO communityUserDAO;
-
-    @BeforeClass
-    public static void setUpDatabase() throws Exception {
-
-        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
-        waitTillServerStarts();
-
-        String createTable = "CREATE TABLE COMMUNITY_USER\n" + "                (\n"
-                + "                        GATEWAY_NAME VARCHAR(256) NOT NULL,\n"
-                + "                        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,\n"
-                + "                        TOKEN_ID VARCHAR(256) NOT NULL,\n"
-                + "                        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,\n"
-                + "                        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)\n"
-                + "                )";
-
-        String dropTable = "drop table COMMUNITY_USER";
-
-        try {
-            executeSQL(dropTable);
-        } catch (Exception e) {
-        }
-
-        executeSQL(createTable);
-
-    }
-
-    @AfterClass
-    public static void shutDownDatabase() throws Exception {
-        DerbyUtil.stopDerbyServer();
-    }
-
-    @Before
-    public void setUp() throws Exception {
-
-        communityUserDAO = new CommunityUserDAO();
-
-        Connection connection = getDbUtil().getConnection();
-
-        try {
-            DBUtil.truncate("community_user", connection);
-        } finally {
-            connection.close();
-        }
-
-    }
-
-    @Test
-    public void testAddCommunityUser() throws Exception {
-
-        Connection connection = getConnection();
-
-        try {
-
-            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
-            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
-
-            communityUser = new CommunityUser("gw1", "ogce2", "ogce@sciencegateway.org");
-            communityUserDAO.addCommunityUser(communityUser, "Token2", connection);
-
-            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
-            Assert.assertNotNull(user);
-            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
-
-            user = communityUserDAO.getCommunityUser("gw1", "ogce2", connection);
-            Assert.assertNotNull(user);
-            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
-
-            user = communityUserDAO.getCommunityUserByToken("gw1", "Token1", connection);
-            Assert.assertNotNull(user);
-            Assert.assertEquals("ogce", user.getUserName());
-            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
-
-            user = communityUserDAO.getCommunityUserByToken("gw1", "Token2", connection);
-            Assert.assertNotNull(user);
-            Assert.assertEquals("ogce2", user.getUserName());
-            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
-
-        } finally {
-            connection.close();
-        }
-
-    }
-
-    @Test
-    public void testDeleteCommunityUser() throws Exception {
-
-        Connection connection = getConnection();
-
-        try {
-            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
-            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
-
-            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
-            Assert.assertNotNull(user);
-
-            communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
-            communityUserDAO.deleteCommunityUser(communityUser, connection);
-
-            user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
-            Assert.assertNull(user);
-
-        } finally {
-            connection.close();
-        }
-    }
-
-    @Test
-    public void testDeleteCommunityUserByToken() throws Exception {
-
-        Connection connection = getConnection();
-
-        try {
-            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
-            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
-
-            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
-            Assert.assertNotNull(user);
-
-            communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
-            communityUserDAO.deleteCommunityUserByToken(communityUser, "Token1", connection);
-
-            user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
-            Assert.assertNull(user);
-
-        } finally {
-            connection.close();
-        }
-
-    }
-
-    @Test
-    public void testGetCommunityUsers() throws Exception {
-
-        Connection connection = getConnection();
-
-        try {
-            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
-            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
-
-            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
-            Assert.assertNotNull(user);
-            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
-
-        } finally {
-            connection.close();
-        }
-
-    }
-
-    @Test
-    public void testGetCommunityUsersForGateway() throws Exception {
-
-        Connection connection = getConnection();
-
-        CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
-        communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
-
-        communityUser = new CommunityUser("gw1", "ogce2", "ogce@sciencegateway.org");
-        communityUserDAO.addCommunityUser(communityUser, "Token2", connection);
-
-        List<CommunityUser> users = communityUserDAO.getCommunityUsers("gw1", connection);
-        Assert.assertNotNull(users);
-        Assert.assertEquals(2, users.size());
-
-        Assert.assertEquals(users.get(0).getUserName(), "ogce");
-        Assert.assertEquals(users.get(1).getUserName(), "ogce2");
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java b/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java
deleted file mode 100644
index c175454..0000000
--- a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java
+++ /dev/null
@@ -1,421 +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.credential.store.store.impl.db;
-
-import junit.framework.Assert;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.common.utils.KeyStorePasswordCallback;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-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.CredentialStoreException;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.net.URL;
-import java.security.*;
-import java.security.cert.X509Certificate;
-import java.sql.Connection;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Test class for credential class
- */
-public class CredentialsDAOTest extends DatabaseTestCases {
-
-    private static final Logger logger = LoggerFactory.getLogger(CredentialsDAOTest.class);
-
-    private CredentialsDAO credentialsDAO;
-
-    private X509Certificate[] x509Certificates;
-    private PrivateKey privateKey;
-
-    @BeforeClass
-    public static void setUpDatabase() throws Exception {
-        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
-        waitTillServerStarts();
-
-        /*
-         * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_NAME VARCHAR(256) NOT NULL,\n" +
-         * "        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,\n" + "        CREDENTIAL BLOB NOT NULL,\n" +
-         * "        PRIVATE_KEY BLOB NOT NULL,\n" + "        NOT_BEFORE VARCHAR(256) NOT NULL,\n" +
-         * "        NOT_AFTER VARCHAR(256) NOT NULL,\n" + "        LIFETIME INTEGER NOT NULL,\n" +
-         * "        REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,\n" +
-         * "        REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',\n" +
-         * "        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)\n" + ")";
-         */
-
-        String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n"
-                + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n"
-                + "        TOKEN_ID VARCHAR(256) NOT NULL,\n"
-                + // Actual token used to identify the credential
-                "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n"
-                + "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n"
-                + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n" + ")";
-
-        String dropTable = "drop table CREDENTIALS";
-
-        try {
-            executeSQL(dropTable);
-        } catch (Exception e) {
-        }
-
-        executeSQL(createTable);
-
-    }
-
-    @AfterClass
-    public static void shutDownDatabase() throws Exception {
-        DerbyUtil.stopDerbyServer();
-    }
-
-    @Before
-    public void setUp() throws Exception {
-
-        credentialsDAO = new CredentialsDAO();
-
-        x509Certificates = new X509Certificate[1];
-
-        // Cleanup tables;
-        Connection connection = getConnection();
-
-        try {
-            DBUtil.truncate("credentials", connection);
-        } finally {
-            connection.close();
-        }
-
-        initializeKeys();
-    }
-
-    private void initializeKeys() throws Exception {
-        KeyStore ks = KeyStore.getInstance("JKS");
-        char[] password = "password".toCharArray();
-
-        String baseDirectory = System.getProperty("credential.module.directory");
-
-        String keyStorePath = "src" + File.separator + "test" + File.separator + "resources" + File.separator
-                + "keystore.jks";
-
-        if (baseDirectory != null) {
-            keyStorePath = baseDirectory + File.separator + keyStorePath;
-        } else {
-            keyStorePath = "modules" + File.separator + "credential-store" + File.separator + keyStorePath;
-        }
-
-        File keyStoreFile = new File(keyStorePath);
-        if (!keyStoreFile.exists()) {
-            logger.error("Unable to read keystore file " + keyStoreFile);
-            throw new RuntimeException("Unable to read keystore file " + keyStoreFile);
-
-        }
-
-        java.io.FileInputStream fis = null;
-        try {
-            fis = new java.io.FileInputStream(keyStorePath);
-            ks.load(fis, password);
-        } finally {
-            if (fis != null) {
-                fis.close();
-            }
-        }
-
-        fis.close();
-
-        privateKey = (PrivateKey) ks.getKey("selfsigned", password);
-        x509Certificates[0] = (X509Certificate) ks.getCertificate("selfsigned");
-
-    }
-
-    @Test
-    public void testKeyReading() throws Exception {
-        initializeKeys();
-        System.out.println(privateKey.getAlgorithm());
-        System.out.println(x509Certificates[0].getIssuerDN());
-
-        Assert.assertNotNull(privateKey);
-        Assert.assertNotNull(x509Certificates);
-    }
-
-    private CommunityUser getCommunityUser(String gateway, String name) {
-        return new CommunityUser(gateway, name, "amila@sciencegateway.org");
-    }
-
-    private void addTestCredentials() throws Exception {
-
-        Connection connection = getConnection();
-
-        try {
-            CertificateCredential certificateCredential = getTestCredentialObject();
-            credentialsDAO.addCredentials(certificateCredential.getCommunityUser().getGatewayName(),
-                    certificateCredential, connection);
-
-        } finally {
-            connection.close();
-        }
-    }
-
-    public CertificateCredential getTestCredentialObject() {
-
-        CertificateCredential certificateCredential = new CertificateCredential();
-        certificateCredential.setToken("tom");
-        certificateCredential.setCertificates(x509Certificates);
-        certificateCredential.setPrivateKey(privateKey);
-        certificateCredential.setCommunityUser(getCommunityUser("gw1", "tom"));
-        certificateCredential.setLifeTime(1000);
-        certificateCredential.setPortalUserName("jerry");
-        certificateCredential.setNotBefore("13 OCT 2012 5:34:23");
-        certificateCredential.setNotAfter("14 OCT 2012 5:34:23");
-
-        return certificateCredential;
-
-    }
-
-    @Test
-    public void testSerialization() throws CredentialStoreException {
-
-        CertificateCredential certificateCredential = getTestCredentialObject();
-
-        CredentialsDAO credentialsDAO1 = new CredentialsDAO();
-
-        byte[] array = credentialsDAO1.convertObjectToByteArray(certificateCredential);
-        CertificateCredential readCertificateCredential = (CertificateCredential) credentialsDAO1
-                .convertByteArrayToObject(array);
-
-        checkEquality(certificateCredential.getCertificates(), readCertificateCredential.getCertificates());
-        Assert.assertEquals(certificateCredential.getCertificateRequestedTime(),
-                readCertificateCredential.getCertificateRequestedTime());
-        Assert.assertEquals(certificateCredential.getCommunityUser().getGatewayName(), readCertificateCredential
-                .getCommunityUser().getGatewayName());
-        Assert.assertEquals(certificateCredential.getCommunityUser().getUserEmail(), readCertificateCredential
-                .getCommunityUser().getUserEmail());
-        Assert.assertEquals(certificateCredential.getCommunityUser().getUserName(), readCertificateCredential
-                .getCommunityUser().getUserName());
-        Assert.assertEquals(certificateCredential.getLifeTime(), readCertificateCredential.getLifeTime());
-        Assert.assertEquals(certificateCredential.getNotAfter(), readCertificateCredential.getNotAfter());
-        Assert.assertEquals(certificateCredential.getNotBefore(), readCertificateCredential.getNotBefore());
-        Assert.assertEquals(certificateCredential.getPortalUserName(), readCertificateCredential.getPortalUserName());
-
-        PrivateKey newKey = readCertificateCredential.getPrivateKey();
-
-        Assert.assertNotNull(newKey);
-        Assert.assertEquals(privateKey.getClass(), newKey.getClass());
-
-        Assert.assertEquals(privateKey.getFormat(), newKey.getFormat());
-        Assert.assertEquals(privateKey.getAlgorithm(), newKey.getAlgorithm());
-        Assert.assertTrue(Arrays.equals(privateKey.getEncoded(), newKey.getEncoded()));
-    }
-
-    @Test
-    public void testSerializationWithEncryption() throws CredentialStoreException {
-
-        URL url = this.getClass().getClassLoader().getResource("mykeystore.jks");
-        String secretKeyAlias = "mykey";
-
-        assert url != null;
-
-        CertificateCredential certificateCredential = getTestCredentialObject();
-
-        CredentialsDAO credentialsDAO1 = new CredentialsDAO(url.getPath(), secretKeyAlias,
-                new TestACSKeyStoreCallback());
-
-        byte[] array = credentialsDAO1.convertObjectToByteArray(certificateCredential);
-        CertificateCredential readCertificateCredential = (CertificateCredential) credentialsDAO1
-                .convertByteArrayToObject(array);
-
-        checkEquality(certificateCredential.getCertificates(), readCertificateCredential.getCertificates());
-        Assert.assertEquals(certificateCredential.getCertificateRequestedTime(),
-                readCertificateCredential.getCertificateRequestedTime());
-        Assert.assertEquals(certificateCredential.getCommunityUser().getGatewayName(), readCertificateCredential
-                .getCommunityUser().getGatewayName());
-        Assert.assertEquals(certificateCredential.getCommunityUser().getUserEmail(), readCertificateCredential
-                .getCommunityUser().getUserEmail());
-        Assert.assertEquals(certificateCredential.getCommunityUser().getUserName(), readCertificateCredential
-                .getCommunityUser().getUserName());
-        Assert.assertEquals(certificateCredential.getLifeTime(), readCertificateCredential.getLifeTime());
-        Assert.assertEquals(certificateCredential.getNotAfter(), readCertificateCredential.getNotAfter());
-        Assert.assertEquals(certificateCredential.getNotBefore(), readCertificateCredential.getNotBefore());
-        Assert.assertEquals(certificateCredential.getPortalUserName(), readCertificateCredential.getPortalUserName());
-
-        PrivateKey newKey = readCertificateCredential.getPrivateKey();
-
-        Assert.assertNotNull(newKey);
-        Assert.assertEquals(privateKey.getClass(), newKey.getClass());
-
-        Assert.assertEquals(privateKey.getFormat(), newKey.getFormat());
-        Assert.assertEquals(privateKey.getAlgorithm(), newKey.getAlgorithm());
-        Assert.assertTrue(Arrays.equals(privateKey.getEncoded(), newKey.getEncoded()));
-    }
-
-    private class TestACSKeyStoreCallback implements KeyStorePasswordCallback {
-
-        @Override
-        public char[] getStorePassword() {
-            return "airavata".toCharArray();
-        }
-
-        @Override
-        public char[] getSecretKeyPassPhrase(String keyAlias) {
-            if (keyAlias.equals("mykey")) {
-                return "airavatasecretkey".toCharArray();
-            }
-
-            return null;
-        }
-    }
-
-    private void checkEquality(X509Certificate[] certificates1, X509Certificate[] certificates2) {
-
-        int i = 0;
-
-        for (X509Certificate certificate : certificates1) {
-            Assert.assertEquals(certificate, certificates2[i]);
-        }
-
-        Assert.assertEquals(certificates1.length, certificates2.length);
-
-    }
-
-    @Test
-    public void testAddCredentials() throws Exception {
-
-        addTestCredentials();
-
-        Connection connection = getConnection();
-
-        try {
-            CertificateCredential certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1",
-                    "tom", connection);
-            //Test get gateway name
-            String gateway = credentialsDAO.getGatewayID("tom", connection);
-            Assert.assertNotNull(certificateCredential);
-            Assert.assertEquals("jerry", certificateCredential.getPortalUserName());
-            Assert.assertEquals("gw1", gateway);
-            checkEquality(x509Certificates, certificateCredential.getCertificates());
-            Assert.assertEquals(privateKey.getFormat(), certificateCredential.getPrivateKey().getFormat());
-        } finally {
-            connection.close();
-        }
-    }
-    
-    @Test
-    public void testDeleteCredentials() throws Exception {
-
-        addTestCredentials();
-
-        Connection connection = getConnection();
-
-        try {
-            CertificateCredential certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1",
-                    "tom", connection);
-            Assert.assertNotNull(certificateCredential);
-
-            credentialsDAO.deleteCredentials("gw1", "tom", connection);
-
-            certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1", "tom", connection);
-            Assert.assertNull(certificateCredential);
-
-        } finally {
-            connection.close();
-        }
-    }
-
-    @Test
-    public void testUpdateCredentials() throws Exception {
-
-        addTestCredentials();
-
-        Connection connection = getConnection();
-
-        try {
-            CommunityUser communityUser = getCommunityUser("gw1", "tom");
-            CertificateCredential certificateCredential = new CertificateCredential();
-            certificateCredential.setToken("tom");
-            certificateCredential.setCommunityUser(communityUser);
-            certificateCredential.setCertificates(x509Certificates);
-            // certificateCredential.setPrivateKey(privateKey);
-            certificateCredential.setPortalUserName("test2");
-            certificateCredential.setLifeTime(50);
-            certificateCredential.setNotBefore("15 OCT 2012 5:34:23");
-            certificateCredential.setNotAfter("16 OCT 2012 5:34:23");
-
-            credentialsDAO.updateCredentials(communityUser.getGatewayName(), certificateCredential, connection);
-
-            certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1", "tom", connection);
-
-            Assert.assertEquals("CN=Airavata Project, OU=IU, O=Indiana University, L=Bloomington, ST=IN, C=US",
-                    certificateCredential.getCertificates()[0].getIssuerDN().toString());
-            // Assert.assertNotNull(certificateCredential.getPrivateKey());
-            Assert.assertEquals("test2", certificateCredential.getPortalUserName());
-
-        } finally {
-            connection.close();
-        }
-
-    }
-
-    @Test
-    public void testGetCredentials() throws Exception {
-
-        addTestCredentials();
-
-        Connection connection = getConnection();
-
-        try {
-
-            CertificateCredential certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1",
-                    "tom", connection);
-            Assert.assertEquals("CN=Airavata Project, OU=IU, O=Indiana University, L=Bloomington, ST=IN, C=US",
-                    certificateCredential.getCertificates()[0].getIssuerDN().toString());
-            // Assert.assertNotNull(certificateCredential.getPrivateKey());
-
-        } finally {
-            connection.close();
-        }
-    }
-
-    @Test
-    public void testGetGatewayCredentials() throws Exception {
-
-        addTestCredentials();
-
-        Connection connection = getConnection();
-
-        try {
-            List<Credential> list = credentialsDAO.getCredentials("gw1", connection);
-
-            Assert.assertEquals(1, list.size());
-        } finally {
-            connection.close();
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java b/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java
deleted file mode 100644
index 7a95e3e..0000000
--- a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java
+++ /dev/null
@@ -1,58 +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.credential.store.util;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/25/13
- * Time: 10:28 AM
- */
-
-public class ConfigurationReaderTest extends TestCase {
-    public void setUp() throws Exception {
-        super.setUp();
-
-    }
-
-    public void testGetSuccessUrl() throws Exception {
-
-        ConfigurationReader configurationReader = new ConfigurationReader();
-        System.out.println(configurationReader.getSuccessUrl());
-        Assert.assertEquals("/credential-store/success.jsp", configurationReader.getSuccessUrl());
-    }
-
-    public void testGetErrorUrl() throws Exception {
-
-        ConfigurationReader configurationReader = new ConfigurationReader();
-        Assert.assertEquals("/credential-store/error.jsp", configurationReader.getErrorUrl());
-
-    }
-
-    public void testRedirectUrl() throws Exception {
-
-        ConfigurationReader configurationReader = new ConfigurationReader();
-        Assert.assertEquals("/credential-store/show-redirect.jsp", configurationReader.getPortalRedirectUrl());
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java b/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java
deleted file mode 100644
index 57b52ae..0000000
--- a/modules/credential-store-service/credential-store/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java
+++ /dev/null
@@ -1,42 +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.credential.store.util;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/5/13
- * Time: 4:20 PM
- */
-
-public class    TokenGeneratorTest extends TestCase {
-
-    public void testGenerateToken() throws Exception {
-
-        String token = TokenGenerator.generateToken("gw1", "admin");
-        Assert.assertNotNull(token);
-        System.out.println(token);
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml b/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
deleted file mode 100644
index 8b934e6..0000000
--- a/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--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. -->
-
-<config>
-    <client name="acs">
-        <logging
-                logFileName="../logs/oa4mp.log"
-                logName="oa4mp"
-                logSize="1000000"
-                logFileCount="2"
-                debug="true"/>
-        <id>myproxy:oa4mp,2012:/client/24c45c2eb65d93231d02d423e94d0362</id>
-        <serviceUri>https://oa4mp.xsede.org/oauth</serviceUri>
-        <callbackUri>https://localhost:8443/airavata/callback</callbackUri>
-        <lifetime>864000</lifetime>
-        <publicKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-pubkey.pem</publicKeyFile>
-        <privateKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-privkey.pk8</privateKeyFile>
-    </client>
-
-    <credential-store>
-        <successUri>/credential-store/success.jsp</successUri>
-        <errorUri>/credential-store/error.jsp</errorUri>
-        <redirectUri>/credential-store/show-redirect.jsp</redirectUri>
-    </credential-store>
-
-</config>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/resources/keystore.jks
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/resources/keystore.jks b/modules/credential-store-service/credential-store/src/test/resources/keystore.jks
deleted file mode 100644
index 14cf022..0000000
Binary files a/modules/credential-store-service/credential-store/src/test/resources/keystore.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/test/resources/mykeystore.jks
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/resources/mykeystore.jks b/modules/credential-store-service/credential-store/src/test/resources/mykeystore.jks
deleted file mode 100644
index 335ebf8..0000000
Binary files a/modules/credential-store-service/credential-store/src/test/resources/mykeystore.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/cs-thrift-description/credentialStoreErrors.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/cs-thrift-description/credentialStoreErrors.thrift b/modules/credential-store-service/cs-thrift-description/credentialStoreErrors.thrift
deleted file mode 100644
index 148d7f2..0000000
--- a/modules/credential-store-service/cs-thrift-description/credentialStoreErrors.thrift
+++ /dev/null
@@ -1,32 +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.
- *
- */
-
-/*
-* This file describes the definitions of the Error Messages that can occur
-*  when invoking Apache Airavata Services through the API. In addition Thrift provides
-*  built in funcationality to raise TApplicationException for all internal server errors.
-*/
-
-namespace java org.apache.airavata.credential.store.exception
-namespace php Airavata.Credential.Store.Error
-
-exception CredentialStoreException {
-  1: required string message
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift b/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift
deleted file mode 100644
index c8a31db..0000000
--- a/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift
+++ /dev/null
@@ -1,61 +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.
- *
- */
-
-/*
- * Component Programming Interface definition for Apache Airavata GFac Service.
- *
-*/
-
-include "csDataModel.thrift"
-include "credentialStoreErrors.thrift"
-
-namespace java org.apache.airavata.credential.store.cpi
-
-const string CS_CPI_VERSION = "0.15.0"
-
-service CredentialStoreService {
-
-  /** Query CS server to fetch the CPI version */
-  string getCSServiceVersion(),
-
-  /**
-  * This method is to add SSHCredential which will return the token Id in success
-  **/
-  string addSSHCredential (1: required csDataModel.SSHCredential sshCredential)
-                        throws (1:credentialStoreErrors.CredentialStoreException csException);
-
-  string addCertificateCredential (1: required csDataModel.CertificateCredential certificateCredential)
-                        throws (1:credentialStoreErrors.CredentialStoreException csException);
-
-  string addPasswordCredential (1: required csDataModel.PasswordCredential passwordCredential)
-                        throws (1:credentialStoreErrors.CredentialStoreException csException);
-
-  csDataModel.SSHCredential getSSHCredential (1: required string tokenId, 2: required string gatewayId)
-                        throws (1:credentialStoreErrors.CredentialStoreException csException);
-
-  csDataModel.CertificateCredential getCertificateCredential (1: required string tokenId, 2: required string gatewayId)
-                        throws (1:credentialStoreErrors.CredentialStoreException csException);
-
-  csDataModel.PasswordCredential getPasswordCredential (1: required string tokenId, 2: required string gatewayId)
-                        throws (1:credentialStoreErrors.CredentialStoreException csException);
-
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/cs-thrift-description/csDataModel.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/cs-thrift-description/csDataModel.thrift b/modules/credential-store-service/cs-thrift-description/csDataModel.thrift
deleted file mode 100644
index ce4dc46..0000000
--- a/modules/credential-store-service/cs-thrift-description/csDataModel.thrift
+++ /dev/null
@@ -1,61 +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.
- *
- */
-
-
-namespace java org.apache.airavata.credential.store.datamodel
-namespace php Airavata.Model.Credential.Store
-
-
-const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS"
-
-
-struct SSHCredential {
-    1: required string gatewayId,
-    2: required string username,
-    3: required string passphrase,
-    4: optional string publicKey,
-    5: optional string privateKey,
-    6: optional i64 persistedTime,
-    7: optional string token
-}
-
-struct CommunityUser {
-    1: required string gatewayName,
-    2: required string username,
-    3: required string userEmail
-}
-
-struct CertificateCredential {
-    1: required CommunityUser communityUser,
-    2: required string x509Cert,
-    3: optional string notAfter,
-    4: optional string privateKey,
-    5: optional i64 lifeTime,
-    6: optional string notBefore
-    7: optional i64 persistedTime,
-    8: optional string token
-}
-
-struct PasswordCredential {
-    1: required string username,
-    2: required string password,
-    3: optional i64 persistedTime,
-    4: optional string token
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh b/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh
deleted file mode 100755
index 156aaa6..0000000
--- a/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#! /usr/bin/env bash
-
-# 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.
-
-# This script will regenerate the thrift code for Airavata Credential Store Server Skeltons and Client Stubs.
-
-
-# Global Constants used across the script
-REQUIRED_THRIFT_VERSION='0.9.1'
-BASE_TARGET_DIR='target'
-CS_SERVICE_DIR='../credential-store/src/main/java'
-
-# The Function fail prints error messages on failure and quits the script.
-fail() {
-    echo $@
-    exit 1
-}
-
-# The function add_license_header adds the ASF V2 license header to all java files within the specified generated
-#   directory. The function also adds suppress all warnings annotation to all public classes and enums
-#  To Call:
-#   add_license_header $generated_code_directory
-add_license_header() {
-
-    # Fetch the generated code directory passed as the argument
-    GENERATED_CODE_DIR=$1
-
-    # For all generated thrift code, add the suppress all warnings annotation
-    #  NOTE: In order to save the original file as a backup, use sed -i.orig in place of sed -i ''
-    find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /'
-    find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /'
-
-    # For each java file within the generated directory, add the ASF V2 LICENSE header
-    for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do
-      cat - ${f} >${f}-with-license <<EOF
-    /*
-     * 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.
-     */
-EOF
-    mv ${f}-with-license ${f}
-    done
-}
-
-# The function compares every generated java file with the one in specified existing source location. If the comparison
-#   shows a difference, then it replaces with the newly generated file (with added license header).
-#  To Call:
-#   copy_changed_files $generated_code_directory $existing_source_directory
-copy_changed_files() {
-
-    # Read all the function arguments
-    GENERATED_CODE_DIR=$1
-    WORKSPACE_SRC_DIR=$2
-
-    echo "Generated sources are in ${GENERATED_CODE_DIR}"
-    echo "Destination workspace is in ${WORKSPACE_SRC_DIR}"
-
-    # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced.
-    #  the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied.
-    rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR}
-}
-
-# Generation of thrift files will require installing Apache Thrift. Please add thrift to your path.
-#  Verify is thrift is installed, is in the path is at a specified version.
-VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" |  wc -l)
-if [ "$VERSION" -ne 1 ] ; then
-    echo "****************************************************"
-    echo "*** thrift is not installed or is not in the path"
-    echo "***   expecting 'thrift -version' to return ${REQUIRED_THRIFT_VERSION}"
-    echo "*** generated code will not be updated"
-    fail "****************************************************"
-fi
-
-# Initialize the thrift arguments.
-#  Since most of the Airavata API and Data Models have includes, use recursive option by default.
-#  Generate all the files in target directory
-THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}"
-# Ensure the required target directories exists, if not create.
-mkdir -p ${BASE_TARGET_DIR}
-
-#######################################################################
-# Generate/Update the Credential Store CPI service stubs
-#  To start with both the servicer and client are in same package, but
-#  needs to be split using a common generated api-boilerplate-code
-#######################################################################
-
-#Java generation directory
-JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java
-
-# As a precaution  remove and previously generated files if exists
-rm -rf ${JAVA_GEN_DIR}
-
-# Using thrift Java generator, generate the java classes based on Airavata API. This
-#   The airavataAPI.thrift includes rest of data models.
-thrift ${THRIFT_ARGS} --gen java cs.cpi.service.thrift || fail unable to generate java thrift classes
-thrift ${THRIFT_ARGS} --gen java csDataModel.thrift || fail unable to generate java thrift classes
-
-
-# For the generated java classes add the ASF V2 License header
-add_license_header $JAVA_GEN_DIR
-
-# Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones.
-copy_changed_files ${JAVA_GEN_DIR} ${CS_SERVICE_DIR}
-
-# CleanUp: Delete the base target build directory
-#rm -rf ${BASE_TARGET_DIR}
-
-echo "Successfully generated new sources, compared against exiting code and replaced the changed files"
-exit 0


[36/62] [abbrv] airavata git commit: introducing support of myproxy and server generated identity mechanisms, work is still under development

Posted by la...@apache.org.
introducing support of myproxy and server generated identity mechanisms,
work is still under  development

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/8d3b1374
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/8d3b1374
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/8d3b1374

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 8d3b1374a9ab65f3e9dcceb8cfb4e32391c1c39f
Parents: 34b06cc
Author: msmemon <sh...@gmail.com>
Authored: Tue Mar 10 16:49:25 2015 +0100
Committer: msmemon <sh...@gmail.com>
Committed: Tue Mar 10 16:49:25 2015 +0100

----------------------------------------------------------------------
 .../computeResourceModel.thrift                 | 23 +++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/8d3b1374/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift b/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
index cb924e9..8e89908 100644
--- a/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
@@ -333,14 +333,35 @@ struct GlobusJobSubmission {
  *
  * unicoreEndPointURL:
  *  unicoreGateway End Point. The provider will query this service to fetch required service end points.
+ * authenticationMode
+ *  The authenticationMode defines the way certificate is fetched. 
+ * userDN
+ *  This attribute captures the userDN used for launching jobs and create temporary storages. The attribute should be 
+ *  provided if the authentication mode is set as SERVER_ISSUED.
 */
 struct UnicoreJobSubmission {
     1: required string jobSubmissionInterfaceId = DEFAULT_ID,
     2: required SecurityProtocol securityProtocol,
-    3: required string unicoreEndPointURL
+    3: required string unicoreEndPointURL,
+    4: required AuthenticationMode authenticationMode,
+    5: optional string userDN
 }
 
 /**
+ * AuthenticationMode
+ *
+ * SERVER_ISSUED: use CA credentials to generate a certificate based on user name. 
+ * server properties. 
+ * MYPROXY_ISSUED: rely on GSI method implementation already provided 
+ * by Airavata security libs. 
+*/
+enum AuthenticationMode {
+    SERVER_ISSUED,
+    MYPROXY_ISSUED
+}
+
+
+/**
 * Provider name
 **/
 enum ProviderName {


[60/62] [abbrv] airavata git commit: Changed according to AIRAVATA-1634 in clone fix. AIRAVATA-1631

Posted by la...@apache.org.
Changed according to AIRAVATA-1634 in clone fix. AIRAVATA-1631 

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/7d57c098
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/7d57c098
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/7d57c098

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 7d57c09865be7da0dff3ec506e5b6bd00cbf9268
Parents: f708304
Author: raminder <ra...@apache.org>
Authored: Tue Mar 17 12:41:28 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Tue Mar 17 12:41:28 2015 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java    | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/7d57c098/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 5dcea2e..9c3e049 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -385,18 +385,16 @@ public class BetterGfacImpl implements GFac,Watcher {
 
         for (OutputDataObjectType objectType : taskOutputs){
             if (objectType.getType() == DataType.URI && objectType.getValue() != null){
-                // this should be also the relative path : in case of clone, this will contain full path
                 String filePath = objectType.getValue();
-                if(objectType.getLocation() == null && objectType.getLocation().isEmpty() && filePath.contains(File.separator)){
-                filePath = jobExecutionContext.getOutputDir() + File.separator + filePath.substring(filePath.lastIndexOf(File.separatorChar) + 1, filePath.length());
-                }
-                //output is not in working folder
+                // if output is not in working folder
                 if (objectType.getLocation() != null && !objectType.getLocation().isEmpty()) {
                 	if(objectType.getLocation().startsWith(File.separator)){
                 		filePath = objectType.getLocation() + File.separator + filePath;
                     }else{
                     	filePath = jobExecutionContext.getOutputDir() + File.separator + objectType.getLocation() + File.separator + filePath;
                     }
+                }else{
+                	filePath = jobExecutionContext.getOutputDir() + File.separator + filePath;
                 }
                 objectType.setValue(filePath);
                 


[58/62] [abbrv] airavata git commit: Fixed AIRAVATA-1633.

Posted by la...@apache.org.
Fixed AIRAVATA-1633.

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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: d09957ba1b8c4b19c59349defccc9382a483619c
Parents: 5749f12
Author: raminder <ra...@apache.org>
Authored: Tue Mar 17 10:40:46 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Tue Mar 17 10:40:46 2015 -0400

----------------------------------------------------------------------
 .../server/src/main/resources/PBSTemplate.xslt  | 25 ++++++++++----------
 .../server/src/main/resources/SGETemplate.xslt  | 18 +++++++-------
 .../src/main/resources/SLURMTemplate.xslt       | 22 ++++++++---------
 3 files changed, 33 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d09957ba/modules/configuration/server/src/main/resources/PBSTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/PBSTemplate.xslt b/modules/configuration/server/src/main/resources/PBSTemplate.xslt
index 7676883..fe94ef1 100644
--- a/modules/configuration/server/src/main/resources/PBSTemplate.xslt
+++ b/modules/configuration/server/src/main/resources/PBSTemplate.xslt
@@ -12,51 +12,51 @@
 #! /bin/sh
 # PBS batch job submission script generated by Apache Airavata
 #   <xsl:choose>
-    <xsl:when test="ns:shellName">
-##PBS -S <xsl:value-of select="ns:shellName"/>
+    <xsl:when test="ns:shellName != ''">
+#PBS -S <xsl:value-of select="ns:shellName"/>
     </xsl:when></xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:queueName">
+    <xsl:when test="ns:queueName != ''">
 #PBS -q <xsl:value-of select="ns:queueName"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-        <xsl:when test="ns:jobName">
+        <xsl:when test="ns:jobName != ''">
 #PBS -N <xsl:value-of select="ns:jobName"/>
         </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:mailOptions">
+    <xsl:when test="ns:mailOptions != ''">
 #PBS -m <xsl:value-of select="ns:mailOptions"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:mailAddress">
+    <xsl:when test="ns:mailAddress != ''">
 #PBS -M <xsl:value-of select="ns:mailAddress"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-<xsl:when test="ns:acountString">
+<xsl:when test="ns:acountString != ''">
 #PBS -A <xsl:value-of select="ns:acountString"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:maxWallTime">
+    <xsl:when test="ns:maxWallTime != ''">
 #PBS -l walltime=<xsl:value-of select="ns:maxWallTime"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
+    <xsl:when test="ns:standardOutFile != ''">
 #PBS -o <xsl:value-of select="ns:standardOutFile"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
+    <xsl:when test="ns:standardOutFile != ''">
 #PBS -e <xsl:value-of select="ns:standardErrorFile"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-        <xsl:when test="ns:usedMem">
+        <xsl:when test="ns:usedMem != ''">
             #PBS -l mem=<xsl:value-of select="ns:usedMem"/>
         </xsl:when>
     </xsl:choose>
@@ -96,6 +96,7 @@ cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text
       <xsl:value-of select="."/><xsl:text>   </xsl:text>
 </xsl:for-each>
     <xsl:text>&#xa;</xsl:text>
-R</xsl:template>
+~/rabbitmq-java-client-bin-3.3.5/runjava.sh com.rabbitmq.examples.SimpleProducer amqp://<xsl:value-of select="ns:callBackIp"/><xsl:text> </xsl:text><xsl:value-of select="ns:userName"/>,<xsl:value-of select="ns:jobName"/><xsl:text> </xsl:text><xsl:value-of select="$quote"/><xsl:value-of select="$quote"/><xsl:text> </xsl:text><xsl:value-of select="ns:callBackPort"/>
+</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d09957ba/modules/configuration/server/src/main/resources/SGETemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/SGETemplate.xslt b/modules/configuration/server/src/main/resources/SGETemplate.xslt
index 15c6d14..0658b35 100644
--- a/modules/configuration/server/src/main/resources/SGETemplate.xslt
+++ b/modules/configuration/server/src/main/resources/SGETemplate.xslt
@@ -12,47 +12,47 @@
     #! /bin/bash
 # Grid Engine batch job script built by Apache Airavata
 #   <xsl:choose>
-    <xsl:when test="ns:shellName">
+    <xsl:when test="ns:shellName != ''">
 #$ -S <xsl:value-of select="ns:shellName"/>
     </xsl:when></xsl:choose>
 #$ -V
     <xsl:choose>
-    <xsl:when test="ns:queueName">
+    <xsl:when test="ns:queueName != ''">
 #$ -q <xsl:value-of select="ns:queueName"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:mailOptions">
+    <xsl:when test="ns:mailOptions != ''">
 #$ -m <xsl:value-of select="ns:mailOptions"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:mailAddress">
+    <xsl:when test="ns:mailAddress != ''">
 #$ -M <xsl:value-of select="ns:mailAddress"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-<xsl:when test="ns:acountString">
+<xsl:when test="ns:acountString != ''">
 #$ -A <xsl:value-of select="ns:acountString"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:maxWallTime">
+    <xsl:when test="ns:maxWallTime != ''">
 #$ -l h_rt=<xsl:value-of select="ns:maxWallTime"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:jobName">
+    <xsl:when test="ns:jobName != ''">
 #$ -N <xsl:value-of select="ns:jobName"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
+    <xsl:when test="ns:standardOutFile != ''">
 #$ -o <xsl:value-of select="ns:standardOutFile"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
+    <xsl:when test="ns:standardOutFile != ''">
 #$ -e <xsl:value-of select="ns:standardErrorFile"/>
     </xsl:when>
     </xsl:choose>

http://git-wip-us.apache.org/repos/asf/airavata/blob/d09957ba/modules/configuration/server/src/main/resources/SLURMTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/SLURMTemplate.xslt b/modules/configuration/server/src/main/resources/SLURMTemplate.xslt
index 1ca12df..ecafbc2 100644
--- a/modules/configuration/server/src/main/resources/SLURMTemplate.xslt
+++ b/modules/configuration/server/src/main/resources/SLURMTemplate.xslt
@@ -10,57 +10,57 @@
 <xsl:template match="/ns:JobDescriptor">
     <xsl:param name="quote">"</xsl:param>
     <xsl:choose>
-<xsl:when test="ns:shellName">
+<xsl:when test="ns:shellName != ''">
 #!<xsl:value-of select="ns:shellName"/>
     </xsl:when>
     </xsl:choose>
 <xsl:choose>
-    <xsl:when test="ns:queueName">
+    <xsl:when test="ns:queueName != ''">
 #SBATCH -p <xsl:value-of select="ns:queueName"/>
     </xsl:when>
     </xsl:choose>
 <xsl:choose>
-    <xsl:when test="ns:nodes">
+    <xsl:when test="ns:nodes != ''">
 #SBATCH -N <xsl:value-of select="ns:nodes"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:cpuCount">
+    <xsl:when test="ns:cpuCount != ''">
 #SBATCH -n <xsl:value-of select="ns:cpuCount"/>
         </xsl:when>
         </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:mailAddress">
+    <xsl:when test="ns:mailAddress != ''">
 #SBATCH -mail-user=<xsl:value-of select="ns:mailAddress"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:mailType">
+    <xsl:when test="ns:mailType != ''">
 #SBATCH -mail-type=<xsl:value-of select="ns:mailType"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-<xsl:when test="ns:acountString">
+<xsl:when test="ns:acountString != ''">
 #SBATCH -A <xsl:value-of select="ns:acountString"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:maxWallTime">
+    <xsl:when test="ns:maxWallTime != ''">
 #SBATCH -t <xsl:value-of select="ns:maxWallTime"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:jobName">
+    <xsl:when test="ns:jobName != ''">
 #SBATCH -J <xsl:value-of select="ns:jobName"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
+    <xsl:when test="ns:standardOutFile != ''">
 #SBATCH -o <xsl:value-of select="ns:standardOutFile"/>
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
+    <xsl:when test="ns:standardOutFile != ''">
 #SBATCH -e <xsl:value-of select="ns:standardErrorFile"/>
     </xsl:when>
     </xsl:choose>


[08/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
new file mode 100644
index 0000000..2b8858e
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
@@ -0,0 +1,55 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class cs_cpi_serviceConstants {
+
+  public static final String CS_CPI_VERSION = "0.15.0";
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java
new file mode 100644
index 0000000..93b4e94
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java
@@ -0,0 +1,53 @@
+/*
+ *
+ * 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.credential.store.credential;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Any audit information related to a credential.
+ */
+public interface AuditInfo extends Serializable {
+
+    /**
+     * Gets the community user associated with the credential.
+     * 
+     * @return The community user associated with the credential.
+     */
+    public CommunityUser getCommunityUser();
+
+    /**
+     * The portal user associated with the credential.
+     * 
+     * @return The portal user name.
+     */
+    public String getPortalUserId();
+
+    /**
+     * Get the time which credentials are persisted.
+     * 
+     * @return Time credentials are persisted.
+     */
+    public Date getTimePersisted();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java
new file mode 100644
index 0000000..2856f36
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * 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.credential.store.credential;
+
+import java.io.Serializable;
+
+/**
+ * Represents the community user.
+ */
+public class CommunityUser implements Serializable {
+
+    static final long serialVersionUID = 5783370135149452010L;
+
+    private String gatewayName;
+    private String userName;
+    private String userEmail;
+
+    public String getGatewayName() {
+        return gatewayName;
+    }
+
+    public void setGatewayName(String gatewayName) {
+        this.gatewayName = gatewayName;
+    }
+
+    public String getUserEmail() {
+        return userEmail;
+    }
+
+    public void setUserEmail(String userEmail) {
+        this.userEmail = userEmail;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public CommunityUser(String gatewayName, String userName, String userEmail) {
+        this.gatewayName = gatewayName;
+        this.userName = userName;
+        this.userEmail = userEmail;
+    }
+
+    public CommunityUser(String gatewayName, String userName) {
+        this.gatewayName = gatewayName;
+        this.userName = userName;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/Credential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/Credential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/Credential.java
new file mode 100644
index 0000000..4f04123
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/Credential.java
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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.credential.store.credential;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.util.Date;
+
+/**
+ * This class represents the actual credential. The credential can be a certificate, user name password or a SSH key. As
+ * per now we only have certificate implementation.
+ */
+public abstract class Credential implements Serializable {
+
+    private String portalUserName;
+    private Date persistedTime;
+    private String token;
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    public void setPortalUserName(String userName) {
+        portalUserName = userName;
+    }
+
+    public String getPortalUserName() {
+        return portalUserName;
+    }
+
+    public void setCertificateRequestedTime(Date ts) {
+        persistedTime = ts;
+    }
+
+    public Date getCertificateRequestedTime() {
+        return persistedTime;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java
new file mode 100644
index 0000000..17ddb3f
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java
@@ -0,0 +1,101 @@
+/*
+ *
+ * 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.credential.store.credential.impl.certificate;
+
+import org.apache.airavata.credential.store.credential.AuditInfo;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Date;
+
+/**
+ * Audit information related to community credential.
+ */
+@XmlRootElement
+public class CertificateAuditInfo implements AuditInfo {
+
+    private static final long serialVersionUID = 13213123L;
+
+    private String gatewayName;
+    private String communityUserName;
+    private String portalUserName;
+    private Date credentialsRequestedTime;
+    private String notBefore;
+    private String notAfter;
+    private long credentialLifeTime;
+
+    public String getGatewayName() {
+        return gatewayName;
+    }
+
+    public void setGatewayName(String gatewayName) {
+        this.gatewayName = gatewayName;
+    }
+
+    public void setCommunityUserName(String communityUserName) {
+        this.communityUserName = communityUserName;
+    }
+
+    public void setPortalUserName(String portalUserName) {
+        this.portalUserName = portalUserName;
+    }
+
+    public void setCredentialsRequestedTime(Date credentialsRequestedTime) {
+        this.credentialsRequestedTime = credentialsRequestedTime;
+    }
+
+    public String getNotBefore() {
+        return notBefore;
+    }
+
+    public void setNotBefore(String notBefore) {
+        this.notBefore = notBefore;
+    }
+
+    public String getNotAfter() {
+        return notAfter;
+    }
+
+    public void setNotAfter(String notAfter) {
+        this.notAfter = notAfter;
+    }
+
+    public long getCredentialLifeTime() {
+        return credentialLifeTime;
+    }
+
+    public void setCredentialLifeTime(long credentialLifeTime) {
+        this.credentialLifeTime = credentialLifeTime;
+    }
+
+    public CommunityUser getCommunityUser() {
+        return new CommunityUser(gatewayName, communityUserName);
+    }
+
+    public String getPortalUserId() {
+        return portalUserName;
+    }
+
+    public Date getTimePersisted() {
+        return credentialsRequestedTime;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java
new file mode 100644
index 0000000..16c3351
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java
@@ -0,0 +1,102 @@
+/*
+ *
+ * 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.credential.store.credential.impl.certificate;
+
+import org.apache.airavata.credential.store.credential.CommunityUser;
+import org.apache.airavata.credential.store.credential.Credential;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+/**
+ * Represents the certificate credentials.
+ */
+public class CertificateCredential extends Credential {
+
+    static final long serialVersionUID = 6603675553790734432L;
+
+    /**
+     * The community user associated with this credentials.
+     */
+    private CommunityUser communityUser;
+
+    private String notAfter;
+
+    private X509Certificate[] certificates;
+
+    private PrivateKey privateKey;
+
+    private long lifeTime;
+
+    private String notBefore;
+
+    public CertificateCredential() {
+    }
+
+    public String getNotBefore() {
+        return notBefore;
+    }
+
+    public void setNotBefore(String notBefore) {
+        this.notBefore = notBefore;
+    }
+
+    public String getNotAfter() {
+        return notAfter;
+    }
+
+    public void setNotAfter(String notAfter) {
+        this.notAfter = notAfter;
+    }
+
+    public PrivateKey getPrivateKey() {
+        return privateKey;
+    }
+
+    public void setPrivateKey(PrivateKey privateKey) {
+        this.privateKey = privateKey;
+    }
+
+    public X509Certificate[] getCertificates() {
+        return certificates;
+    }
+
+    public void setCertificates(X509Certificate[] certificate) {
+        this.certificates = certificate;
+    }
+
+    public long getLifeTime() {
+        return lifeTime;
+    }
+
+    public void setLifeTime(long lifeTime) {
+        this.lifeTime = lifeTime;
+    }
+
+    public CommunityUser getCommunityUser() {
+        return communityUser;
+    }
+
+    public void setCommunityUser(CommunityUser communityUser) {
+        this.communityUser = communityUser;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java
new file mode 100644
index 0000000..a31c98b
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java
@@ -0,0 +1,53 @@
+/*
+ *
+ * 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.credential.store.credential.impl.password;
+
+import org.apache.airavata.credential.store.credential.Credential;
+import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
+
+import java.util.Date;
+
+/**
+ * User name password credentials.
+ */
+public class PasswordCredential extends SSHCredential {
+
+    private String userName;
+    private String password;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java
new file mode 100644
index 0000000..d41af21
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java
@@ -0,0 +1,88 @@
+/*
+ *
+ * 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.credential.store.credential.impl.ssh;
+
+import org.apache.airavata.credential.store.credential.Credential;
+import java.io.Serializable;
+
+/**
+ * An SSH Credential class which is an extension of Airavata Credential 
+ */
+public class SSHCredential extends Credential implements Serializable {
+
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1277154647420198981L;
+	
+	private byte[] privatekey;
+    private byte[] publicKey;
+    private String passphrase;
+    private String gateway;
+    private String username;
+
+
+    public SSHCredential() {
+    }
+
+    public SSHCredential(byte[] privatekey, byte[] publicKey, String passphrase, String gateway,String username) {
+        this.privatekey = privatekey;
+        this.publicKey = publicKey;
+        this.passphrase = passphrase;
+        this.gateway = gateway;
+        this.username = username;
+        this.setPortalUserName(username);
+    }
+
+    public byte[] getPrivateKey() {
+        return privatekey;
+    }
+
+    public void setPrivateKey(byte[] privatekey) {
+        this.privatekey = privatekey;
+    }
+
+    public byte[] getPublicKey() {
+        return publicKey;
+    }
+
+    public void setPublicKey(byte[] pubKey) {
+        this.publicKey = pubKey;
+    }
+
+    public String getPassphrase() {
+        return passphrase;
+    }
+
+    public void setPassphrase(String passphrase) {
+        this.passphrase = passphrase;
+    }
+
+	public String getGateway() {
+		return gateway;
+	}
+
+	public void setGateway(String gateway) {
+		this.gateway = gateway;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java
new file mode 100644
index 0000000..ac1f0df
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java
@@ -0,0 +1,103 @@
+/*
+ *
+ * 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.credential.store.credential.impl.ssh;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.airavata.credential.store.store.impl.SSHCredentialWriter;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.KeyPair;
+
+/**
+ * A class which generates an SSH credential
+ */
+public class SSHCredentialGenerator {
+	
+	private static Logger logger = LoggerFactory.getLogger(SSHCredentialWriter.class);
+	
+	/**
+	 * 
+	 * @return a SSH Credential generated and encrypted using a randomly generated password
+	 * @throws CredentialStoreException 
+	 */
+	public SSHCredential generateCredential(String tokenId) throws CredentialStoreException {
+        JSch jsch=new JSch();
+        try {
+            KeyPair kpair=KeyPair.genKeyPair(jsch, KeyPair.RSA);
+            File file;
+			
+				file = File.createTempFile("id_rsa", "");
+			
+            String fileName = file.getAbsolutePath();
+
+            String password = generateRandomString();
+            // We are encrypting the private key with the hash of (tokenId+password). 
+            // Any client which wants to use this private key will also generate a hash and then use it to decrypt the key.  
+            kpair.writePrivateKey(fileName,password.getBytes());
+            kpair.writePublicKey(fileName + ".pub"  , "");
+            kpair.dispose();
+            byte[] priKey = FileUtils.readFileToByteArray(new File(fileName));
+            byte[] pubKey = FileUtils.readFileToByteArray(new File(fileName + ".pub"));
+            SSHCredential sshCredential = new SSHCredential();
+            sshCredential.setPrivateKey(priKey);
+            sshCredential.setPublicKey(pubKey);
+            sshCredential.setPassphrase(password);
+            return sshCredential;
+		} catch (IOException e) {
+			logger.error("IO Exception when creating SSH credential ",e);
+			throw new CredentialStoreException("Unable to generate SSH Credential", e);
+		} catch (JSchException e) {
+			logger.error("JSch SSH credential creation exception ",e);
+			throw new CredentialStoreException("Unable to generate SSH Credential. JSch exception ", e);
+		}
+	}
+	
+	private String generateHash(String tokenId, String password) {
+        byte[] bytesOfMessage = new byte[0];
+        try {
+            bytesOfMessage = password.getBytes("UTF-8");
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            return new String( md.digest(bytesOfMessage));
+        } catch (UnsupportedEncodingException e) {
+            logger.error(e.getMessage(), e);
+        } catch (NoSuchAlgorithmException e) {
+            logger.error(e.getMessage(), e);
+        }
+        return  null;
+    }
+
+	// Generate a random alphanumberic string of 16 characters length
+	private String generateRandomString() {
+		return RandomStringUtils.randomAlphanumeric(16);
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
new file mode 100644
index 0000000..ae37b1d
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
@@ -0,0 +1,1104 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CertificateCredential implements org.apache.thrift.TBase<CertificateCredential, CertificateCredential._Fields>, java.io.Serializable, Cloneable, Comparable<CertificateCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CertificateCredential");
+
+  private static final org.apache.thrift.protocol.TField COMMUNITY_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("communityUser", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+  private static final org.apache.thrift.protocol.TField X509_CERT_FIELD_DESC = new org.apache.thrift.protocol.TField("x509Cert", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField NOT_AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("notAfter", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField LIFE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lifeTime", org.apache.thrift.protocol.TType.I64, (short)5);
+  private static final org.apache.thrift.protocol.TField NOT_BEFORE_FIELD_DESC = new org.apache.thrift.protocol.TField("notBefore", org.apache.thrift.protocol.TType.STRING, (short)6);
+  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)7);
+  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)8);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new CertificateCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new CertificateCredentialTupleSchemeFactory());
+  }
+
+  public CommunityUser communityUser; // required
+  public String x509Cert; // required
+  public String notAfter; // optional
+  public String privateKey; // optional
+  public long lifeTime; // optional
+  public String notBefore; // optional
+  public long persistedTime; // optional
+  public String token; // optional
+
+  /** 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 {
+    COMMUNITY_USER((short)1, "communityUser"),
+    X509_CERT((short)2, "x509Cert"),
+    NOT_AFTER((short)3, "notAfter"),
+    PRIVATE_KEY((short)4, "privateKey"),
+    LIFE_TIME((short)5, "lifeTime"),
+    NOT_BEFORE((short)6, "notBefore"),
+    PERSISTED_TIME((short)7, "persistedTime"),
+    TOKEN((short)8, "token");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // COMMUNITY_USER
+          return COMMUNITY_USER;
+        case 2: // X509_CERT
+          return X509_CERT;
+        case 3: // NOT_AFTER
+          return NOT_AFTER;
+        case 4: // PRIVATE_KEY
+          return PRIVATE_KEY;
+        case 5: // LIFE_TIME
+          return LIFE_TIME;
+        case 6: // NOT_BEFORE
+          return NOT_BEFORE;
+        case 7: // PERSISTED_TIME
+          return PERSISTED_TIME;
+        case 8: // TOKEN
+          return TOKEN;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __LIFETIME_ISSET_ID = 0;
+  private static final int __PERSISTEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.NOT_AFTER,_Fields.PRIVATE_KEY,_Fields.LIFE_TIME,_Fields.NOT_BEFORE,_Fields.PERSISTED_TIME,_Fields.TOKEN};
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.COMMUNITY_USER, new org.apache.thrift.meta_data.FieldMetaData("communityUser", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CommunityUser.class)));
+    tmpMap.put(_Fields.X509_CERT, new org.apache.thrift.meta_data.FieldMetaData("x509Cert", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.NOT_AFTER, new org.apache.thrift.meta_data.FieldMetaData("notAfter", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.LIFE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lifeTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.NOT_BEFORE, new org.apache.thrift.meta_data.FieldMetaData("notBefore", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CertificateCredential.class, metaDataMap);
+  }
+
+  public CertificateCredential() {
+  }
+
+  public CertificateCredential(
+    CommunityUser communityUser,
+    String x509Cert)
+  {
+    this();
+    this.communityUser = communityUser;
+    this.x509Cert = x509Cert;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CertificateCredential(CertificateCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetCommunityUser()) {
+      this.communityUser = new CommunityUser(other.communityUser);
+    }
+    if (other.isSetX509Cert()) {
+      this.x509Cert = other.x509Cert;
+    }
+    if (other.isSetNotAfter()) {
+      this.notAfter = other.notAfter;
+    }
+    if (other.isSetPrivateKey()) {
+      this.privateKey = other.privateKey;
+    }
+    this.lifeTime = other.lifeTime;
+    if (other.isSetNotBefore()) {
+      this.notBefore = other.notBefore;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public CertificateCredential deepCopy() {
+    return new CertificateCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.communityUser = null;
+    this.x509Cert = null;
+    this.notAfter = null;
+    this.privateKey = null;
+    setLifeTimeIsSet(false);
+    this.lifeTime = 0;
+    this.notBefore = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public CommunityUser getCommunityUser() {
+    return this.communityUser;
+  }
+
+  public CertificateCredential setCommunityUser(CommunityUser communityUser) {
+    this.communityUser = communityUser;
+    return this;
+  }
+
+  public void unsetCommunityUser() {
+    this.communityUser = null;
+  }
+
+  /** Returns true if field communityUser is set (has been assigned a value) and false otherwise */
+  public boolean isSetCommunityUser() {
+    return this.communityUser != null;
+  }
+
+  public void setCommunityUserIsSet(boolean value) {
+    if (!value) {
+      this.communityUser = null;
+    }
+  }
+
+  public String getX509Cert() {
+    return this.x509Cert;
+  }
+
+  public CertificateCredential setX509Cert(String x509Cert) {
+    this.x509Cert = x509Cert;
+    return this;
+  }
+
+  public void unsetX509Cert() {
+    this.x509Cert = null;
+  }
+
+  /** Returns true if field x509Cert is set (has been assigned a value) and false otherwise */
+  public boolean isSetX509Cert() {
+    return this.x509Cert != null;
+  }
+
+  public void setX509CertIsSet(boolean value) {
+    if (!value) {
+      this.x509Cert = null;
+    }
+  }
+
+  public String getNotAfter() {
+    return this.notAfter;
+  }
+
+  public CertificateCredential setNotAfter(String notAfter) {
+    this.notAfter = notAfter;
+    return this;
+  }
+
+  public void unsetNotAfter() {
+    this.notAfter = null;
+  }
+
+  /** Returns true if field notAfter is set (has been assigned a value) and false otherwise */
+  public boolean isSetNotAfter() {
+    return this.notAfter != null;
+  }
+
+  public void setNotAfterIsSet(boolean value) {
+    if (!value) {
+      this.notAfter = null;
+    }
+  }
+
+  public String getPrivateKey() {
+    return this.privateKey;
+  }
+
+  public CertificateCredential setPrivateKey(String privateKey) {
+    this.privateKey = privateKey;
+    return this;
+  }
+
+  public void unsetPrivateKey() {
+    this.privateKey = null;
+  }
+
+  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
+  public boolean isSetPrivateKey() {
+    return this.privateKey != null;
+  }
+
+  public void setPrivateKeyIsSet(boolean value) {
+    if (!value) {
+      this.privateKey = null;
+    }
+  }
+
+  public long getLifeTime() {
+    return this.lifeTime;
+  }
+
+  public CertificateCredential setLifeTime(long lifeTime) {
+    this.lifeTime = lifeTime;
+    setLifeTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetLifeTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIFETIME_ISSET_ID);
+  }
+
+  /** Returns true if field lifeTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetLifeTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __LIFETIME_ISSET_ID);
+  }
+
+  public void setLifeTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIFETIME_ISSET_ID, value);
+  }
+
+  public String getNotBefore() {
+    return this.notBefore;
+  }
+
+  public CertificateCredential setNotBefore(String notBefore) {
+    this.notBefore = notBefore;
+    return this;
+  }
+
+  public void unsetNotBefore() {
+    this.notBefore = null;
+  }
+
+  /** Returns true if field notBefore is set (has been assigned a value) and false otherwise */
+  public boolean isSetNotBefore() {
+    return this.notBefore != null;
+  }
+
+  public void setNotBeforeIsSet(boolean value) {
+    if (!value) {
+      this.notBefore = null;
+    }
+  }
+
+  public long getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public CertificateCredential setPersistedTime(long persistedTime) {
+    this.persistedTime = persistedTime;
+    setPersistedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetPersistedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetPersistedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  public void setPersistedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
+  }
+
+  public String getToken() {
+    return this.token;
+  }
+
+  public CertificateCredential setToken(String token) {
+    this.token = token;
+    return this;
+  }
+
+  public void unsetToken() {
+    this.token = null;
+  }
+
+  /** Returns true if field token is set (has been assigned a value) and false otherwise */
+  public boolean isSetToken() {
+    return this.token != null;
+  }
+
+  public void setTokenIsSet(boolean value) {
+    if (!value) {
+      this.token = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case COMMUNITY_USER:
+      if (value == null) {
+        unsetCommunityUser();
+      } else {
+        setCommunityUser((CommunityUser)value);
+      }
+      break;
+
+    case X509_CERT:
+      if (value == null) {
+        unsetX509Cert();
+      } else {
+        setX509Cert((String)value);
+      }
+      break;
+
+    case NOT_AFTER:
+      if (value == null) {
+        unsetNotAfter();
+      } else {
+        setNotAfter((String)value);
+      }
+      break;
+
+    case PRIVATE_KEY:
+      if (value == null) {
+        unsetPrivateKey();
+      } else {
+        setPrivateKey((String)value);
+      }
+      break;
+
+    case LIFE_TIME:
+      if (value == null) {
+        unsetLifeTime();
+      } else {
+        setLifeTime((Long)value);
+      }
+      break;
+
+    case NOT_BEFORE:
+      if (value == null) {
+        unsetNotBefore();
+      } else {
+        setNotBefore((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Long)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case COMMUNITY_USER:
+      return getCommunityUser();
+
+    case X509_CERT:
+      return getX509Cert();
+
+    case NOT_AFTER:
+      return getNotAfter();
+
+    case PRIVATE_KEY:
+      return getPrivateKey();
+
+    case LIFE_TIME:
+      return Long.valueOf(getLifeTime());
+
+    case NOT_BEFORE:
+      return getNotBefore();
+
+    case PERSISTED_TIME:
+      return Long.valueOf(getPersistedTime());
+
+    case TOKEN:
+      return getToken();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case COMMUNITY_USER:
+      return isSetCommunityUser();
+    case X509_CERT:
+      return isSetX509Cert();
+    case NOT_AFTER:
+      return isSetNotAfter();
+    case PRIVATE_KEY:
+      return isSetPrivateKey();
+    case LIFE_TIME:
+      return isSetLifeTime();
+    case NOT_BEFORE:
+      return isSetNotBefore();
+    case PERSISTED_TIME:
+      return isSetPersistedTime();
+    case TOKEN:
+      return isSetToken();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof CertificateCredential)
+      return this.equals((CertificateCredential)that);
+    return false;
+  }
+
+  public boolean equals(CertificateCredential that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_communityUser = true && this.isSetCommunityUser();
+    boolean that_present_communityUser = true && that.isSetCommunityUser();
+    if (this_present_communityUser || that_present_communityUser) {
+      if (!(this_present_communityUser && that_present_communityUser))
+        return false;
+      if (!this.communityUser.equals(that.communityUser))
+        return false;
+    }
+
+    boolean this_present_x509Cert = true && this.isSetX509Cert();
+    boolean that_present_x509Cert = true && that.isSetX509Cert();
+    if (this_present_x509Cert || that_present_x509Cert) {
+      if (!(this_present_x509Cert && that_present_x509Cert))
+        return false;
+      if (!this.x509Cert.equals(that.x509Cert))
+        return false;
+    }
+
+    boolean this_present_notAfter = true && this.isSetNotAfter();
+    boolean that_present_notAfter = true && that.isSetNotAfter();
+    if (this_present_notAfter || that_present_notAfter) {
+      if (!(this_present_notAfter && that_present_notAfter))
+        return false;
+      if (!this.notAfter.equals(that.notAfter))
+        return false;
+    }
+
+    boolean this_present_privateKey = true && this.isSetPrivateKey();
+    boolean that_present_privateKey = true && that.isSetPrivateKey();
+    if (this_present_privateKey || that_present_privateKey) {
+      if (!(this_present_privateKey && that_present_privateKey))
+        return false;
+      if (!this.privateKey.equals(that.privateKey))
+        return false;
+    }
+
+    boolean this_present_lifeTime = true && this.isSetLifeTime();
+    boolean that_present_lifeTime = true && that.isSetLifeTime();
+    if (this_present_lifeTime || that_present_lifeTime) {
+      if (!(this_present_lifeTime && that_present_lifeTime))
+        return false;
+      if (this.lifeTime != that.lifeTime)
+        return false;
+    }
+
+    boolean this_present_notBefore = true && this.isSetNotBefore();
+    boolean that_present_notBefore = true && that.isSetNotBefore();
+    if (this_present_notBefore || that_present_notBefore) {
+      if (!(this_present_notBefore && that_present_notBefore))
+        return false;
+      if (!this.notBefore.equals(that.notBefore))
+        return false;
+    }
+
+    boolean this_present_persistedTime = true && this.isSetPersistedTime();
+    boolean that_present_persistedTime = true && that.isSetPersistedTime();
+    if (this_present_persistedTime || that_present_persistedTime) {
+      if (!(this_present_persistedTime && that_present_persistedTime))
+        return false;
+      if (this.persistedTime != that.persistedTime)
+        return false;
+    }
+
+    boolean this_present_token = true && this.isSetToken();
+    boolean that_present_token = true && that.isSetToken();
+    if (this_present_token || that_present_token) {
+      if (!(this_present_token && that_present_token))
+        return false;
+      if (!this.token.equals(that.token))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CertificateCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetCommunityUser()).compareTo(other.isSetCommunityUser());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCommunityUser()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.communityUser, other.communityUser);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetX509Cert()).compareTo(other.isSetX509Cert());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetX509Cert()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.x509Cert, other.x509Cert);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetNotAfter()).compareTo(other.isSetNotAfter());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetNotAfter()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notAfter, other.notAfter);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPrivateKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetLifeTime()).compareTo(other.isSetLifeTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetLifeTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lifeTime, other.lifeTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetNotBefore()).compareTo(other.isSetNotBefore());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetNotBefore()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notBefore, other.notBefore);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPersistedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetToken()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("CertificateCredential(");
+    boolean first = true;
+
+    sb.append("communityUser:");
+    if (this.communityUser == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.communityUser);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("x509Cert:");
+    if (this.x509Cert == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.x509Cert);
+    }
+    first = false;
+    if (isSetNotAfter()) {
+      if (!first) sb.append(", ");
+      sb.append("notAfter:");
+      if (this.notAfter == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.notAfter);
+      }
+      first = false;
+    }
+    if (isSetPrivateKey()) {
+      if (!first) sb.append(", ");
+      sb.append("privateKey:");
+      if (this.privateKey == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.privateKey);
+      }
+      first = false;
+    }
+    if (isSetLifeTime()) {
+      if (!first) sb.append(", ");
+      sb.append("lifeTime:");
+      sb.append(this.lifeTime);
+      first = false;
+    }
+    if (isSetNotBefore()) {
+      if (!first) sb.append(", ");
+      sb.append("notBefore:");
+      if (this.notBefore == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.notBefore);
+      }
+      first = false;
+    }
+    if (isSetPersistedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("persistedTime:");
+      sb.append(this.persistedTime);
+      first = false;
+    }
+    if (isSetToken()) {
+      if (!first) sb.append(", ");
+      sb.append("token:");
+      if (this.token == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.token);
+      }
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (communityUser == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'communityUser' was not present! Struct: " + toString());
+    }
+    if (x509Cert == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'x509Cert' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+    if (communityUser != null) {
+      communityUser.validate();
+    }
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class CertificateCredentialStandardSchemeFactory implements SchemeFactory {
+    public CertificateCredentialStandardScheme getScheme() {
+      return new CertificateCredentialStandardScheme();
+    }
+  }
+
+  private static class CertificateCredentialStandardScheme extends StandardScheme<CertificateCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, CertificateCredential struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // COMMUNITY_USER
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.communityUser = new CommunityUser();
+              struct.communityUser.read(iprot);
+              struct.setCommunityUserIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // X509_CERT
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.x509Cert = iprot.readString();
+              struct.setX509CertIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // NOT_AFTER
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.notAfter = iprot.readString();
+              struct.setNotAfterIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // PRIVATE_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.privateKey = iprot.readString();
+              struct.setPrivateKeyIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // LIFE_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.lifeTime = iprot.readI64();
+              struct.setLifeTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // NOT_BEFORE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.notBefore = iprot.readString();
+              struct.setNotBeforeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.persistedTime = iprot.readI64();
+              struct.setPersistedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // TOKEN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.token = iprot.readString();
+              struct.setTokenIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, CertificateCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.communityUser != null) {
+        oprot.writeFieldBegin(COMMUNITY_USER_FIELD_DESC);
+        struct.communityUser.write(oprot);
+        oprot.writeFieldEnd();
+      }
+      if (struct.x509Cert != null) {
+        oprot.writeFieldBegin(X509_CERT_FIELD_DESC);
+        oprot.writeString(struct.x509Cert);
+        oprot.writeFieldEnd();
+      }
+      if (struct.notAfter != null) {
+        if (struct.isSetNotAfter()) {
+          oprot.writeFieldBegin(NOT_AFTER_FIELD_DESC);
+          oprot.writeString(struct.notAfter);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.privateKey != null) {
+        if (struct.isSetPrivateKey()) {
+          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
+          oprot.writeString(struct.privateKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetLifeTime()) {
+        oprot.writeFieldBegin(LIFE_TIME_FIELD_DESC);
+        oprot.writeI64(struct.lifeTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.notBefore != null) {
+        if (struct.isSetNotBefore()) {
+          oprot.writeFieldBegin(NOT_BEFORE_FIELD_DESC);
+          oprot.writeString(struct.notBefore);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.persistedTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.token != null) {
+        if (struct.isSetToken()) {
+          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
+          oprot.writeString(struct.token);
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class CertificateCredentialTupleSchemeFactory implements SchemeFactory {
+    public CertificateCredentialTupleScheme getScheme() {
+      return new CertificateCredentialTupleScheme();
+    }
+  }
+
+  private static class CertificateCredentialTupleScheme extends TupleScheme<CertificateCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      struct.communityUser.write(oprot);
+      oprot.writeString(struct.x509Cert);
+      BitSet optionals = new BitSet();
+      if (struct.isSetNotAfter()) {
+        optionals.set(0);
+      }
+      if (struct.isSetPrivateKey()) {
+        optionals.set(1);
+      }
+      if (struct.isSetLifeTime()) {
+        optionals.set(2);
+      }
+      if (struct.isSetNotBefore()) {
+        optionals.set(3);
+      }
+      if (struct.isSetPersistedTime()) {
+        optionals.set(4);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(5);
+      }
+      oprot.writeBitSet(optionals, 6);
+      if (struct.isSetNotAfter()) {
+        oprot.writeString(struct.notAfter);
+      }
+      if (struct.isSetPrivateKey()) {
+        oprot.writeString(struct.privateKey);
+      }
+      if (struct.isSetLifeTime()) {
+        oprot.writeI64(struct.lifeTime);
+      }
+      if (struct.isSetNotBefore()) {
+        oprot.writeString(struct.notBefore);
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI64(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.communityUser = new CommunityUser();
+      struct.communityUser.read(iprot);
+      struct.setCommunityUserIsSet(true);
+      struct.x509Cert = iprot.readString();
+      struct.setX509CertIsSet(true);
+      BitSet incoming = iprot.readBitSet(6);
+      if (incoming.get(0)) {
+        struct.notAfter = iprot.readString();
+        struct.setNotAfterIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.privateKey = iprot.readString();
+        struct.setPrivateKeyIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.lifeTime = iprot.readI64();
+        struct.setLifeTimeIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.notBefore = iprot.readString();
+        struct.setNotBeforeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.persistedTime = iprot.readI64();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
new file mode 100644
index 0000000..9b62310
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
@@ -0,0 +1,589 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser");
+
+  private static final org.apache.thrift.protocol.TField GATEWAY_NMAE_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayNmae", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField USER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userEmail", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new CommunityUserStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new CommunityUserTupleSchemeFactory());
+  }
+
+  public String gatewayNmae; // required
+  public String username; // required
+  public String userEmail; // 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 {
+    GATEWAY_NMAE((short)1, "gatewayNmae"),
+    USERNAME((short)2, "username"),
+    USER_EMAIL((short)3, "userEmail");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // GATEWAY_NMAE
+          return GATEWAY_NMAE;
+        case 2: // USERNAME
+          return USERNAME;
+        case 3: // USER_EMAIL
+          return USER_EMAIL;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.GATEWAY_NMAE, new org.apache.thrift.meta_data.FieldMetaData("gatewayNmae", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", 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(CommunityUser.class, metaDataMap);
+  }
+
+  public CommunityUser() {
+  }
+
+  public CommunityUser(
+    String gatewayNmae,
+    String username,
+    String userEmail)
+  {
+    this();
+    this.gatewayNmae = gatewayNmae;
+    this.username = username;
+    this.userEmail = userEmail;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CommunityUser(CommunityUser other) {
+    if (other.isSetGatewayNmae()) {
+      this.gatewayNmae = other.gatewayNmae;
+    }
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetUserEmail()) {
+      this.userEmail = other.userEmail;
+    }
+  }
+
+  public CommunityUser deepCopy() {
+    return new CommunityUser(this);
+  }
+
+  @Override
+  public void clear() {
+    this.gatewayNmae = null;
+    this.username = null;
+    this.userEmail = null;
+  }
+
+  public String getGatewayNmae() {
+    return this.gatewayNmae;
+  }
+
+  public CommunityUser setGatewayNmae(String gatewayNmae) {
+    this.gatewayNmae = gatewayNmae;
+    return this;
+  }
+
+  public void unsetGatewayNmae() {
+    this.gatewayNmae = null;
+  }
+
+  /** Returns true if field gatewayNmae is set (has been assigned a value) and false otherwise */
+  public boolean isSetGatewayNmae() {
+    return this.gatewayNmae != null;
+  }
+
+  public void setGatewayNmaeIsSet(boolean value) {
+    if (!value) {
+      this.gatewayNmae = null;
+    }
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public CommunityUser setUsername(String username) {
+    this.username = username;
+    return this;
+  }
+
+  public void unsetUsername() {
+    this.username = null;
+  }
+
+  /** Returns true if field username is set (has been assigned a value) and false otherwise */
+  public boolean isSetUsername() {
+    return this.username != null;
+  }
+
+  public void setUsernameIsSet(boolean value) {
+    if (!value) {
+      this.username = null;
+    }
+  }
+
+  public String getUserEmail() {
+    return this.userEmail;
+  }
+
+  public CommunityUser setUserEmail(String userEmail) {
+    this.userEmail = userEmail;
+    return this;
+  }
+
+  public void unsetUserEmail() {
+    this.userEmail = null;
+  }
+
+  /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
+  public boolean isSetUserEmail() {
+    return this.userEmail != null;
+  }
+
+  public void setUserEmailIsSet(boolean value) {
+    if (!value) {
+      this.userEmail = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case GATEWAY_NMAE:
+      if (value == null) {
+        unsetGatewayNmae();
+      } else {
+        setGatewayNmae((String)value);
+      }
+      break;
+
+    case USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case USER_EMAIL:
+      if (value == null) {
+        unsetUserEmail();
+      } else {
+        setUserEmail((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case GATEWAY_NMAE:
+      return getGatewayNmae();
+
+    case USERNAME:
+      return getUsername();
+
+    case USER_EMAIL:
+      return getUserEmail();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case GATEWAY_NMAE:
+      return isSetGatewayNmae();
+    case USERNAME:
+      return isSetUsername();
+    case USER_EMAIL:
+      return isSetUserEmail();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof CommunityUser)
+      return this.equals((CommunityUser)that);
+    return false;
+  }
+
+  public boolean equals(CommunityUser that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_gatewayNmae = true && this.isSetGatewayNmae();
+    boolean that_present_gatewayNmae = true && that.isSetGatewayNmae();
+    if (this_present_gatewayNmae || that_present_gatewayNmae) {
+      if (!(this_present_gatewayNmae && that_present_gatewayNmae))
+        return false;
+      if (!this.gatewayNmae.equals(that.gatewayNmae))
+        return false;
+    }
+
+    boolean this_present_username = true && this.isSetUsername();
+    boolean that_present_username = true && that.isSetUsername();
+    if (this_present_username || that_present_username) {
+      if (!(this_present_username && that_present_username))
+        return false;
+      if (!this.username.equals(that.username))
+        return false;
+    }
+
+    boolean this_present_userEmail = true && this.isSetUserEmail();
+    boolean that_present_userEmail = true && that.isSetUserEmail();
+    if (this_present_userEmail || that_present_userEmail) {
+      if (!(this_present_userEmail && that_present_userEmail))
+        return false;
+      if (!this.userEmail.equals(that.userEmail))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CommunityUser other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetGatewayNmae()).compareTo(other.isSetGatewayNmae());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGatewayNmae()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayNmae, other.gatewayNmae);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUsername()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(other.isSetUserEmail());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUserEmail()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, other.userEmail);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("CommunityUser(");
+    boolean first = true;
+
+    sb.append("gatewayNmae:");
+    if (this.gatewayNmae == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.gatewayNmae);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("userEmail:");
+    if (this.userEmail == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.userEmail);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (gatewayNmae == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayNmae' was not present! Struct: " + toString());
+    }
+    if (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+    }
+    if (userEmail == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'userEmail' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class CommunityUserStandardSchemeFactory implements SchemeFactory {
+    public CommunityUserStandardScheme getScheme() {
+      return new CommunityUserStandardScheme();
+    }
+  }
+
+  private static class CommunityUserStandardScheme extends StandardScheme<CommunityUser> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, CommunityUser struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // GATEWAY_NMAE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.gatewayNmae = iprot.readString();
+              struct.setGatewayNmaeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // USERNAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.username = iprot.readString();
+              struct.setUsernameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // USER_EMAIL
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.userEmail = iprot.readString();
+              struct.setUserEmailIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, CommunityUser struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.gatewayNmae != null) {
+        oprot.writeFieldBegin(GATEWAY_NMAE_FIELD_DESC);
+        oprot.writeString(struct.gatewayNmae);
+        oprot.writeFieldEnd();
+      }
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.userEmail != null) {
+        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
+        oprot.writeString(struct.userEmail);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class CommunityUserTupleSchemeFactory implements SchemeFactory {
+    public CommunityUserTupleScheme getScheme() {
+      return new CommunityUserTupleScheme();
+    }
+  }
+
+  private static class CommunityUserTupleScheme extends TupleScheme<CommunityUser> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.gatewayNmae);
+      oprot.writeString(struct.username);
+      oprot.writeString(struct.userEmail);
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.gatewayNmae = iprot.readString();
+      struct.setGatewayNmaeIsSet(true);
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      struct.userEmail = iprot.readString();
+      struct.setUserEmailIsSet(true);
+    }
+  }
+
+}
+


[44/62] [abbrv] airavata git commit: Fixed AIRAVATA-1597

Posted by la...@apache.org.
Fixed AIRAVATA-1597

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/10c5abfd
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/10c5abfd
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/10c5abfd

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 10c5abfdb478c57ba77e0dacdc1b02bec5ff8ed6
Parents: b746118
Author: raminder <ra...@apache.org>
Authored: Tue Mar 10 23:28:34 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Tue Mar 10 23:28:34 2015 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 569 +++++--------------
 1 file changed, 146 insertions(+), 423 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/10c5abfd/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 6110f53..bb914fa 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -293,36 +293,18 @@ public class CreateLaunchExperiment {
     
     public static String createEchoExperimentForFSD(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Input_to_Echo");
-            input.setType(DataType.STRING);
-            input.setValue("Hello World");
-            
-            
-            InputDataObjectType i2 = new InputDataObjectType();
-            i2.setName("Input_to_Echo2");
-            i2.setType(DataType.URI);
-            i2.setValue("http://www.textfiles.com/100/ad.txt");
-            
-            InputDataObjectType i3 = new InputDataObjectType();
-            i3.setName("Input_to_Echo3");
-            i3.setType(DataType.URI);
-            i3.setValue("file:///tmp/test.txt");
-            
-            exInputs.add(input);
-            exInputs.add(i2);
-            exInputs.add(i3);
+        	List<InputDataObjectType> exInputs = client.getApplicationInputs(echoAppId);
+            for (InputDataObjectType inputDataObjectType : exInputs) {
+            	if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo")) {
+                      inputDataObjectType.setValue("Hello World");
+                 }else if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo2")) {
+                    inputDataObjectType.setValue("http://www.textfiles.com/100/ad.txt");
+                }else if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo3")) {
+                    inputDataObjectType.setValue("file:///tmp/test.txt");
+                 }
+            }
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
 
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("Echoed_Output");
-            output.setType(DataType.STRING);
-            output.setValue("test.txt");
-            exOut.add(output);
-            
-            
             Experiment simpleExperiment = 
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho2", echoAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -369,24 +351,18 @@ public class CreateLaunchExperiment {
     
     public static String createMPIExperimentForFSD(Airavata.Client client) throws TException {
         try {
-           
-        	List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Sample_Input");
-            input.setType(DataType.STRING);
-            input.setValue("");
-        	exInputs.add(input);
-            
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("Sample_Output");
-            output.setType(DataType.STRING);
-            output.setValue("");
-            exOut.add(output);
-            
+        	List<InputDataObjectType> exInputs = client.getApplicationInputs(mpiAppId);
+            for (InputDataObjectType inputDataObjectType : exInputs) {
+            	if (inputDataObjectType.getName().equalsIgnoreCase("Sample_Input")) {
+                      inputDataObjectType.setValue("");
+                 }
+            }
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(mpiAppId);
+
+        	  
             Experiment simpleExperiment = 
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "mpiExperiment", "HelloMPI", mpiAppId, null);
-//          simpleExperiment.setExperimentOutputs(exOut);
+          simpleExperiment.setExperimentOutputs(exOut);
             
             
             
@@ -432,43 +408,10 @@ public class CreateLaunchExperiment {
     
     public static String createExperimentWRFStampede(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Config_Namelist_File");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/namelist.input");
-
-            InputDataObjectType input1 = new InputDataObjectType();
-            input1.setName("WRF_Initial_Conditions");
-            input1.setType(DataType.URI);
-            input1.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/wrfinput_d01");
-
-            InputDataObjectType input2 = new InputDataObjectType();
-            input2.setName("WRF_Boundary_File");
-            input2.setType(DataType.URI);
-            input2.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/wrfbdy_d01");
-
-            exInputs.add(input);
-            exInputs.add(input1);
-            exInputs.add(input2);
-
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("WRF_Output");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            OutputDataObjectType output1 = new OutputDataObjectType();
-            output1.setName("WRF_Execution_Log");
-            output1.setType(DataType.URI);
-            output1.setValue("");
-
-
-            exOut.add(output);
-            exOut.add(output1);
-
-
+        	List<InputDataObjectType> exInputs = client.getApplicationInputs(wrfAppId);
+            setWRFInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(wrfAppId);
+       
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "WRFExperiment", "Testing", wrfAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -505,57 +448,26 @@ public class CreateLaunchExperiment {
     }
 
 
-    public static String createExperimentGROMACSStampede(Airavata.Client client) throws TException {
-        try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("GROMOS_Coordinate_File");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/GROMMACS_FILES/pdb1y6l-EM-vacuum.gro");
-
-            InputDataObjectType input1 = new InputDataObjectType();
-            input1.setName("Portable_Input_Binary_File");
-            input1.setType(DataType.URI);
-            input1.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/GROMMACS_FILES/pdb1y6l-EM-vacuum.tpr");
-
-            exInputs.add(input);
-            exInputs.add(input1);
-
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("pdb1y6l-EM-vacuum.tpr.trr");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            OutputDataObjectType output1 = new OutputDataObjectType();
-            output1.setName("pdb1y6l-EM-vacuum.tpr.edr");
-            output1.setType(DataType.URI);
-            output1.setValue("");
-
-            OutputDataObjectType output2 = new OutputDataObjectType();
-            output2.setName("pdb1y6l-EM-vacuum.tpr.log");
-            output2.setType(DataType.URI);
-            output2.setValue("");
-
-            OutputDataObjectType output3 = new OutputDataObjectType();
-            output3.setName("pdb1y6l-EM-vacuum.gro");
-            output3.setType(DataType.URI);
-            output3.setValue("");
-
-            OutputDataObjectType output4 = new OutputDataObjectType();
-            output4.setName("GROMACS.oJobID");
-            output4.setType(DataType.URI);
-            output4.setValue("");
-
-
-            exOut.add(output);
-            exOut.add(output1);
-            exOut.add(output2);
-            exOut.add(output3);
-            exOut.add(output4);
+	private static void setWRFInputs(List<InputDataObjectType> exInputs) {
+		for (InputDataObjectType inputDataObjectType : exInputs) {
+			if (inputDataObjectType.getName().equalsIgnoreCase("Config_Namelist_File")) {
+		          inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/namelist.input");
+		     }else if (inputDataObjectType.getName().equalsIgnoreCase("WRF_Initial_Conditions")) {
+		        inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/wrfinput_d01");
+		    }else if (inputDataObjectType.getName().equalsIgnoreCase("WRF_Boundary_File")) {
+		        inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/wrfbdy_d01");
+		     }
+		}
+	}
 
 
+    public static String createExperimentGROMACSStampede(Airavata.Client client) throws TException {
+        try {
+        	
+        	List<InputDataObjectType> exInputs = client.getApplicationInputs(gromacsAppId);
+        	setGROMACSInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(gromacsAppId);
+       
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "GromacsExperiment", "Testing", gromacsAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -591,69 +503,21 @@ public class CreateLaunchExperiment {
         return null;
     }
 
+    private static void setGROMACSInputs(List<InputDataObjectType> exInputs) {
+    		for (InputDataObjectType inputDataObjectType : exInputs) {
+			if (inputDataObjectType.getName().equalsIgnoreCase("GROMOS_Coordinate_File")) {
+		          inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/GROMMACS_FILES/pdb1y6l-EM-vacuum.gro");
+		     }else if (inputDataObjectType.getName().equalsIgnoreCase("Portable_Input_Binary_File")) {
+		        inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/GROMMACS_FILES/pdb1y6l-EM-vacuum.tpr");
+		    }
+		}
+	}
     public static String createExperimentESPRESSOStampede(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("AI_Pseudopotential_File");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/ESPRESSO_FILES/Al.sample.in");
-
-            InputDataObjectType input1 = new InputDataObjectType();
-            input1.setName("AI_Primitive_Cell");
-            input1.setType(DataType.URI);
-            input1.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/ESPRESSO_FILES/Al.pz-vbc.UPF");
-
-            exInputs.add(input);
-            exInputs.add(input1);
-
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("ESPRESSO_Execution_Log");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            OutputDataObjectType output1 = new OutputDataObjectType();
-            output1.setName("ESPRESSO_WFC_Binary_file");
-            output1.setType(DataType.URI);
-            output1.setValue("");
-
-            OutputDataObjectType output2 = new OutputDataObjectType();
-            output2.setName("Al_exc3.wfc1");
-            output2.setType(DataType.URI);
-            output2.setValue("");
-
-            OutputDataObjectType output3 = new OutputDataObjectType();
-            output3.setName("Al_exc3.wfc2");
-            output3.setType(DataType.URI);
-            output3.setValue("");
-
-            OutputDataObjectType output4 = new OutputDataObjectType();
-            output4.setName("Al_exc3.wfc3");
-            output4.setType(DataType.URI);
-            output4.setValue("");
-
-            OutputDataObjectType output5 = new OutputDataObjectType();
-            output5.setName("Al_exc3.wfc4");
-            output5.setType(DataType.URI);
-            output5.setValue("");
-
-            OutputDataObjectType output6 = new OutputDataObjectType();
-            output6.setName("ESPRESSO.oJobID");
-            output6.setType(DataType.URI);
-            output6.setValue("");
-
-
-            exOut.add(output);
-            exOut.add(output1);
-            exOut.add(output2);
-            exOut.add(output3);
-            exOut.add(output4);
-            exOut.add(output5);
-            exOut.add(output6);
-
-
+         	List<InputDataObjectType> exInputs = client.getApplicationInputs(espressoAppId);
+        	setESPRESSOInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(espressoAppId);
+        
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "EspressoExperiment", "Testing", espressoAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -688,45 +552,22 @@ public class CreateLaunchExperiment {
         }
         return null;
     }
+    private static void setESPRESSOInputs(List<InputDataObjectType> exInputs) {
+    	for (InputDataObjectType inputDataObjectType : exInputs) {
+		if (inputDataObjectType.getName().equalsIgnoreCase("AI_Pseudopotential_File")) {
+	          inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/ESPRESSO_FILES/Al.sample.in");
+	     }else if (inputDataObjectType.getName().equalsIgnoreCase("AI_Primitive_Cell")) {
+	        inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/ESPRESSO_FILES/Al.pz-vbc.UPF");
+	    }
+	}
+}
 
     public static String createExperimentTRINITYStampede(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("RNA_Seq_Left_Input");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/TRINITY_FILES/reads.left.fq");
-
-            InputDataObjectType input1 = new InputDataObjectType();
-            input1.setName("RNA_Seq_Right_Input");
-            input1.setType(DataType.URI);
-            input1.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/TRINITY_FILES/reads.right.fq");
-
-            exInputs.add(input);
-            exInputs.add(input1);
-
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("Trinity_Execution_Log");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            OutputDataObjectType output1 = new OutputDataObjectType();
-            output1.setName("Trinity_FASTA_File");
-            output1.setType(DataType.URI);
-            output1.setValue("");
-
-            OutputDataObjectType output2 = new OutputDataObjectType();
-            output2.setName("Trinity.oJobID");
-            output2.setType(DataType.URI);
-            output2.setValue("");
-
-
-            exOut.add(output);
-            exOut.add(output1);
-            exOut.add(output2);
-
+        	List<InputDataObjectType> exInputs = client.getApplicationInputs(trinityAppId);
+        	setTRINITYInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(trinityAppId);
+            
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "TrinityExperiment", "Testing", trinityAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -761,31 +602,21 @@ public class CreateLaunchExperiment {
         }
         return null;
     }
-
+    private static void setTRINITYInputs(List<InputDataObjectType> exInputs) {
+    	for (InputDataObjectType inputDataObjectType : exInputs) {
+    		if (inputDataObjectType.getName().equalsIgnoreCase("RNA_Seq_Left_Input")) {
+	          inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/TRINITY_FILES/reads.left.fq");
+    		}else if (inputDataObjectType.getName().equalsIgnoreCase("RNA_Seq_Right_Input")) {
+	        inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/TRINITY_FILES/reads.right.fq");
+    		}
+    	}
+    }
     public static String createExperimentLAMMPSStampede(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Friction_Simulation_Input");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/LAMMPS_FILES/in.friction");
-
-            exInputs.add(input);
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("LAMMPS_Simulation_Log");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            OutputDataObjectType output1 = new OutputDataObjectType();
-            output1.setName("LAMMPS.oJobID");
-            output1.setType(DataType.URI);
-            output1.setValue("");
-
-            exOut.add(output);
-            exOut.add(output1);
-
+         	List<InputDataObjectType> exInputs = client.getApplicationInputs(lammpsAppId);
+        	setLAMMPSInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(lammpsAppId);
+            
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "LAMMPSExperiment", "Testing", lammpsAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
@@ -820,24 +651,18 @@ public class CreateLaunchExperiment {
         }
         return null;
     }
-
+    private static void setLAMMPSInputs(List<InputDataObjectType> exInputs) {
+    	for (InputDataObjectType inputDataObjectType : exInputs) {
+    		if (inputDataObjectType.getName().equalsIgnoreCase("Friction_Simulation_Input")) {
+	          inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/LAMMPS_FILES/in.friction");
+    		}
+    	}
+    }
     public static String createExperimentNWCHEMStampede(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Water_Molecule_Input");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/NWCHEM_FILES/water.nw");
-
-            exInputs.add(input);
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("NWChem_Execution_Log");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            exOut.add(output);
+         	List<InputDataObjectType> exInputs = client.getApplicationInputs(nwchemAppId);
+        	setNWCHEMInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(nwchemAppId);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "NWchemExperiment", "Testing", nwchemAppId, exInputs);
@@ -873,96 +698,18 @@ public class CreateLaunchExperiment {
         }
         return null;
     }
+    private static void setNWCHEMInputs(List<InputDataObjectType> exInputs) {
+    	for (InputDataObjectType inputDataObjectType : exInputs) {
+    		if (inputDataObjectType.getName().equalsIgnoreCase("Water_Molecule_Input")) {
+	          inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/NWCHEM_FILES/water.nw");
+    		}
+    	}
+    }
     public static String createExperimentAUTODOCKStampede(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("AD4_parameters.dat");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/AD4_parameters.dat");
-
-            InputDataObjectType input1 = new InputDataObjectType();
-            input1.setName("hsg1.A.map");
-            input1.setType(DataType.URI);
-            input1.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.A.map");
-
-            InputDataObjectType input2 = new InputDataObjectType();
-            input2.setName("hsg1.C.map");
-            input2.setType(DataType.URI);
-            input2.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.C.map");
-
-            InputDataObjectType input3 = new InputDataObjectType();
-            input3.setName("hsg1.d.map");
-            input3.setType(DataType.URI);
-            input3.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.d.map");
-
-            InputDataObjectType input4 = new InputDataObjectType();
-            input4.setName("hsg1.e.map");
-            input4.setType(DataType.URI);
-            input4.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.e.map");
-
-            InputDataObjectType input5 = new InputDataObjectType();
-            input5.setName("hsg1.HD.map");
-            input5.setType(DataType.URI);
-            input5.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.HD.map");
-
-            InputDataObjectType input6 = new InputDataObjectType();
-            input6.setName("hsg1.maps.fld");
-            input6.setType(DataType.URI);
-            input6.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.maps.fld");
-
-            InputDataObjectType input7 = new InputDataObjectType();
-            input7.setName("hsg1.NA.map");
-            input7.setType(DataType.URI);
-            input7.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.NA.map");
-
-            InputDataObjectType input8 = new InputDataObjectType();
-            input8.setName("hsg1.N.map");
-            input8.setType(DataType.URI);
-            input8.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.N.map");
-
-            InputDataObjectType input9 = new InputDataObjectType();
-            input9.setName("hsg1.OA.map");
-            input9.setType(DataType.URI);
-            input9.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.OA.map");
-
-            InputDataObjectType input10 = new InputDataObjectType();
-            input10.setName("ind.dpf");
-            input10.setType(DataType.URI);
-            input10.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/ind.dpf");
-
-            InputDataObjectType input11 = new InputDataObjectType();
-            input11.setName("ind.pdbqt");
-            input11.setType(DataType.URI);
-            input11.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/ind.pdbqt");
-
-
-            exInputs.add(input);
-            exInputs.add(input1);
-            exInputs.add(input2);
-            exInputs.add(input3);
-            exInputs.add(input4);
-            exInputs.add(input5);
-            exInputs.add(input6);
-            exInputs.add(input7);
-            exInputs.add(input8);
-            exInputs.add(input9);
-            exInputs.add(input10);
-            exInputs.add(input11);
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("ind.dlg");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            OutputDataObjectType output1 = new OutputDataObjectType();
-            output1.setName("Autodock.oJobID");
-            output1.setType(DataType.URI);
-            output1.setValue("");
-
-            exOut.add(output);
-            exOut.add(output1);
+        	List<InputDataObjectType> exInputs = client.getApplicationInputs(nwchemAppId);
+        	setAUTODOCKInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(nwchemAppId);
 
             Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "AutoDockExperiment", "Testing", autodockAppId, exInputs);
@@ -998,47 +745,43 @@ public class CreateLaunchExperiment {
         }
         return null;
     }
-
+    private static void setAUTODOCKInputs(List<InputDataObjectType> exInputs) {
+
+    	for (InputDataObjectType inputDataObjectType : exInputs) {
+			if (inputDataObjectType.getName().equalsIgnoreCase("AD4_parameters.dat")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/AD4_parameters.dat");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.A.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.A.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.C.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.C.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.d.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.d.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.e.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.e.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.HD.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.HD.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.maps.fld")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.maps.fld");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.NA.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.NA.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.N.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.N.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("hsg1.OA.map")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/hsg1.OA.map");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("ind.dpf")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/ind.dpf");
+			} else if (inputDataObjectType.getName().equalsIgnoreCase("ind.pdbqt")) {
+				inputDataObjectType.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/AUTODOCK_FILES/ind.pdbqt");
+			}
+		}
+    }
     public static String createExperimentWRFTrestles(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("WRF_Namelist");
-            input.setType(DataType.URI);
-            input.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/namelist.input");
-
-            InputDataObjectType input1 = new InputDataObjectType();
-            input1.setName("WRF_Input_File");
-            input1.setType(DataType.URI);
-            input1.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/wrfinput_d01");
-
-            InputDataObjectType input2 = new InputDataObjectType();
-            input2.setName("WRF_Boundary_File");
-            input2.setType(DataType.URI);
-            input2.setValue("/Users/shameera/Downloads/PHP-Gateway-Scripts/appScripts/WRF_FILES/wrfbdy_d01");
-
-            exInputs.add(input);
-            exInputs.add(input1);
-            exInputs.add(input2);
-
-
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("WRF_Output");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            OutputDataObjectType output1 = new OutputDataObjectType();
-            output1.setName("WRF_Execution_Log");
-            output1.setType(DataType.URI);
-            output1.setValue("");
-
-
-            exOut.add(output);
-            exOut.add(output1);
-
-
-            Experiment simpleExperiment =
+        	List<InputDataObjectType> exInputs = client.getApplicationInputs(wrfAppId);
+            setWRFInputs(exInputs);
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(wrfAppId);
+       
+                    Experiment simpleExperiment =
                     ExperimentModelUtil.createSimpleExperiment("default", "admin", "WRFExperiment", "Testing", wrfAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
 
@@ -1315,19 +1058,14 @@ public class CreateLaunchExperiment {
 
     public static String createExperimentForBR2(Airavata.Client client) throws TException {
         try {
-            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Input_to_Echo");
-            input.setType(DataType.STRING);
-            input.setValue("Echoed_Output=Hello World");
-            exInputs.add(input);
+        	  List<InputDataObjectType> exInputs = client.getApplicationInputs(echoAppId);
+              for (InputDataObjectType inputDataObjectType : exInputs) {
+  				if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo")) {
+  					inputDataObjectType.setValue("Hello World");
+  				} 
+  			}
+  			List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
 
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("Echoed_Output");
-            output.setType(DataType.STRING);
-            output.setValue("");
-            exOut.add(output);
 
             Project project = ProjectModelUtil.createProject("default", "lahiru", "test project");
             String projectId = client.createProject(DEFAULT_GATEWAY, project);
@@ -1374,24 +1112,9 @@ public class CreateLaunchExperiment {
             for (InputDataObjectType inputDataObjectType : exInputs) {
                 inputDataObjectType.setValue("Hello World");
             }
-            /*List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Input_to_Echo");
-            input.setType(DataType.STRING);
-            input.setValue("Echoed_Output=Hello World");
-            input.setRequiredToAddedToCommandLine(true);
-            exInputs.add(input);*/
-
+        
             List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
-            /*
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("output_file");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            exOut.add(output);*/
-
+          
             Project project = ProjectModelUtil.createProject("default", "lg11w", "test project");
             String projectId = client.createProject(DEFAULT_GATEWAY, project);
 


[62/62] [abbrv] airavata git commit: merging with master

Posted by la...@apache.org.
merging with master


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/48be39fe
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/48be39fe
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/48be39fe

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 48be39fea6f1df43d0097364a937428198fcc9af
Parents: 93ed077 73f371d
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Thu Mar 19 11:02:15 2015 -0400
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Thu Mar 19 11:02:15 2015 -0400

----------------------------------------------------------------------
 .../airavata/api/server/AiravataAPIServer.java  |    38 +-
 .../server/handler/AiravataServerHandler.java   |   412 +-
 .../api/server/util/DataModelUtils.java         |     8 +-
 .../java/org/apache/airavata/api/Airavata.java  | 28098 +++++++++++++----
 .../airavata/api/airavataAPIConstants.java      |     2 +-
 .../main/resources/lib/airavata/Airavata.cpp    |  8232 +++--
 .../src/main/resources/lib/airavata/Airavata.h  |  2388 +-
 .../lib/airavata/Airavata_server.skeleton.cpp   |    95 +-
 .../lib/airavata/airavataAPI_constants.cpp      |     2 +-
 .../lib/airavata/computeResourceModel_types.cpp |    12 +-
 .../lib/airavata/computeResourceModel_types.h   |     5 +-
 .../lib/airavata/experimentModel_types.cpp      |    62 +-
 .../lib/airavata/experimentModel_types.h        |    61 +-
 .../gatewayResourceProfileModel_constants.cpp   |     2 -
 .../gatewayResourceProfileModel_constants.h     |     1 -
 .../gatewayResourceProfileModel_types.cpp       |    72 +-
 .../gatewayResourceProfileModel_types.h         |    45 +-
 .../lib/airavata/workspaceModel_types.cpp       |    51 +-
 .../lib/airavata/workspaceModel_types.h         |    45 +-
 .../resources/lib/Airavata/API/Airavata.php     |  7240 +++--
 .../main/resources/lib/Airavata/API/Types.php   |     2 +-
 .../Model/AppCatalog/ComputeResource/Types.php  |    10 +-
 .../Model/AppCatalog/GatewayProfile/Types.php   |    92 +-
 .../Model/Workspace/Experiment/Types.php        |    60 +
 .../lib/Airavata/Model/Workspace/Types.php      |    58 +-
 .../client/samples/CreateLaunchExperiment.java  |   822 +-
 .../samples/CreateLaunchExperimentUS3.java      |    20 +-
 .../client/samples/RegisterSampleData.java      |    37 +-
 .../samples/TestCreateLaunchExperiment.java     |    10 +-
 .../tools/RegisterOGCEUS3Application.java       |    10 +-
 .../tools/RegisterSampleApplications.java       |   335 +-
 .../client/tools/RegisterUS3Application.java    |    14 +-
 .../computeresource/AuthenticationMode.java     |    70 +
 .../computeresource/ResourceJobManagerType.java |    42 +-
 .../computeresource/UnicoreJobSubmission.java   |     2 +
 .../ComputeResourcePreference.java              |   168 +-
 .../gatewayprofile/GatewayResourceProfile.java  |   226 +-
 .../airavata/model/workspace/Gateway.java       |   334 +-
 .../ComputationalResourceScheduling.java        |   109 +-
 .../experiment/UserConfigurationData.java       |   205 +-
 .../airavataAPI.thrift                          |   169 +-
 .../computeResourceModel.thrift                 |    23 +-
 .../experimentModel.thrift                      |    11 +-
 .../gatewayResourceProfileModel.thrift          |    28 +-
 .../workspaceModel.thrift                       |     6 +-
 .../appcatalog/cpi/ApplicationDeployment.java   |     4 +-
 .../appcatalog/cpi/ApplicationInterface.java    |     8 +-
 .../appcatalog/cpi/WorkflowCatalog.java         |     4 +-
 .../data/impl/ApplicationDeploymentImpl.java    |     6 +-
 .../data/impl/ApplicationInterfaceImpl.java     |    12 +-
 .../data/impl/GwyResourceProfileImpl.java       |    30 +-
 .../catalog/data/impl/WorkflowCatalogImpl.java  |     6 +-
 .../data/model/ApplicationDeployment.java       |    10 +
 .../data/model/ApplicationInterface.java        |    10 +
 .../catalog/data/model/ApplicationModule.java   |    10 +
 .../data/model/ComputeResourcePreference.java   |    10 +
 .../catalog/data/model/GatewayProfile.java      |    19 -
 .../data/model/UnicoreJobSubmission.java        |     5 +-
 .../catalog/data/model/Workflow.java            |    10 +
 .../data/resources/AbstractResource.java        |     6 +-
 .../data/resources/AppDeploymentResource.java   |    12 +
 .../data/resources/AppInterfaceResource.java    |    12 +
 .../data/resources/AppModuleResource.java       |    12 +
 .../ComputeHostPreferenceResource.java          |    11 +
 .../data/resources/GatewayProfileResource.java  |    30 +-
 .../resources/UnicoreJobSubmissionResource.java |    16 +-
 .../data/resources/WorkflowResource.java        |    12 +
 .../catalog/data/util/AppCatalogJPAUtils.java   |     7 +-
 .../data/util/AppCatalogThriftConversion.java   |     4 +-
 .../src/main/resources/appcatalog-derby.sql     |   211 +-
 .../src/main/resources/appcatalog-mysql.sql     |   209 +-
 .../app/catalog/test/AppDeploymentTest.java     |    11 +-
 .../app/catalog/test/AppInterfaceTest.java      |    12 +-
 .../app/catalog/test/GatewayProfileTest.java    |     5 +-
 .../src/test/resources/appcatalog-derby.sql     |   211 +-
 .../apache/airavata/common/utils/Constants.java |     4 +-
 .../common/utils/DatabaseTestCases.java         |     2 +-
 .../main/resources/airavata-client.properties   |     2 +-
 .../server/src/main/resources/LSFTemplate.xslt  |    92 +
 .../server/src/main/resources/PBSTemplate.xslt  |    22 +-
 .../server/src/main/resources/SGETemplate.xslt  |    18 +-
 .../src/main/resources/SLURMTemplate.xslt       |    22 +-
 .../main/resources/airavata-server.properties   |     6 +-
 .../credential-store-webapp/pom.xml             |   158 -
 .../basic/BasicAccessAuthenticator.java         |   226 -
 .../credentialstore/local/LocalUserStore.java   |   339 -
 .../session/HttpAuthenticatorFilter.java        |   191 -
 .../session/ServletRequestHelper.java           |   129 -
 .../main/resources/airavata-server.properties   |   237 -
 .../main/resources/credential-store/client.xml  |    36 -
 .../credential-store/oauth-privkey.pk8          |    28 -
 .../resources/credential-store/oauth-pubkey.pem |     9 -
 .../src/main/webapp/WEB-INF/web.xml             |   130 -
 .../src/main/webapp/acs/index.jsp               |    44 -
 .../src/main/webapp/credential-store/error.jsp  |    53 -
 .../credential-store/password-credentials.jsp   |    33 -
 .../webapp/credential-store/show-redirect.jsp   |    44 -
 .../main/webapp/credential-store/success.jsp    |    25 -
 .../src/main/webapp/gateway/acs.jsp             |    62 -
 .../src/main/webapp/gateway/callback.jsp        |    78 -
 .../src/main/webapp/gateway/list_users.jsp      |    78 -
 .../src/main/webapp/gateway/logout.jsp          |    35 -
 .../src/main/webapp/gateway/user.jsp            |   102 -
 .../src/main/webapp/images/airavata-logo-2.png  |   Bin 4314 -> 0 bytes
 .../src/main/webapp/index.jsp                   |    26 -
 .../src/main/webapp/user-store/add.jsp          |   142 -
 .../src/main/webapp/user-store/index.jsp        |   138 -
 .../src/main/webapp/user-store/password.jsp     |   157 -
 .../credential-store/pom.xml                    |   154 -
 .../scripts/credential-store-h2.sql             |    42 -
 .../scripts/credential-store-mysql.sql          |    42 -
 .../credential/store/client/TestSSLClient.java  |   140 -
 .../store/cpi/CredentialStoreService.java       |  6888 ----
 .../store/cpi/cs_cpi_serviceConstants.java      |    55 -
 .../credential/store/credential/AuditInfo.java  |    53 -
 .../store/credential/CommunityUser.java         |    71 -
 .../credential/store/credential/Credential.java |    62 -
 .../impl/certificate/CertificateAuditInfo.java  |   101 -
 .../impl/certificate/CertificateCredential.java |   102 -
 .../impl/password/PasswordCredential.java       |    53 -
 .../credential/impl/ssh/SSHCredential.java      |    88 -
 .../impl/ssh/SSHCredentialGenerator.java        |   103 -
 .../store/datamodel/CertificateCredential.java  |  1104 -
 .../store/datamodel/CommunityUser.java          |   589 -
 .../store/datamodel/PasswordCredential.java     |   698 -
 .../store/datamodel/SSHCredential.java          |   998 -
 .../store/datamodel/csDataModelConstants.java   |    55 -
 .../exception/CredentialStoreException.java     |   397 -
 .../store/notifier/CredentialStoreNotifier.java |    42 -
 .../store/notifier/NotificationMessage.java     |    46 -
 .../store/notifier/NotifierBootstrap.java       |   144 -
 .../notifier/impl/EmailNotificationMessage.java |    58 -
 .../store/notifier/impl/EmailNotifier.java      |    71 -
 .../impl/EmailNotifierConfiguration.java        |    84 -
 .../store/server/CredentialStoreServer.java     |   158 -
 .../server/CredentialStoreServerHandler.java    |   201 -
 .../store/servlet/CredentialBootstrapper.java   |    49 -
 .../servlet/CredentialStoreCallbackServlet.java |   272 -
 .../servlet/CredentialStoreStartServlet.java    |   183 -
 .../store/store/CredentialReader.java           |   112 -
 .../store/store/CredentialReaderFactory.java    |    54 -
 .../store/store/CredentialStoreException.java   |    40 -
 .../store/store/CredentialWriter.java           |    39 -
 .../store/impl/CertificateCredentialWriter.java |   121 -
 .../store/store/impl/CredentialReaderImpl.java  |   162 -
 .../store/store/impl/SSHCredentialWriter.java   |    87 -
 .../store/store/impl/db/CommunityUserDAO.java   |   257 -
 .../store/store/impl/db/CredentialsDAO.java     |   458 -
 .../store/store/impl/db/ParentDAO.java          |    37 -
 .../store/util/ConfigurationReader.java         |   121 -
 .../store/util/CredentialStoreConstants.java    |    37 -
 .../credential/store/util/PrivateKeyStore.java  |    70 -
 .../credential/store/util/TokenGenerator.java   |    57 -
 .../airavata/credential/store/util/Utility.java |   110 -
 .../store/notifier/impl/EmailNotifierTest.java  |    56 -
 .../store/impl/db/CommunityUserDAOTest.java     |   207 -
 .../store/store/impl/db/CredentialsDAOTest.java |   421 -
 .../store/util/ConfigurationReaderTest.java     |    58 -
 .../store/util/TokenGeneratorTest.java          |    42 -
 .../test/resources/credential-store/client.xml  |    35 -
 .../src/test/resources/keystore.jks             |   Bin 2230 -> 0 bytes
 .../src/test/resources/mykeystore.jks           |   Bin 498 -> 0 bytes
 .../credentialStoreErrors.thrift                |    32 -
 .../cs-thrift-description/cs.cpi.service.thrift |    50 -
 .../cs-thrift-description/csDataModel.thrift    |    61 -
 .../cs-thrift-description/generate-cs-stubs.sh  |   134 -
 modules/credential-store-service/pom.xml        |    42 -
 .../credential-store-service/pom.xml            |   166 +
 .../scripts/credential-store-h2.sql             |    42 +
 .../scripts/credential-store-mysql.sql          |    42 +
 .../credential/store/credential/AuditInfo.java  |    53 +
 .../store/credential/CommunityUser.java         |    71 +
 .../credential/store/credential/Credential.java |    62 +
 .../impl/certificate/CertificateAuditInfo.java  |   101 +
 .../impl/certificate/CertificateCredential.java |   102 +
 .../impl/password/PasswordCredential.java       |    53 +
 .../credential/impl/ssh/SSHCredential.java      |    88 +
 .../impl/ssh/SSHCredentialGenerator.java        |   103 +
 .../store/notifier/CredentialStoreNotifier.java |    42 +
 .../store/notifier/NotificationMessage.java     |    46 +
 .../store/notifier/NotifierBootstrap.java       |   144 +
 .../notifier/impl/EmailNotificationMessage.java |    58 +
 .../store/notifier/impl/EmailNotifier.java      |    71 +
 .../impl/EmailNotifierConfiguration.java        |    84 +
 .../store/server/CredentialStoreServer.java     |   158 +
 .../server/CredentialStoreServerHandler.java    |   202 +
 .../store/servlet/CredentialBootstrapper.java   |    49 +
 .../servlet/CredentialStoreCallbackServlet.java |   272 +
 .../servlet/CredentialStoreStartServlet.java    |   183 +
 .../store/store/CredentialReader.java           |   112 +
 .../store/store/CredentialReaderFactory.java    |    54 +
 .../store/store/CredentialStoreException.java   |    40 +
 .../store/store/CredentialWriter.java           |    39 +
 .../store/impl/CertificateCredentialWriter.java |   121 +
 .../store/store/impl/CredentialReaderImpl.java  |   162 +
 .../store/store/impl/SSHCredentialWriter.java   |    87 +
 .../store/store/impl/db/CommunityUserDAO.java   |   257 +
 .../store/store/impl/db/CredentialsDAO.java     |   458 +
 .../store/store/impl/db/ParentDAO.java          |    37 +
 .../store/util/ConfigurationReader.java         |   121 +
 .../store/util/CredentialStoreConstants.java    |    37 +
 .../credential/store/util/PrivateKeyStore.java  |    70 +
 .../credential/store/util/TokenGenerator.java   |    57 +
 .../airavata/credential/store/util/Utility.java |   110 +
 .../store/notifier/impl/EmailNotifierTest.java  |    56 +
 .../store/impl/db/CommunityUserDAOTest.java     |   207 +
 .../store/store/impl/db/CredentialsDAOTest.java |   421 +
 .../store/store/impl/db/SSHCredentialTest.java  |    92 +
 .../store/util/ConfigurationReaderTest.java     |    58 +
 .../store/util/TokenGeneratorTest.java          |    42 +
 .../test/resources/airavata-server.properties   |   254 +
 .../test/resources/credential-store/client.xml  |    35 +
 .../src/test/resources/keystore.jks             |   Bin 0 -> 2230 bytes
 .../src/test/resources/mykeystore.jks           |   Bin 0 -> 498 bytes
 .../credential-store-stubs/pom.xml              |    50 +
 .../credential/store/client/TestSSLClient.java  |   140 +
 .../store/cpi/CredentialStoreService.java       |  6888 ++++
 .../store/cpi/credentialStoreCPIConstants.java  |    55 +
 .../store/datamodel/CertificateCredential.java  |  1104 +
 .../store/datamodel/CommunityUser.java          |   589 +
 .../store/datamodel/PasswordCredential.java     |   698 +
 .../store/datamodel/SSHCredential.java          |   998 +
 .../credentialStoreDataModelConstants.java      |    55 +
 .../exception/CredentialStoreException.java     |   397 +
 .../credential-store-webapp/pom.xml             |   158 +
 .../basic/BasicAccessAuthenticator.java         |   226 +
 .../credentialstore/local/LocalUserStore.java   |   339 +
 .../session/HttpAuthenticatorFilter.java        |   191 +
 .../session/ServletRequestHelper.java           |   129 +
 .../main/resources/airavata-server.properties   |   237 +
 .../main/resources/credential-store/client.xml  |    36 +
 .../credential-store/oauth-privkey.pk8          |    28 +
 .../resources/credential-store/oauth-pubkey.pem |     9 +
 .../src/main/webapp/WEB-INF/web.xml             |   130 +
 .../src/main/webapp/acs/index.jsp               |    44 +
 .../src/main/webapp/credential-store/error.jsp  |    53 +
 .../credential-store/password-credentials.jsp   |    33 +
 .../webapp/credential-store/show-redirect.jsp   |    44 +
 .../main/webapp/credential-store/success.jsp    |    25 +
 .../src/main/webapp/gateway/acs.jsp             |    62 +
 .../src/main/webapp/gateway/callback.jsp        |    78 +
 .../src/main/webapp/gateway/list_users.jsp      |    78 +
 .../src/main/webapp/gateway/logout.jsp          |    35 +
 .../src/main/webapp/gateway/user.jsp            |   102 +
 .../src/main/webapp/images/airavata-logo-2.png  |   Bin 0 -> 4314 bytes
 .../src/main/webapp/index.jsp                   |    26 +
 .../src/main/webapp/user-store/add.jsp          |   142 +
 .../src/main/webapp/user-store/index.jsp        |   138 +
 .../src/main/webapp/user-store/password.jsp     |   157 +
 .../credentialStoreCPI.thrift                   |    61 +
 .../credentialStoreDataModel.thrift             |    61 +
 .../credentialStoreErrors.thrift                |    32 +
 .../cs-thrift-descriptions/generate-cs-stubs.sh |   134 +
 modules/credential-store/pom.xml                |    43 +
 modules/distribution/server/pom.xml             |  1211 +-
 .../server/src/main/assembly/bin-assembly.xml   |     1 +
 .../server/src/main/resources/bin/data.sql      |   141 -
 .../airavata/gfac/server/GfacServerHandler.java |    54 +-
 .../airavata/gfac/client/util/Initialize.java   |     4 +-
 modules/gfac/gfac-bes/pom.xml                   |     4 +-
 .../gfac/bes/provider/impl/BESProvider.java     |    10 +-
 .../org/apache/airavata/gfac/RequestData.java   |     2 +
 .../gfac/core/context/JobExecutionContext.java  |     9 +
 .../airavata/gfac/core/cpi/BetterGfacImpl.java  |    26 +-
 .../airavata/gfac/core/utils/GFacUtils.java     |     2 +-
 .../gfac/core/utils/OutHandlerWorker.java       |    11 +-
 .../gfac/gsissh/util/GFACGSISSHUtils.java       |    10 +-
 .../monitor/impl/pull/qstat/HPCPullMonitor.java |    42 +-
 .../impl/pull/qstat/ResourceConnection.java     |    16 +-
 .../airavata/gfac/monitor/util/CommonUtils.java |     1 +
 .../gfac/ssh/provider/impl/SSHProvider.java     |     1 +
 .../gfac/ssh/security/TokenizedSSHAuthInfo.java |     5 +-
 .../airavata/gfac/ssh/util/GFACSSHUtils.java    |    53 +-
 .../airavata/gfac/ssh/util/HandleOutputs.java   |     5 +-
 .../apache/airavata/integration/BaseCaseIT.java |     4 +-
 .../airavata/integration/DataRetrievalIT.java   |     8 +-
 .../airavata/integration/SimpleEchoIT.java      |     4 +-
 .../SingleAppIntegrationTestBase.java           |     6 +-
 .../WorkflowIntegrationTestBase.java            |     2 +-
 .../integration/tools/DocumentCreatorNew.java   |    75 +-
 modules/messaging/client/pom.xml                |     2 +-
 .../messaging/client/RabbitMQListener.java      |   228 +
 .../messaging/client/RabbitMQListner.java       |   230 -
 .../airavata/messaging/client/TestReader.java   |    50 +
 .../orchestrator/util/DataModelUtils.java       |    10 +-
 .../orchestrator/client/util/Initialize.java    |     4 +-
 .../airavata/orchestrator/cpi/Orchestrator.java |     2 +-
 .../orchestrator/core/util/Initialize.java      |     4 +-
 .../persistance/registry/jpa/ResourceType.java  |     2 -
 .../persistance/registry/jpa/ResourceUtils.java |    69 +-
 .../registry/jpa/impl/ExperimentRegistry.java   |    16 +-
 .../registry/jpa/impl/GatewayRegistry.java      |    76 +
 .../registry/jpa/impl/LoggingRegistryImpl.java  |    35 +-
 .../registry/jpa/impl/ProjectRegistry.java      |    16 +-
 .../registry/jpa/impl/RegistryFactory.java      |    17 +
 .../registry/jpa/impl/RegistryImpl.java         |    28 +-
 .../Computational_Resource_Scheduling.java      |    10 +
 .../registry/jpa/model/Experiment.java          |    14 +-
 .../jpa/model/ExperimentConfigData.java         |    20 +
 .../persistance/registry/jpa/model/Gateway.java |    32 +-
 .../registry/jpa/model/Gateway_Worker.java      |    14 +-
 .../registry/jpa/model/Gateway_Worker_PK.java   |    14 +-
 .../persistance/registry/jpa/model/Project.java |    13 +-
 .../registry/jpa/model/Published_Workflow.java  |   124 -
 .../jpa/model/Published_Workflow_PK.java        |    64 -
 .../registry/jpa/model/User_Workflow.java       |   122 -
 .../registry/jpa/model/User_Workflow_PK.java    |    74 -
 .../jpa/resources/AbstractResource.java         |    33 +-
 .../ComputationSchedulingResource.java          |    10 +
 .../jpa/resources/ConfigDataResource.java       |    22 +
 .../jpa/resources/ExperimentResource.java       |     6 +-
 .../registry/jpa/resources/GatewayResource.java |   159 +-
 .../registry/jpa/resources/ProjectResource.java |     4 +-
 .../jpa/resources/PublishWorkflowResource.java  |   282 -
 .../jpa/resources/UserWorkflowResource.java     |   174 -
 .../registry/jpa/resources/Utils.java           |    72 +-
 .../registry/jpa/resources/WorkerResource.java  |   100 +-
 .../jpa/utils/ThriftDataModelConversion.java    |    22 +
 .../src/main/resources/META-INF/persistence.xml |     2 -
 .../src/main/resources/registry-derby.sql       |    58 +-
 .../src/main/resources/registry-mysql.sql       |    56 +-
 .../registry/jpa/GatewayResourceTest.java       |    26 +-
 .../jpa/PublishWorkflowResourceTest.java        |    62 -
 .../registry/jpa/UserWorkflowResourceTest.java  |    66 -
 .../registry/jpa/util/Initialize.java           |     4 +-
 .../src/test/resources/registry-derby.sql       |    58 +-
 .../airavata/registry/cpi/ParentDataType.java   |     3 +-
 .../apache/airavata/registry/cpi/Registry.java  |     2 +-
 .../registry/cpi/RegistryModelType.java         |     1 +
 .../airavata/registry/cpi/utils/Constants.java  |     3 +-
 .../src/test/resources/jdbc-authenticator.xml   |     2 +-
 .../test/resources/session-authenticator.xml    |     2 +-
 modules/test-suite/pom.xml                      |   116 -
 .../tests/LeadCallbackHandlerTest.java          |   173 -
 .../tests/LeadNotificationManagerTest.java      |    49 -
 .../tests/MultipleSubscriptionTest.java         |   105 -
 .../tests/RenewSubscriptionTest.java            |   155 -
 .../tests/ThreadMessagePassingCallback.java     |    27 -
 .../tests/impl/publish/Test.java                |    40 -
 .../tests/impl/publish/TestWSMPublisher.java    |   119 -
 .../tests/messagebox/MessagePullerTest.java     |   140 -
 .../MultipleSubscriptionForMessageBoxTest.java  |   118 -
 .../tests/messagebox/RenewSubscriptionTest.java |   109 -
 .../tests/messagebox/SubscriberThread.java      |    96 -
 .../restart/MessageBoxClientRestartTest.java    |   131 -
 .../restart/MessageBoxCreateThread.java         |    83 -
 .../tests/samples/workflow/SimpleTest.java      |   202 -
 .../workflow/SimpleWorkflowExecution.java       |   473 -
 .../workflow/WorkflowNotificationListener.java  |   127 -
 .../tests/util/CommonUtils.java                 |    26 -
 .../tests/util/SubscriberThread.java            |    91 -
 .../tests/util/TestConfigKeys.java              |    34 -
 .../src/test/resources/gram.properties.template |    70 -
 .../src/test/resources/unit_test.properties     |    26 -
 .../airavata/workflow/engine/WorkflowUtils.java |    10 +-
 .../registry/JCRComponentRegistry.java          |     3 +-
 .../dialogs/workflow/WorkflowImportWindow.java  |     3 +-
 .../ui/experiment/LaunchApplicationWindow.java  |     8 +-
 .../RegistryWorkflowPublisherWindow.java        |     3 +-
 .../WorkflowInterpreterLaunchWindow.java        |     9 +-
 pom.xml                                         |     6 +-
 .../apache/airavata/gsi/ssh/GSSContextX509.java |    11 +-
 .../airavata/gsi/ssh/api/job/JobDescriptor.java |    14 +
 .../ssh/api/job/JobManagerConfiguration.java    |     9 +-
 .../gsi/ssh/api/job/LSFJobConfiguration.java    |   116 +
 .../gsi/ssh/api/job/LSFOutputParser.java        |   110 +
 .../airavata/gsi/ssh/api/job/OutputParser.java  |    14 +-
 .../gsi/ssh/api/job/PBSJobConfiguration.java    |    15 +
 .../gsi/ssh/api/job/PBSOutputParser.java        |     8 +-
 .../gsi/ssh/api/job/SGEOutputParser.java        |     8 +-
 .../gsi/ssh/api/job/SlurmJobConfiguration.java  |    15 +
 .../gsi/ssh/api/job/SlurmOutputParser.java      |    10 +-
 .../gsi/ssh/impl/GSISSHAbstractCluster.java     |    74 +-
 .../apache/airavata/gsi/ssh/impl/JobStatus.java |    20 +-
 .../airavata/gsi/ssh/impl/PBSCluster.java       |     4 +
 .../airavata/gsi/ssh/impl/RawCommandInfo.java   |     8 +-
 .../gsi/ssh/listener/JobSubmissionListener.java |     2 +-
 .../airavata/gsi/ssh/util/CommonUtils.java      |    13 +
 .../gsissh/src/main/resources/LSFTemplate.xslt  |    93 +
 .../main/resources/schemas/PBSJobDescriptor.xsd |     3 +-
 .../impl/DefaultSSHApiTestWithMyProxyAuth.java  |    25 +-
 .../gsi/ssh/impl/VanilaTestWithSSHAuth.java     |    48 +-
 tools/registry-tool/README                      |     2 +-
 383 files changed, 59870 insertions(+), 35784 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --cc airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 90b8e6d,ed141b9..f499345
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@@ -54,16 -55,16 +55,16 @@@ public class CreateLaunchExperiment 
  	
      private final static Logger logger = LoggerFactory.getLogger(CreateLaunchExperiment.class);
      private static final String DEFAULT_USER = "default.registry.user";
-     private static final String DEFAULT_GATEWAY = "default.registry.gateway";
+     private static final String DEFAULT_GATEWAY = "php_reference_gateway";
      private static Airavata.Client airavataClient;
  
 -    private static String echoAppId = "Echo_61988d1f-7ca9-47ba-9212-a0ac2e973cf1";
 +    private static String echoAppId = "Echo_1365a7fd-eae1-4575-b447-99afb4d79c82";
      private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
      private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
-     private static String amberAppId = "Amber_9e4f28b6-7a5d-4fe1-b07f-2053f8f0deb3";
+     private static String amberAppId = "Amber_aa083c86-4680-4002-b3ef-fad93c181926";
      private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
      private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
-     private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f";
+     private static String lammpsAppId = "LAMMPS_2472685b-8acf-497e-aafe-cc66fe5f4cb6";
      private static String nwchemAppId = "NWChem_2c8fee64-acf9-4a89-b6d3-91eb53c7640c";
      private static String trinityAppId = "Trinity_e894acf5-9bca-46e8-a1bd-7e2d5155191a";
      private static String autodockAppId = "AutoDock_43d9fdd0-c404-49f4-b913-3abf9080a8c9";
@@@ -89,9 -95,73 +95,74 @@@
      private static String fsdResourceId;
  
  
+     public static void getAvailableAppInterfaceComputeResources(String appInterfaceId) {
+         try {
+             Map<String, String> availableAppInterfaceComputeResources = airavataClient.getAvailableAppInterfaceComputeResources(appInterfaceId);
+             for (String key : availableAppInterfaceComputeResources.keySet()){
+                 System.out.println("id : " + key);
+                 System.out.println("name : " + availableAppInterfaceComputeResources.get(key));
+             }
+         } catch (AiravataSystemException e) {
+             e.printStackTrace();
+         } catch (InvalidRequestException e) {
+             e.printStackTrace();
+         } catch (AiravataClientException e) {
+             e.printStackTrace();
+         } catch (TException e) {
+             e.printStackTrace();
+         }
+ 
+     }
+ 
+ 
+     public static void createGateway(){
+         try {
+             Gateway gateway = new Gateway();
+             gateway.setGatewayId("testGatewayId2");
+             gateway.setGatewayName("testGateway2");
+             gatewayId = airavataClient.addGateway(gateway);
+             System.out.println(gatewayId);
+         } catch (AiravataSystemException e) {
+             e.printStackTrace();
+         } catch (InvalidRequestException e) {
+             e.printStackTrace();
+         } catch (AiravataClientException e) {
+             e.printStackTrace();
+         } catch (TException e) {
+             e.printStackTrace();
+         }
+ 
+     }
+ 
+     public static void getGateway(String gatewayId){
+         try {
+             Gateway gateway = airavataClient.getGateway(gatewayId);
+             gateway.setDomain("testDomain");
+             airavataClient.updateGateway(gatewayId, gateway);
+             List<Gateway> allGateways = airavataClient.getAllGateways();
+             System.out.println(allGateways.size());
+             if (airavataClient.isGatewayExist(gatewayId)){
+                 Gateway gateway1 = airavataClient.getGateway(gatewayId);
+                 System.out.println(gateway1.getGatewayName());
+             }
+             boolean b = airavataClient.deleteGateway("testGatewayId2");
+             System.out.println(b);
+         } catch (AiravataSystemException e) {
+             e.printStackTrace();
+         } catch (InvalidRequestException e) {
+             e.printStackTrace();
+         } catch (AiravataClientException e) {
+             e.printStackTrace();
+         } catch (TException e) {
+             e.printStackTrace();
+         }
+ 
+     }
+ 
+ 
      public static void createAndLaunchExp() throws TException {
  //        final String expId = createEchoExperimentForFSD(airavataClient);
 +        List<String> experimentIds = new ArrayList<String>();
          try {
              for (int i = 0; i < 1; i++) {
  //                final String expId = createExperimentForSSHHost(airavata);

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --cc modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
index 0000000,badf28d..64e0160
mode 000000,100644..100644
--- a/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
+++ b/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
@@@ -1,0 -1,234 +1,237 @@@
+ #
+ #
+ # 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.
+ #
+ 
+ ###########################################################################
+ #
+ #  This properties file provides configuration for all Airavata Services:
+ #  API Server, Registry, Workflow Interpreter, GFac, Orchestrator
+ #
+ ###########################################################################
+ 
+ ###########################################################################
+ #  API Server Registry Configuration
+ ###########################################################################
+ 
+ #for derby [AiravataJPARegistry]
+ registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+ registry.jdbc.url=jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata
+ # MySql database configuration
+ #registry.jdbc.driver=com.mysql.jdbc.Driver
+ #registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+ registry.jdbc.user=airavata
+ registry.jdbc.password=airavata
+ start.derby.server.mode=true
+ validationQuery=SELECT 1 from CONFIGURATION
+ jpa.cache.size=5000
+ #jpa.connection.properties=MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000,testWhileIdle=true,testOnBorrow=true
+ 
+ # Properties for default user mode
+ default.registry.user=admin
+ default.registry.password=admin
+ default.registry.password.hash.method=SHA
+ default.registry.gateway=default
+ 
+ #ip=127.0.0.1
+ 
+ ###########################################################################
+ #  Application Catalog DB Configuration
+ ###########################################################################
+ #for derby [AiravataJPARegistry]
+ appcatalog.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+ appcatalog.jdbc.url=jdbc:derby://localhost:1527/app_catalog;create=true;user=airavata;password=airavata
+ # MySql database configuration
+ #appcatalog.jdbc.driver=com.mysql.jdbc.Driver
+ #appcatalog.jdbc.url=jdbc:mysql://localhost:3306/app_catalog
+ appcatalog.jdbc.user=airavata
+ appcatalog.jdbc.password=airavata
+ appcatalog.validationQuery=SELECT 1 from CONFIGURATION
+ 
+ ###########################################################################
+ #  Server module Configuration
+ ###########################################################################
+ 
+ servers=apiserver,orchestrator,gfac,workflowserver
+ #shutdown.trategy=NONE
+ shutdown.trategy=SELF_TERMINATE
+ 
+ 
+ apiserver.server.host=localhost
+ apiserver.server.port=8930
+ apiserver.server.min.threads=50
+ workflow.server.host=localhost
+ workflow.server.port=8931
+ orchestrator.server.host=localhost
+ orchestrator.server.port=8940
+ gfac.server.host=localhost
+ gfac.server.port=8950
+ orchestrator.server.min.threads=50
+ 
+ ###########################################################################
+ # Credential Store module Configuration
+ ###########################################################################
+ credential.store.keystore.url=/Users/lahirugunathilake/Downloads/airavata_sym.jks
+ credential.store.keystore.alias=airavata
+ credential.store.keystore.password=airavata
+ credential.store.jdbc.url=jdbc:derby://localhost:1527/experiment_catalog;create=true;user=airavata;password=airavata
+ credential.store.jdbc.user=airavata
+ credential.store.jdbc.password=airavata
+ credential.store.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+ 
+ notifier.enabled=false
+ #period in milliseconds
+ notifier.duration=5000
+ 
+ email.server=smtp.googlemail.com
+ email.server.port=465
+ email.user=airavata
+ email.password=xxx
+ email.ssl=true
+ email.from=airavata@apache.org
+ 
+ ###########################################################################
+ # Airavata GFac MyProxy GSI credentials to access Grid Resources.
+ ###########################################################################
+ #
+ # Security Configuration used by Airavata Generic Factory Service
+ #  to interact with Computational Resources.
+ #
+ gfac=org.apache.airavata.gfac.server.GfacServer
+ myproxy.server=myproxy.teragrid.org
+ myproxy.username=ogce
+ myproxy.password=
+ myproxy.life=3600
+ # XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz
+ trusted.cert.location=/Users/lahirugunathilake/Downloads/certificates
+ # SSH PKI key pair or ssh password can be used SSH based authentication is used.
+ # if user specify both password authentication gets the higher preference
+ 
+ ################# ---------- For ssh key pair authentication ------------------- ################
+ #public.ssh.key=/path to public key for ssh
+ #ssh.username=username for ssh connection
+ #private.ssh.key=/path to private key file for ssh
+ #ssh.keypass=passphrase for the private key
+ 
+ 
+ ################# ---------- For ssh key pair authentication ------------------- ################
+ #ssh.username=username for ssh connection
+ #ssh.password=Password for ssh connection
+ 
+ 
+ 
+ ###########################################################################
+ # Airavata Workflow Interpreter Configurations
+ ###########################################################################
+ 
+ #runInThread=true
+ #provenance=true
+ #provenanceWriterThreadPoolSize=20
+ #gfac.embedded=true
+ #workflowserver=org.apache.airavata.api.server.WorkflowServer
+ 
+ 
+ ###########################################################################
+ # API Server module Configuration
+ ###########################################################################
+ apiserver=org.apache.airavata.api.server.AiravataAPIServer
+ 
+ ###########################################################################
+ # Workflow Server module Configuration
+ ###########################################################################
+ 
+ workflowserver=org.apache.airavata.api.server.WorkflowServer
+ 
+ ###########################################################################
+ # Advance configuration to change service implementations
+ ###########################################################################
+ # If false, disables two phase commit when submitting jobs
+ TwoPhase=true
+ #
+ # Class which implemented HostScheduler interface. It will determine the which host to submit the request
+ #
+ host.scheduler=org.apache.airavata.gfac.core.scheduler.impl.SimpleHostScheduler
+ 
+ ###########################################################################
+ # Monitoring module Configuration
+ ###########################################################################
+ 
+ #This will be the primary monitoring tool which runs in airavata, in future there will be multiple monitoring
+ #mechanisms and one would be able to start a monitor
+ monitors=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor,org.apache.airavata.gfac.monitor.impl.LocalJobMonitor
+ 
+ 
+ ###########################################################################
+ # AMQP Notification Configuration
+ ###########################################################################
+ 
+ 
+ amqp.notification.enable=1
+ 
+ amqp.broker.host=localhost
+ amqp.broker.port=5672
+ amqp.broker.username=guest
+ amqp.broker.password=guest
+ 
+ amqp.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPSenderImpl
+ amqp.topic.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPTopicSenderImpl
+ amqp.broadcast.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPBroadcastSenderImpl
+ 
+ #,org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor
+ #This is the amqp related configuration and this lists down the Rabbitmq host, this is an xsede specific configuration
+ amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
+ proxy.file.path=/Users/lahirugunathilake/Downloads/x509up_u503876
+ connection.name=xsede
+ #publisher
+ activity.listeners=org.apache.airavata.gfac.core.monitor.AiravataJobStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataTaskStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataWorkflowNodeStatusUpdator,org.apache.airavata.api.server.listener.AiravataExperimentStatusUpdator,org.apache.airavata.gfac.core.monitor.GfacInternalStatusUpdator,org.apache.airavata.workflow.engine.util.ProxyMonitorPublisher
+ publish.rabbitmq=false
 -activity.publisher=org.apache.airavata.messaging.core.impl.RabbitMQPublisher
++status.publisher=org.apache.airavata.messaging.core.impl.RabbitMQStatusPublisher
++task.launch.publisher=org.apache.airavata.messaging.core.impl.RabbitMQTaskLaunchPublisher
+ rabbitmq.broker.url=amqp://localhost:5672
 -rabbitmq.exchange.name=airavata_rabbitmq_exchange
++rabbitmq.status.exchange.name=airavata_rabbitmq_exchange
++rabbitmq.task.launch.exchange.name=airavata_task_launch_rabbitmq_exchange
+ 
+ ###########################################################################
+ # Orchestrator module Configuration
+ ###########################################################################
+ 
+ #job.submitter=org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter
 -job.submitter=org.apache.airavata.orchestrator.core.impl.GFACServiceJobSubmitter
++#job.submitter=org.apache.airavata.orchestrator.core.impl.GFACPassiveJobSubmitter
++job.submitter=org.apache.airavata.orchestrator.core.impl.GFACRPCJobSubmitter
+ job.validators=org.apache.airavata.orchestrator.core.validator.impl.SimpleAppDataValidator,org.apache.airavata.orchestrator.core.validator.impl.ExperimentStatusValidator
+ submitter.interval=10000
+ threadpool.size=10
+ start.submitter=true
+ embedded.mode=true
+ enable.validation=true
+ orchestrator=org.apache.airavata.orchestrator.server.OrchestratorServer
+ 
+ ###########################################################################
+ # Zookeeper Server Configuration
+ ###########################################################################
+ 
+ embedded.zk=true
+ zookeeper.server.host=localhost
+ zookeeper.server.port=2181
+ airavata-server=/api-server
+ orchestrator-server=/orchestrator-server
+ gfac-server=/gfac-server
+ gfac-experiments=/gfac-experiments
+ gfac-server-name=gfac-node0
+ orchestrator-server-name=orch-node0
+ airavata-server-name=api-node0

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
----------------------------------------------------------------------
diff --cc modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
index cca793e,4973a41..88979a4
--- a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
+++ b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
@@@ -27,7 -27,10 +27,11 @@@ import org.apache.aiaravata.application
  import org.apache.airavata.common.exception.ApplicationSettingsException;
  import org.apache.airavata.common.logger.AiravataLogger;
  import org.apache.airavata.common.logger.AiravataLoggerFactory;
 +import org.apache.airavata.common.utils.*;
+ import org.apache.airavata.common.utils.AiravataZKUtils;
+ import org.apache.airavata.common.utils.Constants;
+ import org.apache.airavata.common.utils.MonitorPublisher;
+ import org.apache.airavata.common.utils.ServerSettings;
  import org.apache.airavata.gfac.core.cpi.BetterGfacImpl;
  import org.apache.airavata.gfac.core.cpi.GFac;
  import org.apache.airavata.gfac.core.utils.GFacThreadPoolExecutor;

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/modules/messaging/client/src/main/java/org/apache/airavata/messaging/client/RabbitMQListener.java
----------------------------------------------------------------------
diff --cc modules/messaging/client/src/main/java/org/apache/airavata/messaging/client/RabbitMQListener.java
index 0000000,53d08d3..3f876ae
mode 000000,100644..100644
--- a/modules/messaging/client/src/main/java/org/apache/airavata/messaging/client/RabbitMQListener.java
+++ b/modules/messaging/client/src/main/java/org/apache/airavata/messaging/client/RabbitMQListener.java
@@@ -1,0 -1,228 +1,228 @@@
+ /*
+  *
+  * 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.messaging.client;
+ 
+ import org.apache.airavata.common.exception.ApplicationSettingsException;
+ import org.apache.airavata.common.utils.AiravataUtils;
+ import org.apache.airavata.common.utils.ServerSettings;
+ import org.apache.airavata.common.utils.ThriftUtils;
+ import org.apache.airavata.messaging.core.MessageContext;
+ import org.apache.airavata.messaging.core.MessageHandler;
+ import org.apache.airavata.messaging.core.MessagingConstants;
 -import org.apache.airavata.messaging.core.impl.RabbitMQConsumer;
++import org.apache.airavata.messaging.core.impl.RabbitMQStatusConsumer;
+ import org.apache.airavata.model.messaging.event.*;
+ import org.apache.commons.cli.*;
+ import org.apache.thrift.TBase;
+ import org.apache.thrift.TException;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+ 
+ import java.io.*;
+ import java.util.ArrayList;
+ import java.util.HashMap;
+ import java.util.List;
+ import java.util.Map;
+ 
+ 
+ public class RabbitMQListener {
+     public static final String RABBITMQ_BROKER_URL = "rabbitmq.broker.url";
+     public static final String RABBITMQ_EXCHANGE_NAME = "rabbitmq.exchange.name";
+     private final static Logger logger = LoggerFactory.getLogger(RabbitMQListener.class);
+     private static String gatewayId = "*";
+     private static boolean gatewayLevelMessages = false;
+     private static boolean experimentLevelMessages = false;
+     private static boolean jobLevelMessages = false;
+     private static String experimentId = "*";
+     private static String jobId = "*";
+     private static boolean allMessages = false;
+ 
+     public static void main(String[] args) {
+         File file = new File("/tmp/latency_client");
+         parseArguments(args);
+         try {
+             FileOutputStream fos = new FileOutputStream(file, false);
+             final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));
+             AiravataUtils.setExecutionAsServer();
+             String brokerUrl = ServerSettings.getSetting(RABBITMQ_BROKER_URL);
+             System.out.println("broker url " + brokerUrl);
+             final String exchangeName = ServerSettings.getSetting(RABBITMQ_EXCHANGE_NAME);
 -            RabbitMQConsumer consumer = new RabbitMQConsumer(brokerUrl, exchangeName);
++            RabbitMQStatusConsumer consumer = new RabbitMQStatusConsumer(brokerUrl, exchangeName);
+             consumer.listen(new MessageHandler() {
+                 @Override
+                 public Map<String, Object> getProperties() {
+                     Map<String, Object> props = new HashMap<String, Object>();
+                     List<String> routingKeys = new ArrayList<String>();
+                     if (allMessages){
+                         routingKeys.add("*");
+                         routingKeys.add("*.*");
+                         routingKeys.add("*.*.*");
+                         routingKeys.add("*.*.*.*");
+                         routingKeys.add("*.*.*.*.*");
+                     }else {
+                         if (gatewayLevelMessages){
+                             routingKeys.add(gatewayId);
+                             routingKeys.add(gatewayId + ".*");
+                             routingKeys.add(gatewayId + ".*.*");
+                             routingKeys.add(gatewayId + ".*.*.*");
+                             routingKeys.add(gatewayId + ".*.*.*.*");
+                         }else if (experimentLevelMessages){
+                             routingKeys.add(gatewayId);
+                             routingKeys.add(gatewayId + "." + experimentId);
+                             routingKeys.add(gatewayId + "." + experimentId+ ".*");
+                             routingKeys.add(gatewayId + "." + experimentId+ ".*.*");
+                             routingKeys.add(gatewayId + "." + experimentId+ ".*.*.*");
+                         }else if  (jobLevelMessages){
+                             routingKeys.add(gatewayId);
+                             routingKeys.add(gatewayId + "." + experimentId);
+                             routingKeys.add(gatewayId + "." + experimentId+ ".*");
+                             routingKeys.add(gatewayId + "." + experimentId+ ".*.*");
+                             routingKeys.add(gatewayId + "." + experimentId+ ".*." + jobId);
+                         }
+                     }
+                     props.put(MessagingConstants.RABBIT_ROUTING_KEY, routingKeys);
+                     return props;
+                 }
+ 
+                 @Override
+                 public void onMessage(MessageContext message) {
+                     try {
+                         long latency = System.currentTimeMillis() - message.getUpdatedTime().getTime();
+                         bw.write(message.getMessageId() + " :" + latency);
+                         bw.newLine();
+                         bw.flush();
+                     } catch (IOException e) {
+                         e.printStackTrace();
+                     }
+                     if (message.getType().equals(MessageType.EXPERIMENT)){
+                         try {
+                             ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent();
+                             TBase messageEvent = message.getEvent();
+                             byte[] bytes = ThriftUtils.serializeThriftObject(messageEvent);
+                             ThriftUtils.createThriftFromBytes(bytes, event);
+                             System.out.println(" Message Received with message id '" + message.getMessageId()
+                                     + "' and with message type '" + message.getType() + "' and with state : '" + event.getState().toString() +
+                                        " for Gateway " + event.getGatewayId());
+                         } catch (TException e) {
+                             logger.error(e.getMessage(), e);
+                         }
+                     }else if (message.getType().equals(MessageType.WORKFLOWNODE)){
+                         try {
+                             WorkflowNodeStatusChangeEvent event = new WorkflowNodeStatusChangeEvent();
+                             TBase messageEvent = message.getEvent();
+                             byte[] bytes = ThriftUtils.serializeThriftObject(messageEvent);
+                             ThriftUtils.createThriftFromBytes(bytes, event);
+                             System.out.println(" Message Received with message id '" + message.getMessageId()
+                                     + "' and with message type '" + message.getType() + "' and with state : '" + event.getState().toString() +
+                                     " for Gateway " + event.getWorkflowNodeIdentity().getGatewayId());
+                         } catch (TException e) {
+                             logger.error(e.getMessage(), e);
+                         }
+                     }else if (message.getType().equals(MessageType.TASK)){
+                         try {
+                             TaskStatusChangeEvent event = new TaskStatusChangeEvent();
+                             TBase messageEvent = message.getEvent();
+                             byte[] bytes = ThriftUtils.serializeThriftObject(messageEvent);
+                             ThriftUtils.createThriftFromBytes(bytes, event);
+                             System.out.println(" Message Received with message id '" + message.getMessageId()
+                                     + "' and with message type '" + message.getType() + "' and with state : '" + event.getState().toString() +
+                                     " for Gateway " + event.getTaskIdentity().getGatewayId());
+                         } catch (TException e) {
+                             logger.error(e.getMessage(), e);
+                         }
+                     }else if (message.getType().equals(MessageType.JOB)){
+                         try {
+                             JobStatusChangeEvent event = new JobStatusChangeEvent();
+                             TBase messageEvent = message.getEvent();
+                             byte[] bytes = ThriftUtils.serializeThriftObject(messageEvent);
+                             ThriftUtils.createThriftFromBytes(bytes, event);
+                             System.out.println(" Message Received with message id '" + message.getMessageId()
+                                     + "' and with message type '" + message.getType() + "' and with state : '" + event.getState().toString() +
+                                     " for Gateway " + event.getJobIdentity().getGatewayId());
+                         } catch (TException e) {
+                             logger.error(e.getMessage(), e);
+                         }
+                     }
+                 }
+             });
+         } catch (ApplicationSettingsException e) {
+             logger.error("Error reading airavata server properties", e);
+         }catch (Exception e) {
+            logger.error(e.getMessage(), e);
+         }
+ 
+     }
+ 
+     public static void parseArguments(String[] args) {
+         try{
+             Options options = new Options();
+ 
+             options.addOption("gId", true , "Gateway ID");
+             options.addOption("eId", true, "Experiment ID");
+             options.addOption("jId", true, "Job ID");
+             options.addOption("a", false, "All Notifications");
+ 
+             CommandLineParser parser = new PosixParser();
+             CommandLine cmd = parser.parse( options, args);
+             if (cmd.getOptions() == null || cmd.getOptions().length == 0){
+                 logger.info("You have not specified any options. We assume you need to listen to all the messages...");
+                 allMessages = true;
+                 gatewayId = "*";
+             }
+             if (cmd.hasOption("a")){
+                 logger.info("Listening to all the messages...");
+                 allMessages = true;
+                 gatewayId = "*";
+             }else {
+                 gatewayId = cmd.getOptionValue("gId");
+                 if (gatewayId == null){
+                     gatewayId = "*";
+                     logger.info("You have not specified a gateway id. We assume you need to listen to all the messages...");
+                 } else {
+                     gatewayLevelMessages = true;
+                 }
+                 experimentId = cmd.getOptionValue("eId");
+                 if (experimentId == null && !gatewayId.equals("*")){
+                     experimentId = "*";
+                     logger.info("You have not specified a experiment id. We assume you need to listen to all the messages for the gateway with id " + gatewayId);
+                 } else if (experimentId == null && gatewayId.equals("*")) {
+                     experimentId = "*";
+                     logger.info("You have not specified a experiment id and a gateway id. We assume you need to listen to all the messages...");
+                 }else {
+                     experimentLevelMessages = true;
+                 }
+                 jobId = cmd.getOptionValue("jId");
+                 if (jobId == null && !gatewayId.equals("*") && !experimentId.equals("*")){
+                     jobId = "*";
+                     logger.info("You have not specified a job id. We assume you need to listen to all the messages for the gateway with id " + gatewayId
+                             + " with experiment id : " + experimentId );
+                 } else if (jobId == null && gatewayId.equals("*") && experimentId.equals("*")) {
+                     jobId = "*";
+                     logger.info("You have not specified a job Id or experiment Id or a gateway Id. We assume you need to listen to all the messages...");
+                 }else {
+                     jobLevelMessages = true;
+                 }
+             }
+         } catch (ParseException e) {
+             logger.error("Error while reading command line parameters" , e);
+         }
+     }
+ }

http://git-wip-us.apache.org/repos/asf/airavata/blob/48be39fe/pom.xml
----------------------------------------------------------------------


[29/62] [abbrv] airavata git commit: Merge remote-tracking branch 'origin/master'

Posted by la...@apache.org.
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9d80cf29
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9d80cf29
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9d80cf29

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 9d80cf2981915d908dfc1d37dd9b97fe8501d1c5
Parents: 8c84eee 9385c4e
Author: Suresh Marru <sm...@apache.org>
Authored: Fri Mar 6 14:23:18 2015 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Fri Mar 6 14:23:18 2015 -0500

----------------------------------------------------------------------
 .../org/apache/airavata/common/utils/DatabaseTestCases.java    | 2 +-
 .../client/src/main/resources/airavata-client.properties       | 2 +-
 .../server/src/main/resources/airavata-server.properties       | 6 +++---
 .../credential/store/store/impl/db/SSHCredentialTest.java      | 2 +-
 .../src/main/resources/airavata-server.properties              | 4 ++--
 modules/security/src/test/resources/jdbc-authenticator.xml     | 2 +-
 modules/security/src/test/resources/session-authenticator.xml  | 2 +-
 tools/registry-tool/README                                     | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------



[49/62] [abbrv] airavata git commit: fixing a bug in ssh credential registration client

Posted by la...@apache.org.
fixing a bug in ssh credential registration client


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/6da7a74e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/6da7a74e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/6da7a74e

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 6da7a74e34f8fa02d3a1f693917996b0ca16b34e
Parents: f31637e
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Wed Mar 11 22:33:28 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Wed Mar 11 22:33:28 2015 -0400

----------------------------------------------------------------------
 .../credential/store/store/impl/db/SSHCredentialTest.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/6da7a74e/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
index e6969e6..45c0be3 100644
--- a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
@@ -65,9 +65,9 @@ public class SSHCredentialTest {
             pubKeyStream.read(bFilePub);
             privateKeyStream.close();
             pubKeyStream.close();
-            sshCredential.setPrivateKey(bFilePub);
+            sshCredential.setPrivateKey(bFilePri);
             sshCredential.setPublicKey(bFilePub);
-            sshCredential.setPassphrase("ljclqowueqllad_lqlj");
+            sshCredential.setPassphrase("test");
             writer.writeCredentials(sshCredential);
             System.out.println(token);
         } catch (ClassNotFoundException e) {


[09/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
new file mode 100644
index 0000000..5d9c05c
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
@@ -0,0 +1,6888 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CredentialStoreService {
+
+  public interface Iface {
+
+    /**
+     * Query CS server to fetch the CPI version
+     */
+    public String getCSServiceVersion() throws org.apache.thrift.TException;
+
+    /**
+     * This method is to add SSHCredential which will return the token Id in success
+     * 
+     * 
+     * @param sshCredential
+     */
+    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+  }
+
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
+      public Factory() {}
+      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
+        return new Client(prot);
+      }
+      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+        return new Client(iprot, oprot);
+      }
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol prot)
+    {
+      super(prot, prot);
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+      super(iprot, oprot);
+    }
+
+    public String getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      send_getCSServiceVersion();
+      return recv_getCSServiceVersion();
+    }
+
+    public void send_getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      getCSServiceVersion_args args = new getCSServiceVersion_args();
+      sendBase("getCSServiceVersion", args);
+    }
+
+    public String recv_getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      getCSServiceVersion_result result = new getCSServiceVersion_result();
+      receiveBase(result, "getCSServiceVersion");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCSServiceVersion failed: unknown result");
+    }
+
+    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_addSSHCredential(sshCredential);
+      return recv_addSSHCredential();
+    }
+
+    public void send_addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.thrift.TException
+    {
+      addSSHCredential_args args = new addSSHCredential_args();
+      args.setSshCredential(sshCredential);
+      sendBase("addSSHCredential", args);
+    }
+
+    public String recv_addSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      addSSHCredential_result result = new addSSHCredential_result();
+      receiveBase(result, "addSSHCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addSSHCredential failed: unknown result");
+    }
+
+    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_addCertificateCredential(certificateCredential);
+      return recv_addCertificateCredential();
+    }
+
+    public void send_addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.thrift.TException
+    {
+      addCertificateCredential_args args = new addCertificateCredential_args();
+      args.setCertificateCredential(certificateCredential);
+      sendBase("addCertificateCredential", args);
+    }
+
+    public String recv_addCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      addCertificateCredential_result result = new addCertificateCredential_result();
+      receiveBase(result, "addCertificateCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addCertificateCredential failed: unknown result");
+    }
+
+    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_addPasswordCredential(passwordCredential);
+      return recv_addPasswordCredential();
+    }
+
+    public void send_addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.thrift.TException
+    {
+      addPasswordCredential_args args = new addPasswordCredential_args();
+      args.setPasswordCredential(passwordCredential);
+      sendBase("addPasswordCredential", args);
+    }
+
+    public String recv_addPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      addPasswordCredential_result result = new addPasswordCredential_result();
+      receiveBase(result, "addPasswordCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addPasswordCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_getSSHCredential(tokenId, gatewayId);
+      return recv_getSSHCredential();
+    }
+
+    public void send_getSSHCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
+    {
+      getSSHCredential_args args = new getSSHCredential_args();
+      args.setTokenId(tokenId);
+      args.setGatewayId(gatewayId);
+      sendBase("getSSHCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential recv_getSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      getSSHCredential_result result = new getSSHCredential_result();
+      receiveBase(result, "getSSHCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSSHCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_getCertificateCredential(tokenId, gatewayId);
+      return recv_getCertificateCredential();
+    }
+
+    public void send_getCertificateCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
+    {
+      getCertificateCredential_args args = new getCertificateCredential_args();
+      args.setTokenId(tokenId);
+      args.setGatewayId(gatewayId);
+      sendBase("getCertificateCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential recv_getCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      getCertificateCredential_result result = new getCertificateCredential_result();
+      receiveBase(result, "getCertificateCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCertificateCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_getPasswordCredential(tokenId, gatewayId);
+      return recv_getPasswordCredential();
+    }
+
+    public void send_getPasswordCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
+    {
+      getPasswordCredential_args args = new getPasswordCredential_args();
+      args.setTokenId(tokenId);
+      args.setGatewayId(gatewayId);
+      sendBase("getPasswordCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential recv_getPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      getPasswordCredential_result result = new getPasswordCredential_result();
+      receiveBase(result, "getPasswordCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPasswordCredential failed: unknown result");
+    }
+
+  }
+  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
+    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
+      private org.apache.thrift.async.TAsyncClientManager clientManager;
+      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
+      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
+        this.clientManager = clientManager;
+        this.protocolFactory = protocolFactory;
+      }
+      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
+        return new AsyncClient(protocolFactory, clientManager, transport);
+      }
+    }
+
+    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
+      super(protocolFactory, clientManager, transport);
+    }
+
+    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getCSServiceVersion_call method_call = new getCSServiceVersion_call(resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getCSServiceVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
+      public getCSServiceVersion_call(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);
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCSServiceVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getCSServiceVersion_args args = new getCSServiceVersion_args();
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getCSServiceVersion();
+      }
+    }
+
+    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addSSHCredential_call method_call = new addSSHCredential_call(sshCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential;
+      public addSSHCredential_call(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, 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.sshCredential = sshCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addSSHCredential_args args = new addSSHCredential_args();
+        args.setSshCredential(sshCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addSSHCredential();
+      }
+    }
+
+    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addCertificateCredential_call method_call = new addCertificateCredential_call(certificateCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential;
+      public addCertificateCredential_call(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, 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.certificateCredential = certificateCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addCertificateCredential_args args = new addCertificateCredential_args();
+        args.setCertificateCredential(certificateCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addCertificateCredential();
+      }
+    }
+
+    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addPasswordCredential_call method_call = new addPasswordCredential_call(passwordCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential;
+      public addPasswordCredential_call(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, 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.passwordCredential = passwordCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addPasswordCredential_args args = new addPasswordCredential_args();
+        args.setPasswordCredential(passwordCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addPasswordCredential();
+      }
+    }
+
+    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getSSHCredential_call method_call = new getSSHCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      private String gatewayId;
+      public getSSHCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
+        this.gatewayId = gatewayId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getSSHCredential_args args = new getSSHCredential_args();
+        args.setTokenId(tokenId);
+        args.setGatewayId(gatewayId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.SSHCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getSSHCredential();
+      }
+    }
+
+    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getCertificateCredential_call method_call = new getCertificateCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      private String gatewayId;
+      public getCertificateCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
+        this.gatewayId = gatewayId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getCertificateCredential_args args = new getCertificateCredential_args();
+        args.setTokenId(tokenId);
+        args.setGatewayId(gatewayId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.CertificateCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getCertificateCredential();
+      }
+    }
+
+    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getPasswordCredential_call method_call = new getPasswordCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      private String gatewayId;
+      public getPasswordCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
+        this.gatewayId = gatewayId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getPasswordCredential_args args = new getPasswordCredential_args();
+        args.setTokenId(tokenId);
+        args.setGatewayId(gatewayId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.PasswordCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getPasswordCredential();
+      }
+    }
+
+  }
+
+  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+    public Processor(I iface) {
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
+    }
+
+    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
+      processMap.put("getCSServiceVersion", new getCSServiceVersion());
+      processMap.put("addSSHCredential", new addSSHCredential());
+      processMap.put("addCertificateCredential", new addCertificateCredential());
+      processMap.put("addPasswordCredential", new addPasswordCredential());
+      processMap.put("getSSHCredential", new getSSHCredential());
+      processMap.put("getCertificateCredential", new getCertificateCredential());
+      processMap.put("getPasswordCredential", new getPasswordCredential());
+      return processMap;
+    }
+
+    public static class getCSServiceVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCSServiceVersion_args> {
+      public getCSServiceVersion() {
+        super("getCSServiceVersion");
+      }
+
+      public getCSServiceVersion_args getEmptyArgsInstance() {
+        return new getCSServiceVersion_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getCSServiceVersion_result getResult(I iface, getCSServiceVersion_args args) throws org.apache.thrift.TException {
+        getCSServiceVersion_result result = new getCSServiceVersion_result();
+        result.success = iface.getCSServiceVersion();
+        return result;
+      }
+    }
+
+    public static class addSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addSSHCredential_args> {
+      public addSSHCredential() {
+        super("addSSHCredential");
+      }
+
+      public addSSHCredential_args getEmptyArgsInstance() {
+        return new addSSHCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addSSHCredential_result getResult(I iface, addSSHCredential_args args) throws org.apache.thrift.TException {
+        addSSHCredential_result result = new addSSHCredential_result();
+        try {
+          result.success = iface.addSSHCredential(args.sshCredential);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class addCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addCertificateCredential_args> {
+      public addCertificateCredential() {
+        super("addCertificateCredential");
+      }
+
+      public addCertificateCredential_args getEmptyArgsInstance() {
+        return new addCertificateCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addCertificateCredential_result getResult(I iface, addCertificateCredential_args args) throws org.apache.thrift.TException {
+        addCertificateCredential_result result = new addCertificateCredential_result();
+        try {
+          result.success = iface.addCertificateCredential(args.certificateCredential);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class addPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addPasswordCredential_args> {
+      public addPasswordCredential() {
+        super("addPasswordCredential");
+      }
+
+      public addPasswordCredential_args getEmptyArgsInstance() {
+        return new addPasswordCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addPasswordCredential_result getResult(I iface, addPasswordCredential_args args) throws org.apache.thrift.TException {
+        addPasswordCredential_result result = new addPasswordCredential_result();
+        try {
+          result.success = iface.addPasswordCredential(args.passwordCredential);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class getSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSSHCredential_args> {
+      public getSSHCredential() {
+        super("getSSHCredential");
+      }
+
+      public getSSHCredential_args getEmptyArgsInstance() {
+        return new getSSHCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getSSHCredential_result getResult(I iface, getSSHCredential_args args) throws org.apache.thrift.TException {
+        getSSHCredential_result result = new getSSHCredential_result();
+        try {
+          result.success = iface.getSSHCredential(args.tokenId, args.gatewayId);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class getCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCertificateCredential_args> {
+      public getCertificateCredential() {
+        super("getCertificateCredential");
+      }
+
+      public getCertificateCredential_args getEmptyArgsInstance() {
+        return new getCertificateCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getCertificateCredential_result getResult(I iface, getCertificateCredential_args args) throws org.apache.thrift.TException {
+        getCertificateCredential_result result = new getCertificateCredential_result();
+        try {
+          result.success = iface.getCertificateCredential(args.tokenId, args.gatewayId);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class getPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPasswordCredential_args> {
+      public getPasswordCredential() {
+        super("getPasswordCredential");
+      }
+
+      public getPasswordCredential_args getEmptyArgsInstance() {
+        return new getPasswordCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getPasswordCredential_result getResult(I iface, getPasswordCredential_args args) throws org.apache.thrift.TException {
+        getPasswordCredential_result result = new getPasswordCredential_result();
+        try {
+          result.success = iface.getPasswordCredential(args.tokenId, args.gatewayId);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+  }
+
+  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
+    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
+    public AsyncProcessor(I iface) {
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
+    }
+
+    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      processMap.put("getCSServiceVersion", new getCSServiceVersion());
+      processMap.put("addSSHCredential", new addSSHCredential());
+      processMap.put("addCertificateCredential", new addCertificateCredential());
+      processMap.put("addPasswordCredential", new addPasswordCredential());
+      processMap.put("getSSHCredential", new getSSHCredential());
+      processMap.put("getCertificateCredential", new getCertificateCredential());
+      processMap.put("getPasswordCredential", new getPasswordCredential());
+      return processMap;
+    }
+
+    public static class getCSServiceVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCSServiceVersion_args, String> {
+      public getCSServiceVersion() {
+        super("getCSServiceVersion");
+      }
+
+      public getCSServiceVersion_args getEmptyArgsInstance() {
+        return new getCSServiceVersion_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            getCSServiceVersion_result result = new getCSServiceVersion_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getCSServiceVersion_result result = new getCSServiceVersion_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getCSServiceVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.getCSServiceVersion(resultHandler);
+      }
+    }
+
+    public static class addSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addSSHCredential_args, String> {
+      public addSSHCredential() {
+        super("addSSHCredential");
+      }
+
+      public addSSHCredential_args getEmptyArgsInstance() {
+        return new addSSHCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addSSHCredential_result result = new addSSHCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addSSHCredential_result result = new addSSHCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addSSHCredential(args.sshCredential,resultHandler);
+      }
+    }
+
+    public static class addCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addCertificateCredential_args, String> {
+      public addCertificateCredential() {
+        super("addCertificateCredential");
+      }
+
+      public addCertificateCredential_args getEmptyArgsInstance() {
+        return new addCertificateCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addCertificateCredential_result result = new addCertificateCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addCertificateCredential_result result = new addCertificateCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addCertificateCredential(args.certificateCredential,resultHandler);
+      }
+    }
+
+    public static class addPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addPasswordCredential_args, String> {
+      public addPasswordCredential() {
+        super("addPasswordCredential");
+      }
+
+      public addPasswordCredential_args getEmptyArgsInstance() {
+        return new addPasswordCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addPasswordCredential_result result = new addPasswordCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addPasswordCredential_result result = new addPasswordCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addPasswordCredential(args.passwordCredential,resultHandler);
+      }
+    }
+
+    public static class getSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSSHCredential_args, org.apache.airavata.credential.store.datamodel.SSHCredential> {
+      public getSSHCredential() {
+        super("getSSHCredential");
+      }
+
+      public getSSHCredential_args getEmptyArgsInstance() {
+        return new getSSHCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.SSHCredential o) {
+            getSSHCredential_result result = new getSSHCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getSSHCredential_result result = new getSSHCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> resultHandler) throws TException {
+        iface.getSSHCredential(args.tokenId, args.gatewayId,resultHandler);
+      }
+    }
+
+    public static class getCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCertificateCredential_args, org.apache.airavata.credential.store.datamodel.CertificateCredential> {
+      public getCertificateCredential() {
+        super("getCertificateCredential");
+      }
+
+      public getCertificateCredential_args getEmptyArgsInstance() {
+        return new getCertificateCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.CertificateCredential o) {
+            getCertificateCredential_result result = new getCertificateCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getCertificateCredential_result result = new getCertificateCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> resultHandler) throws TException {
+        iface.getCertificateCredential(args.tokenId, args.gatewayId,resultHandler);
+      }
+    }
+
+    public static class getPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPasswordCredential_args, org.apache.airavata.credential.store.datamodel.PasswordCredential> {
+      public getPasswordCredential() {
+        super("getPasswordCredential");
+      }
+
+      public getPasswordCredential_args getEmptyArgsInstance() {
+        return new getPasswordCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.PasswordCredential o) {
+            getPasswordCredential_result result = new getPasswordCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getPasswordCredential_result result = new getPasswordCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> resultHandler) throws TException {
+        iface.getPasswordCredential(args.tokenId, args.gatewayId,resultHandler);
+      }
+    }
+
+  }
+
+  public static class getCSServiceVersion_args implements org.apache.thrift.TBase<getCSServiceVersion_args, getCSServiceVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_args");
+
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getCSServiceVersion_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getCSServiceVersion_argsTupleSchemeFactory());
+    }
+
+
+    /** 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 {
+;
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_args.class, metaDataMap);
+    }
+
+    public getCSServiceVersion_args() {
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getCSServiceVersion_args(getCSServiceVersion_args other) {
+    }
+
+    public getCSServiceVersion_args deepCopy() {
+      return new getCSServiceVersion_args(this);
+    }
+
+    @Override
+    public void clear() {
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getCSServiceVersion_args)
+        return this.equals((getCSServiceVersion_args)that);
+      return false;
+    }
+
+    public boolean equals(getCSServiceVersion_args that) {
+      if (that == null)
+        return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getCSServiceVersion_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getCSServiceVersion_args(");
+      boolean first = true;
+
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getCSServiceVersion_argsStandardSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_argsStandardScheme getScheme() {
+        return new getCSServiceVersion_argsStandardScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_argsStandardScheme extends StandardScheme<getCSServiceVersion_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getCSServiceVersion_argsTupleSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_argsTupleScheme getScheme() {
+        return new getCSServiceVersion_argsTupleScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_argsTupleScheme extends TupleScheme<getCSServiceVersion_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+      }
+    }
+
+  }
+
+  public static class getCSServiceVersion_result implements org.apache.thrift.TBase<getCSServiceVersion_result, getCSServiceVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getCSServiceVersion_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getCSServiceVersion_resultTupleSchemeFactory());
+    }
+
+    public String success; // 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 {
+      SUCCESS((short)0, "success");
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_result.class, metaDataMap);
+    }
+
+    public getCSServiceVersion_result() {
+    }
+
+    public getCSServiceVersion_result(
+      String success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getCSServiceVersion_result(getCSServiceVersion_result other) {
+      if (other.isSetSuccess()) {
+        this.success = other.success;
+      }
+    }
+
+    public getCSServiceVersion_result deepCopy() {
+      return new getCSServiceVersion_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public String getSuccess() {
+      return this.success;
+    }
+
+    public getCSServiceVersion_result setSuccess(String success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getCSServiceVersion_result)
+        return this.equals((getCSServiceVersion_result)that);
+      return false;
+    }
+
+    public boolean equals(getCSServiceVersion_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getCSServiceVersion_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getCSServiceVersion_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getCSServiceVersion_resultStandardSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_resultStandardScheme getScheme() {
+        return new getCSServiceVersion_resultStandardScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_resultStandardScheme extends StandardScheme<getCSServiceVersion_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.success = iprot.readString();
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          oprot.writeString(struct.success);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getCSServiceVersion_resultTupleSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_resultTupleScheme getScheme() {
+        return new getCSServiceVersion_resultTupleScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_resultTupleScheme extends TupleScheme<getCSServiceVersion_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          oprot.writeString(struct.success);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.success = iprot.readString();
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class addSSHCredential_args implements org.apache.thrift.TBase<addSSHCredential_args, addSSHCredential_args._Fields>, java.io.Serializable, Cloneable, Comparable<addSSHCredential_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSSHCredential_args");
+
+    private static final org.apache.thrift.protocol.TField SSH_CREDENTIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("sshCredential", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new addSSHCredential_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new addSSHCredential_argsTupleSchemeFactory());
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential; // 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 {
+      SSH_CREDENTIAL((short)1, "sshCredential");
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 1: // SSH_CREDENTIAL
+            return SSH_CREDENTIAL;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SSH_CREDENTIAL, new org.apache.thrift.meta_data.FieldMetaData("sshCredential", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.credential.store.datamodel.SSHCredential.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addSSHCredential_args.class, metaDataMap);
+    }
+
+    public addSSHCredential_args() {
+    }
+
+    public addSSHCredential_args(
+      org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential)
+    {
+      this();
+      this.sshCredential = sshCredential;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public addSSHCredential_args(addSSHCredential_args other) {
+      if (other.isSetSshCredential()) {
+        this.sshCredential = new org.apache.airavata.credential.store.datamodel.SSHCredential(other.sshCredential);
+      }
+    }
+
+    public addSSHCredential_args deepCopy() {
+      return new addSSHCredential_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.sshCredential = null;
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSshCredential() {
+      return this.sshCredential;
+    }
+
+    public addSSHCredential_args setSshCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) {
+      this.sshCredential = sshCredential;
+      return this;
+    }
+
+    public void unsetSshCredential() {
+      this.sshCredential = null;
+    }
+
+    /** Returns true if field sshCredential is set (has been assigned a value) and false otherwise */
+    public boolean isSetSshCredential() {
+      return this.sshCredential != null;
+    }
+
+    public void setSshCredentialIsSet(boolean value) {
+      if (!value) {
+        this.sshCredential = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SSH_CREDENTIAL:
+        if (value == null) {
+          unsetSshCredential();
+        } else {
+          setSshCredential((org.apache.airavata.credential.store.datamodel.SSHCredential)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SSH_CREDENTIAL:
+        return getSshCredential();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SSH_CREDENTIAL:
+        return isSetSshCredential();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof addSSHCredential_args)
+        return this.equals((addSSHCredential_args)that);
+      return false;
+    }
+
+    public boolean equals(addSSHCredential_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_sshCredential = true && this.isSetSshCredential();
+      boolean that_present_sshCredential = true && that.isSetSshCredential();
+      if (this_present_sshCredential || that_present_sshCredential) {
+        if (!(this_present_sshCredential && that_present_sshCredential))
+          return false;
+        if (!this.sshCredential.equals(that.sshCredential))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(addSSHCredential_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSshCredential()).compareTo(other.isSetSshCredential());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSshCredential()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sshCredential, other.sshCredential);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("addSSHCredential_args(");
+      boolean first = true;
+
+      sb.append("sshCredential:");
+      if (this.sshCredential == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.sshCredential);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (sshCredential == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'sshCredential' was not present! Struct: " + toString());
+      }
+      // check for sub-struct validity
+      if (sshCredential != null) {
+        sshCredential.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    priva

<TRUNCATED>

[03/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/credentialStoreCPIConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/credentialStoreCPIConstants.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/credentialStoreCPIConstants.java
new file mode 100644
index 0000000..36a0039
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/credentialStoreCPIConstants.java
@@ -0,0 +1,55 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class credentialStoreCPIConstants {
+
+  public static final String CS_CPI_VERSION = "0.15.0";
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
new file mode 100644
index 0000000..ae37b1d
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
@@ -0,0 +1,1104 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CertificateCredential implements org.apache.thrift.TBase<CertificateCredential, CertificateCredential._Fields>, java.io.Serializable, Cloneable, Comparable<CertificateCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CertificateCredential");
+
+  private static final org.apache.thrift.protocol.TField COMMUNITY_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("communityUser", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+  private static final org.apache.thrift.protocol.TField X509_CERT_FIELD_DESC = new org.apache.thrift.protocol.TField("x509Cert", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField NOT_AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("notAfter", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField LIFE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lifeTime", org.apache.thrift.protocol.TType.I64, (short)5);
+  private static final org.apache.thrift.protocol.TField NOT_BEFORE_FIELD_DESC = new org.apache.thrift.protocol.TField("notBefore", org.apache.thrift.protocol.TType.STRING, (short)6);
+  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)7);
+  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)8);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new CertificateCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new CertificateCredentialTupleSchemeFactory());
+  }
+
+  public CommunityUser communityUser; // required
+  public String x509Cert; // required
+  public String notAfter; // optional
+  public String privateKey; // optional
+  public long lifeTime; // optional
+  public String notBefore; // optional
+  public long persistedTime; // optional
+  public String token; // optional
+
+  /** 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 {
+    COMMUNITY_USER((short)1, "communityUser"),
+    X509_CERT((short)2, "x509Cert"),
+    NOT_AFTER((short)3, "notAfter"),
+    PRIVATE_KEY((short)4, "privateKey"),
+    LIFE_TIME((short)5, "lifeTime"),
+    NOT_BEFORE((short)6, "notBefore"),
+    PERSISTED_TIME((short)7, "persistedTime"),
+    TOKEN((short)8, "token");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // COMMUNITY_USER
+          return COMMUNITY_USER;
+        case 2: // X509_CERT
+          return X509_CERT;
+        case 3: // NOT_AFTER
+          return NOT_AFTER;
+        case 4: // PRIVATE_KEY
+          return PRIVATE_KEY;
+        case 5: // LIFE_TIME
+          return LIFE_TIME;
+        case 6: // NOT_BEFORE
+          return NOT_BEFORE;
+        case 7: // PERSISTED_TIME
+          return PERSISTED_TIME;
+        case 8: // TOKEN
+          return TOKEN;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __LIFETIME_ISSET_ID = 0;
+  private static final int __PERSISTEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.NOT_AFTER,_Fields.PRIVATE_KEY,_Fields.LIFE_TIME,_Fields.NOT_BEFORE,_Fields.PERSISTED_TIME,_Fields.TOKEN};
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.COMMUNITY_USER, new org.apache.thrift.meta_data.FieldMetaData("communityUser", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CommunityUser.class)));
+    tmpMap.put(_Fields.X509_CERT, new org.apache.thrift.meta_data.FieldMetaData("x509Cert", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.NOT_AFTER, new org.apache.thrift.meta_data.FieldMetaData("notAfter", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.LIFE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lifeTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.NOT_BEFORE, new org.apache.thrift.meta_data.FieldMetaData("notBefore", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CertificateCredential.class, metaDataMap);
+  }
+
+  public CertificateCredential() {
+  }
+
+  public CertificateCredential(
+    CommunityUser communityUser,
+    String x509Cert)
+  {
+    this();
+    this.communityUser = communityUser;
+    this.x509Cert = x509Cert;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CertificateCredential(CertificateCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetCommunityUser()) {
+      this.communityUser = new CommunityUser(other.communityUser);
+    }
+    if (other.isSetX509Cert()) {
+      this.x509Cert = other.x509Cert;
+    }
+    if (other.isSetNotAfter()) {
+      this.notAfter = other.notAfter;
+    }
+    if (other.isSetPrivateKey()) {
+      this.privateKey = other.privateKey;
+    }
+    this.lifeTime = other.lifeTime;
+    if (other.isSetNotBefore()) {
+      this.notBefore = other.notBefore;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public CertificateCredential deepCopy() {
+    return new CertificateCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.communityUser = null;
+    this.x509Cert = null;
+    this.notAfter = null;
+    this.privateKey = null;
+    setLifeTimeIsSet(false);
+    this.lifeTime = 0;
+    this.notBefore = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public CommunityUser getCommunityUser() {
+    return this.communityUser;
+  }
+
+  public CertificateCredential setCommunityUser(CommunityUser communityUser) {
+    this.communityUser = communityUser;
+    return this;
+  }
+
+  public void unsetCommunityUser() {
+    this.communityUser = null;
+  }
+
+  /** Returns true if field communityUser is set (has been assigned a value) and false otherwise */
+  public boolean isSetCommunityUser() {
+    return this.communityUser != null;
+  }
+
+  public void setCommunityUserIsSet(boolean value) {
+    if (!value) {
+      this.communityUser = null;
+    }
+  }
+
+  public String getX509Cert() {
+    return this.x509Cert;
+  }
+
+  public CertificateCredential setX509Cert(String x509Cert) {
+    this.x509Cert = x509Cert;
+    return this;
+  }
+
+  public void unsetX509Cert() {
+    this.x509Cert = null;
+  }
+
+  /** Returns true if field x509Cert is set (has been assigned a value) and false otherwise */
+  public boolean isSetX509Cert() {
+    return this.x509Cert != null;
+  }
+
+  public void setX509CertIsSet(boolean value) {
+    if (!value) {
+      this.x509Cert = null;
+    }
+  }
+
+  public String getNotAfter() {
+    return this.notAfter;
+  }
+
+  public CertificateCredential setNotAfter(String notAfter) {
+    this.notAfter = notAfter;
+    return this;
+  }
+
+  public void unsetNotAfter() {
+    this.notAfter = null;
+  }
+
+  /** Returns true if field notAfter is set (has been assigned a value) and false otherwise */
+  public boolean isSetNotAfter() {
+    return this.notAfter != null;
+  }
+
+  public void setNotAfterIsSet(boolean value) {
+    if (!value) {
+      this.notAfter = null;
+    }
+  }
+
+  public String getPrivateKey() {
+    return this.privateKey;
+  }
+
+  public CertificateCredential setPrivateKey(String privateKey) {
+    this.privateKey = privateKey;
+    return this;
+  }
+
+  public void unsetPrivateKey() {
+    this.privateKey = null;
+  }
+
+  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
+  public boolean isSetPrivateKey() {
+    return this.privateKey != null;
+  }
+
+  public void setPrivateKeyIsSet(boolean value) {
+    if (!value) {
+      this.privateKey = null;
+    }
+  }
+
+  public long getLifeTime() {
+    return this.lifeTime;
+  }
+
+  public CertificateCredential setLifeTime(long lifeTime) {
+    this.lifeTime = lifeTime;
+    setLifeTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetLifeTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIFETIME_ISSET_ID);
+  }
+
+  /** Returns true if field lifeTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetLifeTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __LIFETIME_ISSET_ID);
+  }
+
+  public void setLifeTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIFETIME_ISSET_ID, value);
+  }
+
+  public String getNotBefore() {
+    return this.notBefore;
+  }
+
+  public CertificateCredential setNotBefore(String notBefore) {
+    this.notBefore = notBefore;
+    return this;
+  }
+
+  public void unsetNotBefore() {
+    this.notBefore = null;
+  }
+
+  /** Returns true if field notBefore is set (has been assigned a value) and false otherwise */
+  public boolean isSetNotBefore() {
+    return this.notBefore != null;
+  }
+
+  public void setNotBeforeIsSet(boolean value) {
+    if (!value) {
+      this.notBefore = null;
+    }
+  }
+
+  public long getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public CertificateCredential setPersistedTime(long persistedTime) {
+    this.persistedTime = persistedTime;
+    setPersistedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetPersistedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetPersistedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  public void setPersistedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
+  }
+
+  public String getToken() {
+    return this.token;
+  }
+
+  public CertificateCredential setToken(String token) {
+    this.token = token;
+    return this;
+  }
+
+  public void unsetToken() {
+    this.token = null;
+  }
+
+  /** Returns true if field token is set (has been assigned a value) and false otherwise */
+  public boolean isSetToken() {
+    return this.token != null;
+  }
+
+  public void setTokenIsSet(boolean value) {
+    if (!value) {
+      this.token = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case COMMUNITY_USER:
+      if (value == null) {
+        unsetCommunityUser();
+      } else {
+        setCommunityUser((CommunityUser)value);
+      }
+      break;
+
+    case X509_CERT:
+      if (value == null) {
+        unsetX509Cert();
+      } else {
+        setX509Cert((String)value);
+      }
+      break;
+
+    case NOT_AFTER:
+      if (value == null) {
+        unsetNotAfter();
+      } else {
+        setNotAfter((String)value);
+      }
+      break;
+
+    case PRIVATE_KEY:
+      if (value == null) {
+        unsetPrivateKey();
+      } else {
+        setPrivateKey((String)value);
+      }
+      break;
+
+    case LIFE_TIME:
+      if (value == null) {
+        unsetLifeTime();
+      } else {
+        setLifeTime((Long)value);
+      }
+      break;
+
+    case NOT_BEFORE:
+      if (value == null) {
+        unsetNotBefore();
+      } else {
+        setNotBefore((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Long)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case COMMUNITY_USER:
+      return getCommunityUser();
+
+    case X509_CERT:
+      return getX509Cert();
+
+    case NOT_AFTER:
+      return getNotAfter();
+
+    case PRIVATE_KEY:
+      return getPrivateKey();
+
+    case LIFE_TIME:
+      return Long.valueOf(getLifeTime());
+
+    case NOT_BEFORE:
+      return getNotBefore();
+
+    case PERSISTED_TIME:
+      return Long.valueOf(getPersistedTime());
+
+    case TOKEN:
+      return getToken();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case COMMUNITY_USER:
+      return isSetCommunityUser();
+    case X509_CERT:
+      return isSetX509Cert();
+    case NOT_AFTER:
+      return isSetNotAfter();
+    case PRIVATE_KEY:
+      return isSetPrivateKey();
+    case LIFE_TIME:
+      return isSetLifeTime();
+    case NOT_BEFORE:
+      return isSetNotBefore();
+    case PERSISTED_TIME:
+      return isSetPersistedTime();
+    case TOKEN:
+      return isSetToken();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof CertificateCredential)
+      return this.equals((CertificateCredential)that);
+    return false;
+  }
+
+  public boolean equals(CertificateCredential that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_communityUser = true && this.isSetCommunityUser();
+    boolean that_present_communityUser = true && that.isSetCommunityUser();
+    if (this_present_communityUser || that_present_communityUser) {
+      if (!(this_present_communityUser && that_present_communityUser))
+        return false;
+      if (!this.communityUser.equals(that.communityUser))
+        return false;
+    }
+
+    boolean this_present_x509Cert = true && this.isSetX509Cert();
+    boolean that_present_x509Cert = true && that.isSetX509Cert();
+    if (this_present_x509Cert || that_present_x509Cert) {
+      if (!(this_present_x509Cert && that_present_x509Cert))
+        return false;
+      if (!this.x509Cert.equals(that.x509Cert))
+        return false;
+    }
+
+    boolean this_present_notAfter = true && this.isSetNotAfter();
+    boolean that_present_notAfter = true && that.isSetNotAfter();
+    if (this_present_notAfter || that_present_notAfter) {
+      if (!(this_present_notAfter && that_present_notAfter))
+        return false;
+      if (!this.notAfter.equals(that.notAfter))
+        return false;
+    }
+
+    boolean this_present_privateKey = true && this.isSetPrivateKey();
+    boolean that_present_privateKey = true && that.isSetPrivateKey();
+    if (this_present_privateKey || that_present_privateKey) {
+      if (!(this_present_privateKey && that_present_privateKey))
+        return false;
+      if (!this.privateKey.equals(that.privateKey))
+        return false;
+    }
+
+    boolean this_present_lifeTime = true && this.isSetLifeTime();
+    boolean that_present_lifeTime = true && that.isSetLifeTime();
+    if (this_present_lifeTime || that_present_lifeTime) {
+      if (!(this_present_lifeTime && that_present_lifeTime))
+        return false;
+      if (this.lifeTime != that.lifeTime)
+        return false;
+    }
+
+    boolean this_present_notBefore = true && this.isSetNotBefore();
+    boolean that_present_notBefore = true && that.isSetNotBefore();
+    if (this_present_notBefore || that_present_notBefore) {
+      if (!(this_present_notBefore && that_present_notBefore))
+        return false;
+      if (!this.notBefore.equals(that.notBefore))
+        return false;
+    }
+
+    boolean this_present_persistedTime = true && this.isSetPersistedTime();
+    boolean that_present_persistedTime = true && that.isSetPersistedTime();
+    if (this_present_persistedTime || that_present_persistedTime) {
+      if (!(this_present_persistedTime && that_present_persistedTime))
+        return false;
+      if (this.persistedTime != that.persistedTime)
+        return false;
+    }
+
+    boolean this_present_token = true && this.isSetToken();
+    boolean that_present_token = true && that.isSetToken();
+    if (this_present_token || that_present_token) {
+      if (!(this_present_token && that_present_token))
+        return false;
+      if (!this.token.equals(that.token))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CertificateCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetCommunityUser()).compareTo(other.isSetCommunityUser());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCommunityUser()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.communityUser, other.communityUser);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetX509Cert()).compareTo(other.isSetX509Cert());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetX509Cert()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.x509Cert, other.x509Cert);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetNotAfter()).compareTo(other.isSetNotAfter());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetNotAfter()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notAfter, other.notAfter);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPrivateKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetLifeTime()).compareTo(other.isSetLifeTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetLifeTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lifeTime, other.lifeTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetNotBefore()).compareTo(other.isSetNotBefore());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetNotBefore()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notBefore, other.notBefore);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPersistedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetToken()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("CertificateCredential(");
+    boolean first = true;
+
+    sb.append("communityUser:");
+    if (this.communityUser == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.communityUser);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("x509Cert:");
+    if (this.x509Cert == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.x509Cert);
+    }
+    first = false;
+    if (isSetNotAfter()) {
+      if (!first) sb.append(", ");
+      sb.append("notAfter:");
+      if (this.notAfter == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.notAfter);
+      }
+      first = false;
+    }
+    if (isSetPrivateKey()) {
+      if (!first) sb.append(", ");
+      sb.append("privateKey:");
+      if (this.privateKey == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.privateKey);
+      }
+      first = false;
+    }
+    if (isSetLifeTime()) {
+      if (!first) sb.append(", ");
+      sb.append("lifeTime:");
+      sb.append(this.lifeTime);
+      first = false;
+    }
+    if (isSetNotBefore()) {
+      if (!first) sb.append(", ");
+      sb.append("notBefore:");
+      if (this.notBefore == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.notBefore);
+      }
+      first = false;
+    }
+    if (isSetPersistedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("persistedTime:");
+      sb.append(this.persistedTime);
+      first = false;
+    }
+    if (isSetToken()) {
+      if (!first) sb.append(", ");
+      sb.append("token:");
+      if (this.token == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.token);
+      }
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (communityUser == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'communityUser' was not present! Struct: " + toString());
+    }
+    if (x509Cert == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'x509Cert' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+    if (communityUser != null) {
+      communityUser.validate();
+    }
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class CertificateCredentialStandardSchemeFactory implements SchemeFactory {
+    public CertificateCredentialStandardScheme getScheme() {
+      return new CertificateCredentialStandardScheme();
+    }
+  }
+
+  private static class CertificateCredentialStandardScheme extends StandardScheme<CertificateCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, CertificateCredential struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // COMMUNITY_USER
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.communityUser = new CommunityUser();
+              struct.communityUser.read(iprot);
+              struct.setCommunityUserIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // X509_CERT
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.x509Cert = iprot.readString();
+              struct.setX509CertIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // NOT_AFTER
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.notAfter = iprot.readString();
+              struct.setNotAfterIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // PRIVATE_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.privateKey = iprot.readString();
+              struct.setPrivateKeyIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // LIFE_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.lifeTime = iprot.readI64();
+              struct.setLifeTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // NOT_BEFORE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.notBefore = iprot.readString();
+              struct.setNotBeforeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.persistedTime = iprot.readI64();
+              struct.setPersistedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // TOKEN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.token = iprot.readString();
+              struct.setTokenIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, CertificateCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.communityUser != null) {
+        oprot.writeFieldBegin(COMMUNITY_USER_FIELD_DESC);
+        struct.communityUser.write(oprot);
+        oprot.writeFieldEnd();
+      }
+      if (struct.x509Cert != null) {
+        oprot.writeFieldBegin(X509_CERT_FIELD_DESC);
+        oprot.writeString(struct.x509Cert);
+        oprot.writeFieldEnd();
+      }
+      if (struct.notAfter != null) {
+        if (struct.isSetNotAfter()) {
+          oprot.writeFieldBegin(NOT_AFTER_FIELD_DESC);
+          oprot.writeString(struct.notAfter);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.privateKey != null) {
+        if (struct.isSetPrivateKey()) {
+          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
+          oprot.writeString(struct.privateKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetLifeTime()) {
+        oprot.writeFieldBegin(LIFE_TIME_FIELD_DESC);
+        oprot.writeI64(struct.lifeTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.notBefore != null) {
+        if (struct.isSetNotBefore()) {
+          oprot.writeFieldBegin(NOT_BEFORE_FIELD_DESC);
+          oprot.writeString(struct.notBefore);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.persistedTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.token != null) {
+        if (struct.isSetToken()) {
+          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
+          oprot.writeString(struct.token);
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class CertificateCredentialTupleSchemeFactory implements SchemeFactory {
+    public CertificateCredentialTupleScheme getScheme() {
+      return new CertificateCredentialTupleScheme();
+    }
+  }
+
+  private static class CertificateCredentialTupleScheme extends TupleScheme<CertificateCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      struct.communityUser.write(oprot);
+      oprot.writeString(struct.x509Cert);
+      BitSet optionals = new BitSet();
+      if (struct.isSetNotAfter()) {
+        optionals.set(0);
+      }
+      if (struct.isSetPrivateKey()) {
+        optionals.set(1);
+      }
+      if (struct.isSetLifeTime()) {
+        optionals.set(2);
+      }
+      if (struct.isSetNotBefore()) {
+        optionals.set(3);
+      }
+      if (struct.isSetPersistedTime()) {
+        optionals.set(4);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(5);
+      }
+      oprot.writeBitSet(optionals, 6);
+      if (struct.isSetNotAfter()) {
+        oprot.writeString(struct.notAfter);
+      }
+      if (struct.isSetPrivateKey()) {
+        oprot.writeString(struct.privateKey);
+      }
+      if (struct.isSetLifeTime()) {
+        oprot.writeI64(struct.lifeTime);
+      }
+      if (struct.isSetNotBefore()) {
+        oprot.writeString(struct.notBefore);
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI64(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.communityUser = new CommunityUser();
+      struct.communityUser.read(iprot);
+      struct.setCommunityUserIsSet(true);
+      struct.x509Cert = iprot.readString();
+      struct.setX509CertIsSet(true);
+      BitSet incoming = iprot.readBitSet(6);
+      if (incoming.get(0)) {
+        struct.notAfter = iprot.readString();
+        struct.setNotAfterIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.privateKey = iprot.readString();
+        struct.setPrivateKeyIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.lifeTime = iprot.readI64();
+        struct.setLifeTimeIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.notBefore = iprot.readString();
+        struct.setNotBeforeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.persistedTime = iprot.readI64();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
new file mode 100644
index 0000000..02bce55
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
@@ -0,0 +1,589 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser");
+
+  private static final org.apache.thrift.protocol.TField GATEWAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayName", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField USER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userEmail", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new CommunityUserStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new CommunityUserTupleSchemeFactory());
+  }
+
+  public String gatewayName; // required
+  public String username; // required
+  public String userEmail; // 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 {
+    GATEWAY_NAME((short)1, "gatewayName"),
+    USERNAME((short)2, "username"),
+    USER_EMAIL((short)3, "userEmail");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // GATEWAY_NAME
+          return GATEWAY_NAME;
+        case 2: // USERNAME
+          return USERNAME;
+        case 3: // USER_EMAIL
+          return USER_EMAIL;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.GATEWAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", 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(CommunityUser.class, metaDataMap);
+  }
+
+  public CommunityUser() {
+  }
+
+  public CommunityUser(
+    String gatewayName,
+    String username,
+    String userEmail)
+  {
+    this();
+    this.gatewayName = gatewayName;
+    this.username = username;
+    this.userEmail = userEmail;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CommunityUser(CommunityUser other) {
+    if (other.isSetGatewayName()) {
+      this.gatewayName = other.gatewayName;
+    }
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetUserEmail()) {
+      this.userEmail = other.userEmail;
+    }
+  }
+
+  public CommunityUser deepCopy() {
+    return new CommunityUser(this);
+  }
+
+  @Override
+  public void clear() {
+    this.gatewayName = null;
+    this.username = null;
+    this.userEmail = null;
+  }
+
+  public String getGatewayName() {
+    return this.gatewayName;
+  }
+
+  public CommunityUser setGatewayName(String gatewayName) {
+    this.gatewayName = gatewayName;
+    return this;
+  }
+
+  public void unsetGatewayName() {
+    this.gatewayName = null;
+  }
+
+  /** Returns true if field gatewayName is set (has been assigned a value) and false otherwise */
+  public boolean isSetGatewayName() {
+    return this.gatewayName != null;
+  }
+
+  public void setGatewayNameIsSet(boolean value) {
+    if (!value) {
+      this.gatewayName = null;
+    }
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public CommunityUser setUsername(String username) {
+    this.username = username;
+    return this;
+  }
+
+  public void unsetUsername() {
+    this.username = null;
+  }
+
+  /** Returns true if field username is set (has been assigned a value) and false otherwise */
+  public boolean isSetUsername() {
+    return this.username != null;
+  }
+
+  public void setUsernameIsSet(boolean value) {
+    if (!value) {
+      this.username = null;
+    }
+  }
+
+  public String getUserEmail() {
+    return this.userEmail;
+  }
+
+  public CommunityUser setUserEmail(String userEmail) {
+    this.userEmail = userEmail;
+    return this;
+  }
+
+  public void unsetUserEmail() {
+    this.userEmail = null;
+  }
+
+  /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
+  public boolean isSetUserEmail() {
+    return this.userEmail != null;
+  }
+
+  public void setUserEmailIsSet(boolean value) {
+    if (!value) {
+      this.userEmail = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case GATEWAY_NAME:
+      if (value == null) {
+        unsetGatewayName();
+      } else {
+        setGatewayName((String)value);
+      }
+      break;
+
+    case USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case USER_EMAIL:
+      if (value == null) {
+        unsetUserEmail();
+      } else {
+        setUserEmail((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case GATEWAY_NAME:
+      return getGatewayName();
+
+    case USERNAME:
+      return getUsername();
+
+    case USER_EMAIL:
+      return getUserEmail();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case GATEWAY_NAME:
+      return isSetGatewayName();
+    case USERNAME:
+      return isSetUsername();
+    case USER_EMAIL:
+      return isSetUserEmail();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof CommunityUser)
+      return this.equals((CommunityUser)that);
+    return false;
+  }
+
+  public boolean equals(CommunityUser that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_gatewayName = true && this.isSetGatewayName();
+    boolean that_present_gatewayName = true && that.isSetGatewayName();
+    if (this_present_gatewayName || that_present_gatewayName) {
+      if (!(this_present_gatewayName && that_present_gatewayName))
+        return false;
+      if (!this.gatewayName.equals(that.gatewayName))
+        return false;
+    }
+
+    boolean this_present_username = true && this.isSetUsername();
+    boolean that_present_username = true && that.isSetUsername();
+    if (this_present_username || that_present_username) {
+      if (!(this_present_username && that_present_username))
+        return false;
+      if (!this.username.equals(that.username))
+        return false;
+    }
+
+    boolean this_present_userEmail = true && this.isSetUserEmail();
+    boolean that_present_userEmail = true && that.isSetUserEmail();
+    if (this_present_userEmail || that_present_userEmail) {
+      if (!(this_present_userEmail && that_present_userEmail))
+        return false;
+      if (!this.userEmail.equals(that.userEmail))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CommunityUser other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetGatewayName()).compareTo(other.isSetGatewayName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGatewayName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayName, other.gatewayName);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUsername()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(other.isSetUserEmail());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUserEmail()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, other.userEmail);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("CommunityUser(");
+    boolean first = true;
+
+    sb.append("gatewayName:");
+    if (this.gatewayName == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.gatewayName);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("userEmail:");
+    if (this.userEmail == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.userEmail);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (gatewayName == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayName' was not present! Struct: " + toString());
+    }
+    if (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+    }
+    if (userEmail == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'userEmail' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class CommunityUserStandardSchemeFactory implements SchemeFactory {
+    public CommunityUserStandardScheme getScheme() {
+      return new CommunityUserStandardScheme();
+    }
+  }
+
+  private static class CommunityUserStandardScheme extends StandardScheme<CommunityUser> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, CommunityUser struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // GATEWAY_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.gatewayName = iprot.readString();
+              struct.setGatewayNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // USERNAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.username = iprot.readString();
+              struct.setUsernameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // USER_EMAIL
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.userEmail = iprot.readString();
+              struct.setUserEmailIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, CommunityUser struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.gatewayName != null) {
+        oprot.writeFieldBegin(GATEWAY_NAME_FIELD_DESC);
+        oprot.writeString(struct.gatewayName);
+        oprot.writeFieldEnd();
+      }
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.userEmail != null) {
+        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
+        oprot.writeString(struct.userEmail);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class CommunityUserTupleSchemeFactory implements SchemeFactory {
+    public CommunityUserTupleScheme getScheme() {
+      return new CommunityUserTupleScheme();
+    }
+  }
+
+  private static class CommunityUserTupleScheme extends TupleScheme<CommunityUser> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.gatewayName);
+      oprot.writeString(struct.username);
+      oprot.writeString(struct.userEmail);
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.gatewayName = iprot.readString();
+      struct.setGatewayNameIsSet(true);
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      struct.userEmail = iprot.readString();
+      struct.setUserEmailIsSet(true);
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
new file mode 100644
index 0000000..f6b6837
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
@@ -0,0 +1,698 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class PasswordCredential implements org.apache.thrift.TBase<PasswordCredential, PasswordCredential._Fields>, java.io.Serializable, Cloneable, Comparable<PasswordCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PasswordCredential");
+
+  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)3);
+  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new PasswordCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PasswordCredentialTupleSchemeFactory());
+  }
+
+  public String username; // required
+  public String password; // required
+  public long persistedTime; // optional
+  public String token; // optional
+
+  /** 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 {
+    USERNAME((short)1, "username"),
+    PASSWORD((short)2, "password"),
+    PERSISTED_TIME((short)3, "persistedTime"),
+    TOKEN((short)4, "token");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // USERNAME
+          return USERNAME;
+        case 2: // PASSWORD
+          return PASSWORD;
+        case 3: // PERSISTED_TIME
+          return PERSISTED_TIME;
+        case 4: // TOKEN
+          return TOKEN;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __PERSISTEDTIME_ISSET_ID = 0;
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.PERSISTED_TIME,_Fields.TOKEN};
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PasswordCredential.class, metaDataMap);
+  }
+
+  public PasswordCredential() {
+  }
+
+  public PasswordCredential(
+    String username,
+    String password)
+  {
+    this();
+    this.username = username;
+    this.password = password;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public PasswordCredential(PasswordCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetPassword()) {
+      this.password = other.password;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public PasswordCredential deepCopy() {
+    return new PasswordCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.username = null;
+    this.password = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public PasswordCredential setUsername(String username) {
+    this.username = username;
+    return this;
+  }
+
+  public void unsetUsername() {
+    this.username = null;
+  }
+
+  /** Returns true if field username is set (has been assigned a value) and false otherwise */
+  public boolean isSetUsername() {
+    return this.username != null;
+  }
+
+  public void setUsernameIsSet(boolean value) {
+    if (!value) {
+      this.username = null;
+    }
+  }
+
+  public String getPassword() {
+    return this.password;
+  }
+
+  public PasswordCredential setPassword(String password) {
+    this.password = password;
+    return this;
+  }
+
+  public void unsetPassword() {
+    this.password = null;
+  }
+
+  /** Returns true if field password is set (has been assigned a value) and false otherwise */
+  public boolean isSetPassword() {
+    return this.password != null;
+  }
+
+  public void setPasswordIsSet(boolean value) {
+    if (!value) {
+      this.password = null;
+    }
+  }
+
+  public long getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public PasswordCredential setPersistedTime(long persistedTime) {
+    this.persistedTime = persistedTime;
+    setPersistedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetPersistedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetPersistedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  public void setPersistedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
+  }
+
+  public String getToken() {
+    return this.token;
+  }
+
+  public PasswordCredential setToken(String token) {
+    this.token = token;
+    return this;
+  }
+
+  public void unsetToken() {
+    this.token = null;
+  }
+
+  /** Returns true if field token is set (has been assigned a value) and false otherwise */
+  public boolean isSetToken() {
+    return this.token != null;
+  }
+
+  public void setTokenIsSet(boolean value) {
+    if (!value) {
+      this.token = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case PASSWORD:
+      if (value == null) {
+        unsetPassword();
+      } else {
+        setPassword((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Long)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case USERNAME:
+      return getUsername();
+
+    case PASSWORD:
+      return getPassword();
+
+    case PERSISTED_TIME:
+      return Long.valueOf(getPersistedTime());
+
+    case TOKEN:
+      return getToken();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case USERNAME:
+      return isSetUsername();
+    case PASSWORD:
+      return isSetPassword();
+    case PERSISTED_TIME:
+      return isSetPersistedTime();
+    case TOKEN:
+      return isSetToken();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof PasswordCredential)
+      return this.equals((PasswordCredential)that);
+    return false;
+  }
+
+  public boolean equals(PasswordCredential that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_username = true && this.isSetUsername();
+    boolean that_present_username = true && that.isSetUsername();
+    if (this_present_username || that_present_username) {
+      if (!(this_present_username && that_present_username))
+        return false;
+      if (!this.username.equals(that.username))
+        return false;
+    }
+
+    boolean this_present_password = true && this.isSetPassword();
+    boolean that_present_password = true && that.isSetPassword();
+    if (this_present_password || that_present_password) {
+      if (!(this_present_password && that_present_password))
+        return false;
+      if (!this.password.equals(that.password))
+        return false;
+    }
+
+    boolean this_present_persistedTime = true && this.isSetPersistedTime();
+    boolean that_present_persistedTime = true && that.isSetPersistedTime();
+    if (this_present_persistedTime || that_present_persistedTime) {
+      if (!(this_present_persistedTime && that_present_persistedTime))
+        return false;
+      if (this.persistedTime != that.persistedTime)
+        return false;
+    }
+
+    boolean this_present_token = true && this.isSetToken();
+    boolean that_present_token = true && that.isSetToken();
+    if (this_present_token || that_present_token) {
+      if (!(this_present_token && that_present_token))
+        return false;
+      if (!this.token.equals(that.token))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(PasswordCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUsername()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPassword()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPersistedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetToken()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("PasswordCredential(");
+    boolean first = true;
+
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("password:");
+    if (this.password == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.password);
+    }
+    first = false;
+    if (isSetPersistedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("persistedTime:");
+      sb.append(this.persistedTime);
+      first = false;
+    }
+    if (isSetToken()) {
+      if (!first) sb.append(", ");
+      sb.append("token:");
+      if (this.token == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.token);
+      }
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+    }
+    if (password == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'password' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class PasswordCredentialStandardSchemeFactory implements SchemeFactory {
+    public PasswordCredentialStandardScheme getScheme() {
+      return new PasswordCredentialStandardScheme();
+    }
+  }
+
+  private static class PasswordCredentialStandardScheme extends StandardScheme<PasswordCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PasswordCredential struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // USERNAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.username = iprot.readString();
+              struct.setUsernameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // PASSWORD
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.password = iprot.readString();
+              struct.setPasswordIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.persistedTime = iprot.readI64();
+              struct.setPersistedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // TOKEN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.token = iprot.readString();
+              struct.setTokenIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, PasswordCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.password != null) {
+        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
+        oprot.writeString(struct.password);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.persistedTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.token != null) {
+        if (struct.isSetToken()) {
+          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
+          oprot.writeString(struct.token);
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class PasswordCredentialTupleSchemeFactory implements SchemeFactory {
+    public PasswordCredentialTupleScheme getScheme() {
+      return new PasswordCredentialTupleScheme();
+    }
+  }
+
+  private static class PasswordCredentialTupleScheme extends TupleScheme<PasswordCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.username);
+      oprot.writeString(struct.password);
+      BitSet optionals = new BitSet();
+      if (struct.isSetPersistedTime()) {
+        optionals.set(0);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(1);
+      }
+      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI64(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      struct.password = iprot.readString();
+      struct.setPasswordIsSet(true);
+      BitSet incoming = iprot.readBitSet(2);
+      if (incoming.get(0)) {
+        struct.persistedTime = iprot.readI64();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+


[40/62] [abbrv] airavata git commit: fixing compilation isssue, bug in getAvailableAppInterfaceComputeResources(), fixing AIRAVATA-1226, AIRAVATA-1626

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
index f893bb6..ff7d330 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
@@ -128,6 +128,8 @@ import org.slf4j.LoggerFactory;
      */
     public org.apache.airavata.model.workspace.Project getProject(String projectId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.ProjectNotFoundException, org.apache.thrift.TException;
 
+    public boolean deleteProject(String projectId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.ProjectNotFoundException, org.apache.thrift.TException;
+
     /**
      *   * Get all Project by user
      *   *
@@ -1527,6 +1529,8 @@ import org.slf4j.LoggerFactory;
 
     public void getProject(String projectId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void deleteProject(String projectId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void getAllUserProjects(String gatewayId, String userName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void searchProjectsByProjectName(String gatewayId, String userName, String projectName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -2171,6 +2175,41 @@ import org.slf4j.LoggerFactory;
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getProject failed: unknown result");
     }
 
+    public boolean deleteProject(String projectId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.ProjectNotFoundException, org.apache.thrift.TException
+    {
+      send_deleteProject(projectId);
+      return recv_deleteProject();
+    }
+
+    public void send_deleteProject(String projectId) throws org.apache.thrift.TException
+    {
+      deleteProject_args args = new deleteProject_args();
+      args.setProjectId(projectId);
+      sendBase("deleteProject", args);
+    }
+
+    public boolean recv_deleteProject() throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.ProjectNotFoundException, org.apache.thrift.TException
+    {
+      deleteProject_result result = new deleteProject_result();
+      receiveBase(result, "deleteProject");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ire != null) {
+        throw result.ire;
+      }
+      if (result.ace != null) {
+        throw result.ace;
+      }
+      if (result.ase != null) {
+        throw result.ase;
+      }
+      if (result.pnfe != null) {
+        throw result.pnfe;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteProject failed: unknown result");
+    }
+
     public List<org.apache.airavata.model.workspace.Project> getAllUserProjects(String gatewayId, String userName) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.thrift.TException
     {
       send_getAllUserProjects(gatewayId, userName);
@@ -5945,6 +5984,38 @@ import org.slf4j.LoggerFactory;
       }
     }
 
+    public void deleteProject(String projectId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      deleteProject_call method_call = new deleteProject_call(projectId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class deleteProject_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String projectId;
+      public deleteProject_call(String projectId, 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.projectId = projectId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteProject", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        deleteProject_args args = new deleteProject_args();
+        args.setProjectId(projectId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public boolean getResult() throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.ProjectNotFoundException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_deleteProject();
+      }
+    }
+
     public void getAllUserProjects(String gatewayId, String userName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       getAllUserProjects_call method_call = new getAllUserProjects_call(gatewayId, userName, resultHandler, this, ___protocolFactory, ___transport);
@@ -9436,6 +9507,7 @@ import org.slf4j.LoggerFactory;
       processMap.put("createProject", new createProject());
       processMap.put("updateProject", new updateProject());
       processMap.put("getProject", new getProject());
+      processMap.put("deleteProject", new deleteProject());
       processMap.put("getAllUserProjects", new getAllUserProjects());
       processMap.put("searchProjectsByProjectName", new searchProjectsByProjectName());
       processMap.put("searchProjectsByProjectDesc", new searchProjectsByProjectDesc());
@@ -9911,6 +9983,37 @@ import org.slf4j.LoggerFactory;
       }
     }
 
+    public static class deleteProject<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteProject_args> {
+      public deleteProject() {
+        super("deleteProject");
+      }
+
+      public deleteProject_args getEmptyArgsInstance() {
+        return new deleteProject_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public deleteProject_result getResult(I iface, deleteProject_args args) throws org.apache.thrift.TException {
+        deleteProject_result result = new deleteProject_result();
+        try {
+          result.success = iface.deleteProject(args.projectId);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.airavata.model.error.InvalidRequestException ire) {
+          result.ire = ire;
+        } catch (org.apache.airavata.model.error.AiravataClientException ace) {
+          result.ace = ace;
+        } catch (org.apache.airavata.model.error.AiravataSystemException ase) {
+          result.ase = ase;
+        } catch (org.apache.airavata.model.error.ProjectNotFoundException pnfe) {
+          result.pnfe = pnfe;
+        }
+        return result;
+      }
+    }
+
     public static class getAllUserProjects<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllUserProjects_args> {
       public getAllUserProjects() {
         super("getAllUserProjects");
@@ -12837,6 +12940,7 @@ import org.slf4j.LoggerFactory;
       processMap.put("createProject", new createProject());
       processMap.put("updateProject", new updateProject());
       processMap.put("getProject", new getProject());
+      processMap.put("deleteProject", new deleteProject());
       processMap.put("getAllUserProjects", new getAllUserProjects());
       processMap.put("searchProjectsByProjectName", new searchProjectsByProjectName());
       processMap.put("searchProjectsByProjectDesc", new searchProjectsByProjectDesc());
@@ -13823,6 +13927,79 @@ import org.slf4j.LoggerFactory;
       }
     }
 
+    public static class deleteProject<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteProject_args, Boolean> {
+      public deleteProject() {
+        super("deleteProject");
+      }
+
+      public deleteProject_args getEmptyArgsInstance() {
+        return new deleteProject_args();
+      }
+
+      public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Boolean>() { 
+          public void onComplete(Boolean o) {
+            deleteProject_result result = new deleteProject_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            deleteProject_result result = new deleteProject_result();
+            if (e instanceof org.apache.airavata.model.error.InvalidRequestException) {
+                        result.ire = (org.apache.airavata.model.error.InvalidRequestException) e;
+                        result.setIreIsSet(true);
+                        msg = result;
+            }
+            else             if (e instanceof org.apache.airavata.model.error.AiravataClientException) {
+                        result.ace = (org.apache.airavata.model.error.AiravataClientException) e;
+                        result.setAceIsSet(true);
+                        msg = result;
+            }
+            else             if (e instanceof org.apache.airavata.model.error.AiravataSystemException) {
+                        result.ase = (org.apache.airavata.model.error.AiravataSystemException) e;
+                        result.setAseIsSet(true);
+                        msg = result;
+            }
+            else             if (e instanceof org.apache.airavata.model.error.ProjectNotFoundException) {
+                        result.pnfe = (org.apache.airavata.model.error.ProjectNotFoundException) e;
+                        result.setPnfeIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, deleteProject_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+        iface.deleteProject(args.projectId,resultHandler);
+      }
+    }
+
     public static class getAllUserProjects<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllUserProjects_args, List<org.apache.airavata.model.workspace.Project>> {
       public getAllUserProjects() {
         super("getAllUserProjects");
@@ -20792,33 +20969,993 @@ import org.slf4j.LoggerFactory;
     static {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAPIVersion_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAPIVersion_args.class, metaDataMap);
+    }
+
+    public getAPIVersion_args() {
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getAPIVersion_args(getAPIVersion_args other) {
+    }
+
+    public getAPIVersion_args deepCopy() {
+      return new getAPIVersion_args(this);
+    }
+
+    @Override
+    public void clear() {
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getAPIVersion_args)
+        return this.equals((getAPIVersion_args)that);
+      return false;
+    }
+
+    public boolean equals(getAPIVersion_args that) {
+      if (that == null)
+        return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getAPIVersion_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getAPIVersion_args(");
+      boolean first = true;
+
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getAPIVersion_argsStandardSchemeFactory implements SchemeFactory {
+      public getAPIVersion_argsStandardScheme getScheme() {
+        return new getAPIVersion_argsStandardScheme();
+      }
+    }
+
+    private static class getAPIVersion_argsStandardScheme extends StandardScheme<getAPIVersion_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getAPIVersion_argsTupleSchemeFactory implements SchemeFactory {
+      public getAPIVersion_argsTupleScheme getScheme() {
+        return new getAPIVersion_argsTupleScheme();
+      }
+    }
+
+    private static class getAPIVersion_argsTupleScheme extends TupleScheme<getAPIVersion_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+      }
+    }
+
+  }
+
+  public static class getAPIVersion_result implements org.apache.thrift.TBase<getAPIVersion_result, getAPIVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAPIVersion_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAPIVersion_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+    private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField ACE_FIELD_DESC = new org.apache.thrift.protocol.TField("ace", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField ASE_FIELD_DESC = new org.apache.thrift.protocol.TField("ase", org.apache.thrift.protocol.TType.STRUCT, (short)3);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getAPIVersion_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getAPIVersion_resultTupleSchemeFactory());
+    }
+
+    public String success; // required
+    public org.apache.airavata.model.error.InvalidRequestException ire; // required
+    public org.apache.airavata.model.error.AiravataClientException ace; // required
+    public org.apache.airavata.model.error.AiravataSystemException ase; // 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 {
+      SUCCESS((short)0, "success"),
+      IRE((short)1, "ire"),
+      ACE((short)2, "ace"),
+      ASE((short)3, "ase");
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          case 1: // IRE
+            return IRE;
+          case 2: // ACE
+            return ACE;
+          case 3: // ASE
+            return ASE;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+      tmpMap.put(_Fields.ACE, new org.apache.thrift.meta_data.FieldMetaData("ace", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+      tmpMap.put(_Fields.ASE, new org.apache.thrift.meta_data.FieldMetaData("ase", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAPIVersion_result.class, metaDataMap);
+    }
+
+    public getAPIVersion_result() {
+    }
+
+    public getAPIVersion_result(
+      String success,
+      org.apache.airavata.model.error.InvalidRequestException ire,
+      org.apache.airavata.model.error.AiravataClientException ace,
+      org.apache.airavata.model.error.AiravataSystemException ase)
+    {
+      this();
+      this.success = success;
+      this.ire = ire;
+      this.ace = ace;
+      this.ase = ase;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getAPIVersion_result(getAPIVersion_result other) {
+      if (other.isSetSuccess()) {
+        this.success = other.success;
+      }
+      if (other.isSetIre()) {
+        this.ire = new org.apache.airavata.model.error.InvalidRequestException(other.ire);
+      }
+      if (other.isSetAce()) {
+        this.ace = new org.apache.airavata.model.error.AiravataClientException(other.ace);
+      }
+      if (other.isSetAse()) {
+        this.ase = new org.apache.airavata.model.error.AiravataSystemException(other.ase);
+      }
+    }
+
+    public getAPIVersion_result deepCopy() {
+      return new getAPIVersion_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+      this.ire = null;
+      this.ace = null;
+      this.ase = null;
+    }
+
+    public String getSuccess() {
+      return this.success;
+    }
+
+    public getAPIVersion_result setSuccess(String success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public org.apache.airavata.model.error.InvalidRequestException getIre() {
+      return this.ire;
+    }
+
+    public getAPIVersion_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
+      this.ire = ire;
+      return this;
+    }
+
+    public void unsetIre() {
+      this.ire = null;
+    }
+
+    /** Returns true if field ire is set (has been assigned a value) and false otherwise */
+    public boolean isSetIre() {
+      return this.ire != null;
+    }
+
+    public void setIreIsSet(boolean value) {
+      if (!value) {
+        this.ire = null;
+      }
+    }
+
+    public org.apache.airavata.model.error.AiravataClientException getAce() {
+      return this.ace;
+    }
+
+    public getAPIVersion_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
+      this.ace = ace;
+      return this;
+    }
+
+    public void unsetAce() {
+      this.ace = null;
+    }
+
+    /** Returns true if field ace is set (has been assigned a value) and false otherwise */
+    public boolean isSetAce() {
+      return this.ace != null;
+    }
+
+    public void setAceIsSet(boolean value) {
+      if (!value) {
+        this.ace = null;
+      }
+    }
+
+    public org.apache.airavata.model.error.AiravataSystemException getAse() {
+      return this.ase;
+    }
+
+    public getAPIVersion_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
+      this.ase = ase;
+      return this;
+    }
+
+    public void unsetAse() {
+      this.ase = null;
+    }
+
+    /** Returns true if field ase is set (has been assigned a value) and false otherwise */
+    public boolean isSetAse() {
+      return this.ase != null;
+    }
+
+    public void setAseIsSet(boolean value) {
+      if (!value) {
+        this.ase = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((String)value);
+        }
+        break;
+
+      case IRE:
+        if (value == null) {
+          unsetIre();
+        } else {
+          setIre((org.apache.airavata.model.error.InvalidRequestException)value);
+        }
+        break;
+
+      case ACE:
+        if (value == null) {
+          unsetAce();
+        } else {
+          setAce((org.apache.airavata.model.error.AiravataClientException)value);
+        }
+        break;
+
+      case ASE:
+        if (value == null) {
+          unsetAse();
+        } else {
+          setAse((org.apache.airavata.model.error.AiravataSystemException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      case IRE:
+        return getIre();
+
+      case ACE:
+        return getAce();
+
+      case ASE:
+        return getAse();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case IRE:
+        return isSetIre();
+      case ACE:
+        return isSetAce();
+      case ASE:
+        return isSetAse();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getAPIVersion_result)
+        return this.equals((getAPIVersion_result)that);
+      return false;
+    }
+
+    public boolean equals(getAPIVersion_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      boolean this_present_ire = true && this.isSetIre();
+      boolean that_present_ire = true && that.isSetIre();
+      if (this_present_ire || that_present_ire) {
+        if (!(this_present_ire && that_present_ire))
+          return false;
+        if (!this.ire.equals(that.ire))
+          return false;
+      }
+
+      boolean this_present_ace = true && this.isSetAce();
+      boolean that_present_ace = true && that.isSetAce();
+      if (this_present_ace || that_present_ace) {
+        if (!(this_present_ace && that_present_ace))
+          return false;
+        if (!this.ace.equals(that.ace))
+          return false;
+      }
+
+      boolean this_present_ase = true && this.isSetAse();
+      boolean that_present_ase = true && that.isSetAse();
+      if (this_present_ase || that_present_ase) {
+        if (!(this_present_ase && that_present_ase))
+          return false;
+        if (!this.ase.equals(that.ase))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getAPIVersion_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetIre()).compareTo(other.isSetIre());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetIre()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, other.ire);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetAce()).compareTo(other.isSetAce());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAce()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ace, other.ace);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetAse()).compareTo(other.isSetAse());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAse()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ase, other.ase);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getAPIVersion_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("ire:");
+      if (this.ire == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ire);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("ace:");
+      if (this.ace == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ace);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("ase:");
+      if (this.ase == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ase);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getAPIVersion_resultStandardSchemeFactory implements SchemeFactory {
+      public getAPIVersion_resultStandardScheme getScheme() {
+        return new getAPIVersion_resultStandardScheme();
+      }
+    }
+
+    private static class getAPIVersion_resultStandardScheme extends StandardScheme<getAPIVersion_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.success = iprot.readString();
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // IRE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
+                struct.ire.read(iprot);
+                struct.setIreIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // ACE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ace = new org.apache.airavata.model.error.AiravataClientException();
+                struct.ace.read(iprot);
+                struct.setAceIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // ASE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ase = new org.apache.airavata.model.error.AiravataSystemException();
+                struct.ase.read(iprot);
+                struct.setAseIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          oprot.writeString(struct.success);
+          oprot.writeFieldEnd();
+        }
+        if (struct.ire != null) {
+          oprot.writeFieldBegin(IRE_FIELD_DESC);
+          struct.ire.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.ace != null) {
+          oprot.writeFieldBegin(ACE_FIELD_DESC);
+          struct.ace.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.ase != null) {
+          oprot.writeFieldBegin(ASE_FIELD_DESC);
+          struct.ase.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getAPIVersion_resultTupleSchemeFactory implements SchemeFactory {
+      public getAPIVersion_resultTupleScheme getScheme() {
+        return new getAPIVersion_resultTupleScheme();
+      }
+    }
+
+    private static class getAPIVersion_resultTupleScheme extends TupleScheme<getAPIVersion_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetIre()) {
+          optionals.set(1);
+        }
+        if (struct.isSetAce()) {
+          optionals.set(2);
+        }
+        if (struct.isSetAse()) {
+          optionals.set(3);
+        }
+        oprot.writeBitSet(optionals, 4);
+        if (struct.isSetSuccess()) {
+          oprot.writeString(struct.success);
+        }
+        if (struct.isSetIre()) {
+          struct.ire.write(oprot);
+        }
+        if (struct.isSetAce()) {
+          struct.ace.write(oprot);
+        }
+        if (struct.isSetAse()) {
+          struct.ase.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(4);
+        if (incoming.get(0)) {
+          struct.success = iprot.readString();
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
+          struct.ire.read(iprot);
+          struct.setIreIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.ace = new org.apache.airavata.model.error.AiravataClientException();
+          struct.ace.read(iprot);
+          struct.setAceIsSet(true);
+        }
+        if (incoming.get(3)) {
+          struct.ase = new org.apache.airavata.model.error.AiravataSystemException();
+          struct.ase.read(iprot);
+          struct.setAseIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class addGateway_args implements org.apache.thrift.TBase<addGateway_args, addGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<addGateway_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addGateway_args");
+
+    private static final org.apache.thrift.protocol.TField GATEWAY_FIELD_DESC = new org.apache.thrift.protocol.TField("gateway", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new addGateway_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new addGateway_argsTupleSchemeFactory());
+    }
+
+    public org.apache.airavata.model.workspace.Gateway gateway; // 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 {
+      GATEWAY((short)1, "gateway");
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 1: // GATEWAY
+            return GATEWAY;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.GATEWAY, new org.apache.thrift.meta_data.FieldMetaData("gateway", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.workspace.Gateway.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addGateway_args.class, metaDataMap);
     }
 
-    public getAPIVersion_args() {
+    public addGateway_args() {
+    }
+
+    public addGateway_args(
+      org.apache.airavata.model.workspace.Gateway gateway)
+    {
+      this();
+      this.gateway = gateway;
     }
 
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public getAPIVersion_args(getAPIVersion_args other) {
+    public addGateway_args(addGateway_args other) {
+      if (other.isSetGateway()) {
+        this.gateway = new org.apache.airavata.model.workspace.Gateway(other.gateway);
+      }
     }
 
-    public getAPIVersion_args deepCopy() {
-      return new getAPIVersion_args(this);
+    public addGateway_args deepCopy() {
+      return new addGateway_args(this);
     }
 
     @Override
     public void clear() {
+      this.gateway = null;
+    }
+
+    public org.apache.airavata.model.workspace.Gateway getGateway() {
+      return this.gateway;
+    }
+
+    public addGateway_args setGateway(org.apache.airavata.model.workspace.Gateway gateway) {
+      this.gateway = gateway;
+      return this;
+    }
+
+    public void unsetGateway() {
+      this.gateway = null;
+    }
+
+    /** Returns true if field gateway is set (has been assigned a value) and false otherwise */
+    public boolean isSetGateway() {
+      return this.gateway != null;
+    }
+
+    public void setGatewayIsSet(boolean value) {
+      if (!value) {
+        this.gateway = null;
+      }
     }
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
+      case GATEWAY:
+        if (value == null) {
+          unsetGateway();
+        } else {
+          setGateway((org.apache.airavata.model.workspace.Gateway)value);
+        }
+        break;
+
       }
     }
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
+      case GATEWAY:
+        return getGateway();
+
       }
       throw new IllegalStateException();
     }
@@ -20830,6 +21967,8 @@ import org.slf4j.LoggerFactory;
       }
 
       switch (field) {
+      case GATEWAY:
+        return isSetGateway();
       }
       throw new IllegalStateException();
     }
@@ -20838,15 +21977,24 @@ import org.slf4j.LoggerFactory;
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof getAPIVersion_args)
-        return this.equals((getAPIVersion_args)that);
+      if (that instanceof addGateway_args)
+        return this.equals((addGateway_args)that);
       return false;
     }
 
-    public boolean equals(getAPIVersion_args that) {
+    public boolean equals(addGateway_args that) {
       if (that == null)
         return false;
 
+      boolean this_present_gateway = true && this.isSetGateway();
+      boolean that_present_gateway = true && that.isSetGateway();
+      if (this_present_gateway || that_present_gateway) {
+        if (!(this_present_gateway && that_present_gateway))
+          return false;
+        if (!this.gateway.equals(that.gateway))
+          return false;
+      }
+
       return true;
     }
 
@@ -20856,13 +22004,23 @@ import org.slf4j.LoggerFactory;
     }
 
     @Override
-    public int compareTo(getAPIVersion_args other) {
+    public int compareTo(addGateway_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
 
       int lastComparison = 0;
 
+      lastComparison = Boolean.valueOf(isSetGateway()).compareTo(other.isSetGateway());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetGateway()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gateway, other.gateway);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -20880,16 +22038,29 @@ import org.slf4j.LoggerFactory;
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("getAPIVersion_args(");
+      StringBuilder sb = new StringBuilder("addGateway_args(");
       boolean first = true;
 
+      sb.append("gateway:");
+      if (this.gateway == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.gateway);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
 
     public void validate() throws org.apache.thrift.TException {
       // check for required fields
+      if (gateway == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'gateway' was not present! Struct: " + toString());
+      }
       // check for sub-struct validity
+      if (gateway != null) {
+        gateway.validate();
+      }
     }
 
     private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -20908,15 +22079,15 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    private static class getAPIVersion_argsStandardSchemeFactory implements SchemeFactory {
-      public getAPIVersion_argsStandardScheme getScheme() {
-        return new getAPIVersion_argsStandardScheme();
+    private static class addGateway_argsStandardSchemeFactory implements SchemeFactory {
+      public addGateway_argsStandardScheme getScheme() {
+        return new addGateway_argsStandardScheme();
       }
     }
 
-    private static class getAPIVersion_argsStandardScheme extends StandardScheme<getAPIVersion_args> {
+    private static class addGateway_argsStandardScheme extends StandardScheme<addGateway_args> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, addGateway_args struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -20926,6 +22097,15 @@ import org.slf4j.LoggerFactory;
             break;
           }
           switch (schemeField.id) {
+            case 1: // GATEWAY
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.gateway = new org.apache.airavata.model.workspace.Gateway();
+                struct.gateway.read(iprot);
+                struct.setGatewayIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -20937,39 +22117,48 @@ import org.slf4j.LoggerFactory;
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, addGateway_args struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.gateway != null) {
+          oprot.writeFieldBegin(GATEWAY_FIELD_DESC);
+          struct.gateway.write(oprot);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
 
     }
 
-    private static class getAPIVersion_argsTupleSchemeFactory implements SchemeFactory {
-      public getAPIVersion_argsTupleScheme getScheme() {
-        return new getAPIVersion_argsTupleScheme();
+    private static class addGateway_argsTupleSchemeFactory implements SchemeFactory {
+      public addGateway_argsTupleScheme getScheme() {
+        return new addGateway_argsTupleScheme();
       }
     }
 
-    private static class getAPIVersion_argsTupleScheme extends TupleScheme<getAPIVersion_args> {
+    private static class addGateway_argsTupleScheme extends TupleScheme<addGateway_args> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, addGateway_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
+        struct.gateway.write(oprot);
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, addGateway_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
+        struct.gateway = new org.apache.airavata.model.workspace.Gateway();
+        struct.gateway.read(iprot);
+        struct.setGatewayIsSet(true);
       }
     }
 
   }
 
-  public static class getAPIVersion_result implements org.apache.thrift.TBase<getAPIVersion_result, getAPIVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAPIVersion_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAPIVersion_result");
+  public static class addGateway_result implements org.apache.thrift.TBase<addGateway_result, addGateway_result._Fields>, java.io.Serializable, Cloneable, Comparable<addGateway_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addGateway_result");
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
     private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@@ -20978,8 +22167,8 @@ import org.slf4j.LoggerFactory;
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new getAPIVersion_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getAPIVersion_resultTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new addGateway_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new addGateway_resultTupleSchemeFactory());
     }
 
     public String success; // required
@@ -21067,13 +22256,13 @@ import org.slf4j.LoggerFactory;
       tmpMap.put(_Fields.ASE, new org.apache.thrift.meta_data.FieldMetaData("ase", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAPIVersion_result.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addGateway_result.class, metaDataMap);
     }
 
-    public getAPIVersion_result() {
+    public addGateway_result() {
     }
 
-    public getAPIVersion_result(
+    public addGateway_result(
       String success,
       org.apache.airavata.model.error.InvalidRequestException ire,
       org.apache.airavata.model.error.AiravataClientException ace,
@@ -21089,7 +22278,7 @@ import org.slf4j.LoggerFactory;
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public getAPIVersion_result(getAPIVersion_result other) {
+    public addGateway_result(addGateway_result other) {
       if (other.isSetSuccess()) {
         this.success = other.success;
       }
@@ -21104,8 +22293,8 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    public getAPIVersion_result deepCopy() {
-      return new getAPIVersion_result(this);
+    public addGateway_result deepCopy() {
+      return new addGateway_result(this);
     }
 
     @Override
@@ -21120,7 +22309,7 @@ import org.slf4j.LoggerFactory;
       return this.success;
     }
 
-    public getAPIVersion_result setSuccess(String success) {
+    public addGateway_result setSuccess(String success) {
       this.success = success;
       return this;
     }
@@ -21144,7 +22333,7 @@ import org.slf4j.LoggerFactory;
       return this.ire;
     }
 
-    public getAPIVersion_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
+    public addGateway_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
       this.ire = ire;
       return this;
     }
@@ -21168,7 +22357,7 @@ import org.slf4j.LoggerFactory;
       return this.ace;
     }
 
-    public getAPIVersion_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
+    public addGateway_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
       this.ace = ace;
       return this;
     }
@@ -21192,7 +22381,7 @@ import org.slf4j.LoggerFactory;
       return this.ase;
     }
 
-    public getAPIVersion_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
+    public addGateway_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
       this.ase = ase;
       return this;
     }
@@ -21290,12 +22479,12 @@ import org.slf4j.LoggerFactory;
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof getAPIVersion_result)
-        return this.equals((getAPIVersion_result)that);
+      if (that instanceof addGateway_result)
+        return this.equals((addGateway_result)that);
       return false;
     }
 
-    public boolean equals(getAPIVersion_result that) {
+    public boolean equals(addGateway_result that) {
       if (that == null)
         return false;
 
@@ -21344,7 +22533,7 @@ import org.slf4j.LoggerFactory;
     }
 
     @Override
-    public int compareTo(getAPIVersion_result other) {
+    public int compareTo(addGateway_result other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -21408,7 +22597,7 @@ import org.slf4j.LoggerFactory;
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("getAPIVersion_result(");
+      StringBuilder sb = new StringBuilder("addGateway_result(");
       boolean first = true;
 
       sb.append("success:");
@@ -21467,15 +22656,15 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    private static class getAPIVersion_resultStandardSchemeFactory implements SchemeFactory {
-      public getAPIVersion_resultStandardScheme getScheme() {
-        return new getAPIVersion_resultStandardScheme();
+    private static class addGateway_resultStandardSchemeFactory implements SchemeFactory {
+      public addGateway_resultStandardScheme getScheme() {
+        return new addGateway_resultStandardScheme();
       }
     }
 
-    private static class getAPIVersion_resultStandardScheme extends StandardScheme<getAPIVersion_result> {
+    private static class addGateway_resultStandardScheme extends StandardScheme<addGateway_result> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, addGateway_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -21531,7 +22720,7 @@ import org.slf4j.LoggerFactory;
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, addGateway_result struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -21561,16 +22750,16 @@ import org.slf4j.LoggerFactory;
 
     }
 
-    private static class getAPIVersion_resultTupleSchemeFactory implements SchemeFactory {
-      public getAPIVersion_resultTupleScheme getScheme() {
-        return new getAPIVersion_resultTupleScheme();
+    private static class addGateway_resultTupleSchemeFactory implements SchemeFactory {
+      public addGateway_resultTupleScheme getScheme() {
+        return new addGateway_resultTupleScheme();
       }
     }
 
-    private static class getAPIVersion_resultTupleScheme extends TupleScheme<getAPIVersion_result> {
+    private static class addGateway_resultTupleScheme extends TupleScheme<addGateway_result> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, addGateway_result struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
         if (struct.isSetSuccess()) {
@@ -21601,7 +22790,7 @@ import org.slf4j.LoggerFactory;
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, addGateway_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(4);
         if (incoming.get(0)) {
@@ -21628,22 +22817,25 @@ import org.slf4j.LoggerFactory;
 
   }
 
-  public static class addGateway_args implements org.apache.thrift.TBase<addGateway_args, addGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<addGateway_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addGateway_args");
+  public static class updateGateway_args implements org.apache.thrift.TBase<updateGateway_args, updateGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateGateway_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateGateway_args");
 
-    private static final org.apache.thrift.protocol.TField GATEWAY_FIELD_DESC = new org.apache.thrift.protocol.TField("gateway", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
+    private static final org.apache.thrift.protocol.TField UPDATED_GATEWAY_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedGateway", org.apache.thrift.protocol.TType.STRUCT, (short)2);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new addGateway_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new addGateway_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new updateGateway_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new updateGateway_argsTupleSchemeFactory());
     }
 
-    public org.apache.airavata.model.workspace.Gateway gateway; // required
+    public String gatewayId; // required
+    public org.apache.airavata.model.workspace.Gateway updatedGateway; // 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 {
-      GATEWAY((short)1, "gateway");
+      GATEWAY_ID((short)1, "gatewayId"),
+      UPDATED_GATEWAY((short)2, "updatedGateway");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -21658,8 +22850,10 @@ import org.slf4j.LoggerFactory;
        */
       public static _Fields findByThriftId(int fieldId) {
         switch(fieldId) {
-          case 1: // GATEWAY
-            return GATEWAY;
+          case 1: // GATEWAY_ID
+            return GATEWAY_ID;
+          case 2: // UPDATED_GATEWAY
+            return UPDATED_GATEWAY;
           default:
             return null;
         }
@@ -21703,71 +22897,111 @@ import org.slf4j.LoggerFactory;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      tmpMap.put(_Fields.GATEWAY, new org.apache.thrift.meta_data.FieldMetaData("gateway", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+      tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.UPDATED_GATEWAY, new org.apache.thrift.meta_data.FieldMetaData("updatedGateway", org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.workspace.Gateway.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addGateway_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateGateway_args.class, metaDataMap);
     }
 
-    public addGateway_args() {
+    public updateGateway_args() {
     }
 
-    public addGateway_args(
-      org.apache.airavata.model.workspace.Gateway gateway)
+    public updateGateway_args(
+      String gatewayId,
+      org.apache.airavata.model.workspace.Gateway updatedGateway)
     {
       this();
-      this.gateway = gateway;
+      this.gatewayId = gatewayId;
+      this.updatedGateway = updatedGateway;
     }
 
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public addGateway_args(addGateway_args other) {
-      if (other.isSetGateway()) {
-        this.gateway = new org.apache.airavata.model.workspace.Gateway(other.gateway);
+    public updateGateway_args(updateGateway_args other) {
+      if (other.isSetGatewayId()) {
+        this.gatewayId = other.gatewayId;
+      }
+      if (other.isSetUpdatedGateway()) {
+        this.updatedGateway = new org.apache.airavata.model.workspace.Gateway(other.updatedGateway);
       }
     }
 
-    public addGateway_args deepCopy() {
-      return new addGateway_args(this);
+    public updateGateway_args deepCopy() {
+      return new updateGateway_args(this);
     }
 
     @Override
     public void clear() {
-      this.gateway = null;
+      this.gatewayId = null;
+      this.updatedGateway = null;
     }
 
-    public org.apache.airavata.model.workspace.Gateway getGateway() {
-      return this.gateway;
+    public String getGatewayId() {
+      return this.gatewayId;
     }
 
-    public addGateway_args setGateway(org.apache.airavata.model.workspace.Gateway gateway) {
-      this.gateway = gateway;
+    public updateGateway_args setGatewayId(String gatewayId) {
+      this.gatewayId = gatewayId;
       return this;
     }
 
-    public void unsetGateway() {
-      this.gateway = null;
+    public void unsetGatewayId() {
+      this.gatewayId = null;
     }
 
-    /** Returns true if field gateway is set (has been assigned a value) and false otherwise */
-    public boolean isSetGateway() {
-      return this.gateway != null;
+    /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+    public boolean isSetGatewayId() {
+      return this.gatewayId != null;
     }
 
-    public void setGatewayIsSet(boolean value) {
+    public void setGatewayIdIsSet(boolean value) {
       if (!value) {
-        this.gateway = null;
+        this.gatewayId = null;
+      }
+    }
+
+    public org.apache.airavata.model.workspace.Gateway getUpdatedGateway() {
+      return this.updatedGateway;
+    }
+
+    public updateGateway_args setUpdatedGateway(org.apache.airavata.model.workspace.Gateway updatedGateway) {
+      this.updatedGateway = updatedGateway;
+      return this;
+    }
+
+    public void unsetUpdatedGateway() {
+      this.updatedGateway = null;
+    }
+
+    /** Returns true if field updatedGateway is set (has been assigned a value) and false otherwise */
+    public boolean isSetUpdatedGateway() {
+      return this.updatedGateway != null;
+    }
+
+    public void setUpdatedGatewayIsSet(boolean value) {
+      if (!value) {
+        this.updatedGateway = null;
       }
     }
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
-      case GATEWAY:
+      case GATEWAY_ID:
         if (value == null) {
-          unsetGateway();
+          unsetGatewayId();
         } else {
-          setGateway((org.apache.airavata.model.workspace.Gateway)value);
+          setGatewayId((String)value);
+        }
+        break;
+
+      case UPDATED_GATEWAY:
+        if (value == null) {
+          unsetUpdatedGateway();
+        } else {
+          setUpdatedGateway((org.apache.airavata.model.workspace.Gateway)value);
         }
         break;
 
@@ -21776,8 +23010,11 @@ import org.slf4j.LoggerFactory;
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
-      case GATEWAY:
-        return getGateway();
+      case GATEWAY_ID:
+        return getGatewayId();
+
+      case UPDATED_GATEWAY:
+        return getUpdatedGateway();
 
       }
       throw new IllegalStateException();
@@ -21790,8 +23027,10 @@ import org.slf4j.LoggerFactory;
       }
 
       switch (field) {
-      case GATEWAY:
-        return isSetGateway();
+      case GATEWAY_ID:
+        return isSetGatewayId();
+      case UPDATED_GATEWAY:
+        return isSetUpdatedGateway();
       }
       throw new IllegalStateException();
     }
@@ -21800,21 +23039,30 @@ import org.slf4j.LoggerFactory;
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof addGateway_args)
-        return this.equals((addGateway_args)that);
+      if (that instanceof updateGateway_args)
+        return this.equals((updateGateway_args)that);
       return false;
     }
 
-    public boolean equals(addGateway_args that) {
+    public boolean equals(updateGateway_args that) {
       if (that == null)
         return false;
 
-      boolean this_present_gateway = true && this.isSetGateway();
-      boolean that_present_gateway = true && that.isSetGateway();
-      if (this_present_gateway || that_present_gateway) {
-        if (!(this_present_gateway && that_present_gateway))
+      boolean this_present_gatewayId = true && this.isSetGatewayId();
+      boolean that_present_gatewayId = true && that.isSetGatewayId();
+      if (this_present_gatewayId || that_present_gatewayId) {
+        if (!(this_present_gatewayId && that_present_gatewayId))
           return false;
-        if (!this.gateway.equals(that.gateway))
+        if (!this.gatewayId.equals(that.gatewayId))
+          return false;
+      }
+
+      boolean this_present_updatedGateway = true && this.isSetUpdatedGateway();
+      boolean that_present_updatedGateway = true && that.isSetUpdatedGateway();
+      if (this_present_updatedGateway || that_present_updatedGateway) {
+        if (!(this_present_updatedGateway && that_present_updatedGateway))
+          return false;
+        if (!this.updatedGateway.equals(that.updatedGateway))
           return false;
       }
 
@@ -21827,19 +23075,29 @@ import org.slf4j.LoggerFactory;
     }
 
     @Override
-    public int compareTo(addGateway_args other) {
+    public int compareTo(updateGateway_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
 
       int lastComparison = 0;
 
-      lastComparison = Boolean.valueOf(isSetGateway()).compareTo(other.isSetGateway());
+      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
       if (lastComparison != 0) {
         return lastComparison;
       }
-      if (isSetGateway()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gateway, other.gateway);
+      if (isSetGatewayId()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetUpdatedGateway()).compareTo(other.isSetUpdatedGateway());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetUpdatedGateway()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedGateway, other.updatedGateway);
         if (lastComparison != 0) {
           return lastComparison;
         }
@@ -21861,14 +23119,22 @@ import org.slf4j.LoggerFactory;
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("addGateway_args(");
+      StringBuilder sb = new StringBuilder("updateGateway_args(");
       boolean first = true;
 
-      sb.append("gateway:");
-      if (this.gateway == null) {
+      sb.append("gatewayId:");
+      if (this.gatewayId == null) {
         sb.append("null");
       } else {
-        sb.append(this.gateway);
+        sb.append(this.gatewayId);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("updatedGateway:");
+      if (this.updatedGateway == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.updatedGateway);
       }
       first = false;
       sb.append(")");
@@ -21877,12 +23143,15 @@ import org.slf4j.LoggerFactory;
 
     public void validate() throws org.apache.thrift.TException {
       // check for required fields
-      if (gateway == null) {
-        throw new org.apache.thrift.protocol.TProtocolException("Required field 'gateway' was not present! Struct: " + toString());
+      if (gatewayId == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
+      }
+      if (updatedGateway == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'updatedGateway' was not present! Struct: " + toString());
       }
       // check for sub-struct validity
-      if (gateway != null) {
-        gateway.validate();
+      if (updatedGateway != null) {
+        updatedGateway.validate();
       }
     }
 
@@ -21902,15 +23171,15 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    private static class addGateway_argsStandardSchemeFactory implements SchemeFactory {
-      public addGateway_argsStandardScheme getScheme() {
-        return new addGateway_argsStandardScheme();
+    private static class updateGateway_argsStandardSchemeFactory implements SchemeFactory {
+      public updateGateway_argsStandardScheme getScheme() {
+        return new updateGateway_argsStandardScheme();
       }
     }
 
-    private static class addGateway_argsStandardScheme extends StandardScheme<addGateway_args> {
+    private static class updateGateway_argsStandardScheme extends StandardScheme<updateGateway_args> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, addGateway_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, updateGateway_args struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -21920,11 +23189,19 @@ import org.slf4j.LoggerFactory;
             break;
           }
           switch (schemeField.id) {
-            case 1: // GATEWAY
+            case 1: // GATEWAY_ID
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.gatewayId = iprot.readString();
+                struct.setGatewayIdIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // UPDATED_GATEWAY
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.gateway = new org.apache.airavata.model.workspace.Gateway();
-                struct.gateway.read(iprot);
-                struct.setGatewayIsSet(true);
+                struct.updatedGateway = new org.apache.airavata.model.workspace.Gateway();
+                struct.updatedGateway.read(iprot);
+                struct.setUpdatedGatewayIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
@@ -21940,13 +23217,18 @@ import org.slf4j.LoggerFactory;
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, addGateway_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, updateGateway_args struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
-        if (struct.gateway != null) {
-          oprot.writeFieldBegin(GATEWAY_FIELD_DESC);
-          struct.gateway.write(oprot);
+        if (struct.gatewayId != null) {
+          oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+          oprot.writeString(struct.gatewayId);
+          oprot.writeFieldEnd();
+        }
+        if (struct.updatedGateway != null) {
+          oprot.writeFieldBegin(UPDATED_GATEWAY_FIELD_DESC);
+          struct.updatedGateway.write(oprot);
           oprot.writeFieldEnd();
         }
         oprot.writeFieldStop();
@@ -21955,53 +23237,53 @@ import org.slf4j.LoggerFactory;
 
     }
 
-    private static class addGateway_argsTupleSchemeFactory implements SchemeFactory {
-      public addGateway_argsTupleScheme getScheme() {
-        return new addGateway_argsTupleScheme();
+    private static class updateGateway_argsTupleSchemeFactory implements SchemeFactory {
+      public updateGateway_argsTupleScheme getScheme() {
+        return new updateGateway_argsTupleScheme();
       }
     }
 
-    private static class addGateway_argsTupleScheme extends TupleScheme<addGateway_args> {
+    private static class updateGateway_argsTupleScheme extends TupleScheme<updateGateway_args> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, addGateway_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, updateGateway_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
-        struct.gateway.write(oprot);
+        oprot.writeString(struct.gatewayId);
+        struct.updatedGateway.write(oprot);
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, addGateway_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, updateGateway_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        struct.gateway = new org.apache.airavata.model.workspace.Gateway();
-        struct.gateway.read(iprot);
-        struct.setGatewayIsSet(true);
+        struct.gatewayId = iprot.readString();
+        struct.setGatewayIdIsSet(true);
+        struct.updatedGateway = new org.apache.airavata.model.workspace.Gateway();
+        struct.updatedGateway.read(iprot);
+        struct.setUpdatedGatewayIsSet(true);
       }
     }
 
   }
 
-  public static class addGateway_result implements org.apache.thrift.TBase<addGateway_result, addGateway_result._Fields>, java.io.Serializable, Cloneable, Comparable<addGateway_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addGateway_result");
+  public static class updateGateway_result implements org.apache.thrift.TBase<updateGateway_result, updateGateway_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateGateway_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateGateway_result");
 
-    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
     private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField ACE_FIELD_DESC = new org.apache.thrift.protocol.TField("ace", org.apache.thrift.protocol.TType.STRUCT, (short)2);
     private static final org.apache.thrift.protocol.TField ASE_FIELD_DESC = new org.apache.thrift.protocol.TField("ase", org.apache.thrift.protocol.TType.STRUCT, (short)3);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new addGateway_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new addGateway_resultTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new updateGateway_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new updateGateway_resultTupleSchemeFactory());
     }
 
-    public String success; // required
     public org.apache.airavata.model.error.InvalidRequestException ire; // required
     public org.apache.airavata.model.error.AiravataClientException ace; // required
     public org.apache.airavata.model.error.AiravataSystemException ase; // 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 {
-      SUCCESS((short)0, "success"),
       IRE((short)1, "ire"),
       ACE((short)2, "ace"),
       ASE((short)3, "ase");
@@ -22019,8 +23301,6 @@ import org.slf4j.LoggerFactory;
        */
       public static _Fields findByThriftId(int fieldId) {
         switch(fieldId) {
-          case 0: // SUCCESS
-            return SUCCESS;
           case 1: // IRE
             return IRE;
           case 2: // ACE
@@ -22070,8 +23350,6 @@ import org.slf4j.LoggerFactory;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       tmpMap.put(_Fields.ACE, new org.apache.thrift.meta_data.FieldMetaData("ace", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -22079,20 +23357,18 @@ import org.slf4j.LoggerFactory;
       tmpMap.put(_Fields.ASE, new org.apache.thrift.meta_data.FieldMetaData("ase", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addGateway_result.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateGateway_result.class, metaDataMap);
     }
 
-    public addGateway_result() {
+    public updateGateway_result() {
     }
 
-    public addGateway_result(
-      String success,
+    public updateGateway_result(
       org.apache.airavata.model.error.InvalidRequestException ire,
       org.apache.airavata.model.error.AiravataClientException ace,
       org.apache.airavata.model.error.AiravataSystemException ase)
     {
       this();
-      this.success = success;
       this.ire = ire;
       this.ace = ace;
       this.ase = ase;
@@ -22101,10 +23377,7 @@ import org.slf4j.LoggerFactory;
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public addGateway_result(addGateway_result other) {
-      if (other.isSetSuccess()) {
-        this.success = other.success;
-      }
+    public updateGateway_result(updateGateway_result other) {
       if (other.isSetIre()) {
         this.ire = new org.apache.airavata.model.error.InvalidRequestException(other.ire);
       }
@@ -22116,47 +23389,22 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    public addGateway_result deepCopy() {
-      return new addGateway_result(this);
+    public updateGateway_result deepCopy() {
+      return new updateGateway_result(this);
     }
 
     @Override
     public void clear() {
-      this.success = null;
       this.ire = null;
       this.ace = null;
       this.ase = null;
     }
 
-    public String getSuccess() {
-      return this.success;
-    }
-
-    public addGateway_result setSuccess(String success) {
-      this.success = success;
-      return this;
-    }
-
-    public void unsetSuccess() {
-      this.success = null;
-    }
-
-    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-    public boolean isSetSuccess() {
-      return this.success != null;
-    }
-
-    public void setSuccessIsSet(boolean value) {
-      if (!value) {
-        this.success = null;
-      }
-    }
-
     public org.apache.airavata.model.error.InvalidRequestException getIre() {
       return this.ire;
     }
 
-    public addGateway_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
+    public updateGateway_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
       this.ire = ire;
       return this;
     }
@@ -22180,7 +23428,7 @@ import org.slf4j.LoggerFactory;
       return this.ace;
     }
 
-    public addGateway_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
+    public updateGateway_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
       this.ace = ace;
       return this;
     }
@@ -22204,7 +23452,7 @@ import org.slf4j.LoggerFactory;
       return this.ase;
     }
 
-    public addGateway_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
+    public updateGateway_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
       this.ase = ase;
       return this;
     }
@@ -22226,14 +23474,6 @@ import org.slf4j.LoggerFactory;
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
-      case SUCCESS:
-        if (value == null) {
-          unsetSuccess();
-        } else {
-          setSuccess((String)value);
-        }
-        break;
-
       case IRE:
         if (value == null) {
           unsetIre();
@@ -22263,9 +23503,6 @@ import org.slf4j.LoggerFactory;
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
-      case SUCCESS:
-        return getSuccess();
-
       case IRE:
         return getIre();
 
@@ -22286,8 +23523,6 @@ import org.slf4j.LoggerFactory;
       }
 
       switch (field) {
-      case SUCCESS:
-        return isSetSuccess();
       case IRE:
         return isSetIre();
       case ACE:
@@ -22302,24 +23537,15 @@ import org.slf4j.LoggerFactory;
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof addGateway_result)
-        return this.equals((addGateway_result)that);
+      if (that instanceof updateGateway_result)
+        return this.equals((updateGateway_result)that);
       return false;
     }
 
-    public boolean equals(addGateway_result that) {
+    public boolean equals(updateGateway_result that) {
       if (that == null)
         retu

<TRUNCATED>

[33/62] [abbrv] airavata git commit: fixing AIRAVATA-1626

Posted by la...@apache.org.
fixing AIRAVATA-1626


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: fd557d829f282bdb1ec084cf1e7b19b57a270932
Parents: 04cecb4
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Mon Mar 9 12:34:51 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Mon Mar 9 12:34:51 2015 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 43 ++++++++++++++++++++
 .../data/impl/GwyResourceProfileImpl.java       |  2 +-
 .../integration/tools/DocumentCreatorNew.java   |  7 +++-
 3 files changed, 49 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/fd557d82/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 264243a..c111a07 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -2680,6 +2680,17 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public String registerGatewayResourceProfile(GatewayResourceProfile gatewayResourceProfile) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
     	try {
+            if (!validateString(gatewayResourceProfile.getGatewayID())){
+                logger.error("Cannot create gateway profile with empty gateway id");
+                AiravataSystemException exception = new AiravataSystemException();
+                exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+                exception.setMessage("Cannot create gateway profile with empty gateway id");
+                throw exception;
+            }
+            if (!isGatewayExist(gatewayResourceProfile.getGatewayID())){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             return gatewayProfile.addGatewayResourceProfile(gatewayResourceProfile);
@@ -2702,6 +2713,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public GatewayResourceProfile getGatewayResourceProfile(String gatewayID) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             return gatewayProfile.getGatewayProfile(gatewayID);
@@ -2725,6 +2740,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public boolean updateGatewayResourceProfile(String gatewayID, GatewayResourceProfile gatewayResourceProfile) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             gatewayProfile.updateGatewayResourceProfile(gatewayID, gatewayResourceProfile);
@@ -2748,6 +2767,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public boolean deleteGatewayResourceProfile(String gatewayID) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
         try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             gatewayProfile.removeGatewayResourceProfile(gatewayID);
@@ -2774,6 +2797,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public boolean addGatewayComputeResourcePreference(String gatewayID, String computeResourceId, ComputeResourcePreference computeResourcePreference) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
     	try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             if (!gatewayProfile.isGatewayResourceProfileExists(gatewayID)){
@@ -2804,6 +2831,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public ComputeResourcePreference getGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
     	try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             ComputeResource computeResource = appCatalog.getComputeResource();
@@ -2841,6 +2872,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public List<ComputeResourcePreference> getAllGatewayComputeResourcePreferences(String gatewayID) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
     	try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             return gatewayProfile.getGatewayProfile(gatewayID).getComputeResourcePreferences();
@@ -2879,6 +2914,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public boolean updateGatewayComputeResourcePreference(String gatewayID, String computeResourceId, ComputeResourcePreference computeResourcePreference) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
     	try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             GatewayResourceProfile profile = gatewayProfile.getGatewayProfile(gatewayID);
@@ -2917,6 +2956,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     public boolean deleteGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
     	try {
+            if (!isGatewayExist(gatewayID)){
+                logger.error("Gateway does not exist.Please provide a valid gateway id...");
+                throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            }
             appCatalog = AppCatalogFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             return gatewayProfile.removeComputeResourcePreferenceFromGateway(gatewayID, computeResourceId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/fd557d82/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java
index d03ef2a..4537efd 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/GwyResourceProfileImpl.java
@@ -46,7 +46,7 @@ public class GwyResourceProfileImpl implements GwyResourceProfile {
             if (!gatewayProfile.getGatewayID().equals("") && !gatewayProfile.getGatewayID().equals(gatewayResourceProfileModelConstants.DEFAULT_ID)){
                 profileResource.setGatewayID(gatewayProfile.getGatewayID());
             }
-            profileResource.setGatewayID(gatewayProfile.getGatewayID());
+//            profileResource.setGatewayID(gatewayProfile.getGatewayID());
             profileResource.save();
             List<ComputeResourcePreference> computeResourcePreferences = gatewayProfile.getComputeResourcePreferences();
             if (computeResourcePreferences != null && !computeResourcePreferences.isEmpty()){

http://git-wip-us.apache.org/repos/asf/airavata/blob/fd557d82/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
----------------------------------------------------------------------
diff --git a/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java b/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
index 273efce..34786fe 100644
--- a/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
+++ b/modules/integration-tests/src/test/java/org/apache/airavata/integration/tools/DocumentCreatorNew.java
@@ -44,11 +44,14 @@ import org.apache.airavata.model.error.AiravataClientException;
 import org.apache.airavata.model.error.AiravataSystemException;
 import org.apache.airavata.model.error.InvalidRequestException;
 import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.util.*;
 
 public class DocumentCreatorNew {
+    private final static Logger log = LoggerFactory.getLogger(DocumentCreatorNew.class);
 
     private static final String DEFAULT_GATEWAY = "php_reference_gateway";
     private AppCatalog appcatalog = null;
@@ -115,7 +118,7 @@ public class DocumentCreatorNew {
                 null, null);
         gatewayResourceProfile = new GatewayResourceProfile();
 //		gatewayResourceProfile.setGatewayID("default");
-        gatewayResourceProfile.setGatewayID(ClientSettings.getSetting("default.registry.gateway", "php_reference_gateway"));
+        gatewayResourceProfile.setGatewayID(DEFAULT_GATEWAY);
         gatewayResourceProfile.addToComputeResourcePreferences(computeResourcePreference);
         String gatewayId = client.registerGatewayResourceProfile(gatewayResourceProfile);
         gatewayResourceProfile.setGatewayID(gatewayId);
@@ -133,7 +136,7 @@ public class DocumentCreatorNew {
         if (gatewayResourceProfile == null) {
             gatewayResourceProfile = new GatewayResourceProfile();
 //				gatewayResourceProfile.setGatewayID("default");
-            gatewayResourceProfile.setGatewayID("php_reference_gateway");
+            gatewayResourceProfile.setGatewayID(DEFAULT_GATEWAY);
             gatewayResourceProfile.setGatewayID(client.registerGatewayResourceProfile(gatewayResourceProfile));
         }
 //    	}


[06/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java
new file mode 100644
index 0000000..e52b211
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * 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.credential.store.notifier.impl;
+
+import org.apache.airavata.credential.store.notifier.CredentialStoreNotifier;
+import org.apache.airavata.credential.store.notifier.NotificationMessage;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.commons.mail.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 12/3/13
+ * Time: 4:25 PM
+ */
+
+public class EmailNotifier implements CredentialStoreNotifier {
+
+    protected static Logger log = LoggerFactory.getLogger(EmailNotifier.class);
+
+    private EmailNotifierConfiguration emailNotifierConfiguration;
+
+    public EmailNotifier(EmailNotifierConfiguration notifierConfiguration) {
+        this.emailNotifierConfiguration = notifierConfiguration;
+    }
+
+    public void notifyMessage(NotificationMessage message) throws CredentialStoreException {
+        try {
+            Email email = new SimpleEmail();
+            email.setHostName(this.emailNotifierConfiguration.getEmailServer());
+            email.setSmtpPort(this.emailNotifierConfiguration.getEmailServerPort());
+            email.setAuthenticator(new DefaultAuthenticator(this.emailNotifierConfiguration.getEmailUserName(),
+                    this.emailNotifierConfiguration.getEmailPassword()));
+            email.setSSLOnConnect(this.emailNotifierConfiguration.isSslConnect());
+            email.setFrom(this.emailNotifierConfiguration.getFromAddress());
+
+            EmailNotificationMessage emailMessage = (EmailNotificationMessage)message;
+
+            email.setSubject(emailMessage.getSubject());
+            email.setMsg(emailMessage.getMessage());
+            email.addTo(emailMessage.getSenderEmail());
+            email.send();
+
+        } catch (EmailException e) {
+            log.error("[CredentialStore]Error sending email notification message.");
+            throw new CredentialStoreException("Error sending email notification message", e);
+        }
+
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java
new file mode 100644
index 0000000..b1a204f
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java
@@ -0,0 +1,84 @@
+/*
+ *
+ * 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.credential.store.notifier.impl;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ApplicationSettings;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 12/3/13
+ * Time: 5:06 PM
+ */
+
+public class EmailNotifierConfiguration {
+    private String emailServer;
+    private int emailServerPort;
+    private String emailUserName;
+    private String emailPassword;
+    private boolean sslConnect;
+    private String fromAddress;
+
+    public EmailNotifierConfiguration(String emailServer, int emailServerPort, String emailUserName,
+                                      String emailPassword, boolean sslConnect, String fromAddress) {
+        this.emailServer = emailServer;
+        this.emailServerPort = emailServerPort;
+        this.emailUserName = emailUserName;
+        this.emailPassword = emailPassword;
+        this.sslConnect = sslConnect;
+        this.fromAddress = fromAddress;
+    }
+
+    public String getEmailServer() {
+        return emailServer;
+    }
+
+    public int getEmailServerPort() {
+        return emailServerPort;
+    }
+
+    public String getEmailUserName() {
+        return emailUserName;
+    }
+
+    public String getEmailPassword() {
+        return emailPassword;
+    }
+
+    public boolean isSslConnect() {
+        return sslConnect;
+    }
+
+    public String getFromAddress() {
+        return fromAddress;
+    }
+
+    public static EmailNotifierConfiguration getEmailNotifierConfigurations() throws ApplicationSettingsException {
+        return new EmailNotifierConfiguration(ApplicationSettings.getCredentialStoreEmailServer(),
+                Integer.parseInt(ApplicationSettings.getCredentialStoreEmailServerPort()),
+                ApplicationSettings.getCredentialStoreEmailUser(),
+                ApplicationSettings.getCredentialStoreEmailPassword(),
+                Boolean.parseBoolean(ApplicationSettings.getCredentialStoreEmailSSLConnect()),
+                ApplicationSettings.getCredentialStoreEmailFromEmail());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
new file mode 100644
index 0000000..f0e14d5
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
@@ -0,0 +1,158 @@
+/*
+ *
+ * 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.credential.store.server;
+
+
+import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.IServer;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import org.apache.thrift.server.TServer;
+import org.apache.thrift.server.TThreadPoolServer;
+import org.apache.thrift.transport.TSSLTransportFactory;
+import org.apache.thrift.transport.TServerSocket;
+import org.apache.thrift.transport.TTransportException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+
+public class CredentialStoreServer  implements IServer {
+    private final static Logger logger = LoggerFactory.getLogger(CredentialStoreServer.class);
+    private static final String SERVER_NAME = "Credential Store Server";
+    private static final String SERVER_VERSION = "1.0";
+
+    private IServer.ServerStatus status;
+    private TServer server;
+
+    public CredentialStoreServer() {
+        setStatus(IServer.ServerStatus.STOPPED);
+    }
+
+    @Override
+    public String getName() {
+        return SERVER_NAME;
+    }
+
+    @Override
+    public String getVersion() {
+        return SERVER_VERSION;
+    }
+
+    @Override
+    public void start() throws Exception {
+        if(ServerSettings.isCredentialStoreStartEnabled()) {
+            try {
+                setStatus(ServerStatus.STARTING);
+                TSSLTransportFactory.TSSLTransportParameters params =
+                        new TSSLTransportFactory.TSSLTransportParameters();
+                String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
+                String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
+                final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_PORT, "8960"));
+                final String serverHost = ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_HOST, null);
+                params.setKeyStore(keystorePath, keystorePWD);
+
+                TServerSocket serverTransport = TSSLTransportFactory.getServerSocket(serverPort, 100, InetAddress.getByName(serverHost), params);
+
+
+                CredentialStoreService.Processor processor = new CredentialStoreService.Processor(new CredentialStoreServerHandler());
+
+                server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).
+                        processor(processor));
+                new Thread() {
+                    public void run() {
+                        server.serve();
+                        setStatus(ServerStatus.STOPPED);
+                        logger.info("Credential Store Server Stopped.");
+                    }
+                }.start();
+                new Thread() {
+                    public void run() {
+                        while (!server.isServing()) {
+                            try {
+                                Thread.sleep(500);
+                            } catch (InterruptedException e) {
+                                break;
+                            }
+                        }
+                        if (server.isServing()) {
+                            setStatus(ServerStatus.STARTED);
+                            logger.info("Starting Credential Store Server on Port " + serverPort);
+                            logger.info("Listening to Credential Store Clients ....");
+                        }
+                    }
+                }.start();
+            } catch (TTransportException e) {
+                setStatus(ServerStatus.FAILED);
+                logger.error("Error while starting the credential store service", e);
+                throw new Exception("Error while starting the credential store service", e);
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            new CredentialStoreServer().start();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public void stop() throws Exception {
+        if (server!=null && server.isServing()){
+            setStatus(ServerStatus.STOPING);
+            server.stop();
+        }
+    }
+
+    @Override
+    public void restart() throws Exception {
+        stop();
+        start();
+    }
+
+    @Override
+    public void configure() throws Exception {
+
+    }
+
+    @Override
+    public ServerStatus getStatus() throws Exception {
+        return null;
+    }
+
+    private void setStatus(IServer.ServerStatus stat){
+        status=stat;
+        status.updateTime();
+    }
+
+    public TServer getServer() {
+        return server;
+    }
+
+    public void setServer(TServer server) {
+        this.server = server;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
new file mode 100644
index 0000000..b5b1ac0
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
@@ -0,0 +1,202 @@
+/*
+ *
+ * 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.credential.store.server;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import org.apache.airavata.credential.store.cpi.cs_cpi_serviceConstants;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+import org.apache.airavata.credential.store.credential.Credential;
+import org.apache.airavata.credential.store.datamodel.CertificateCredential;
+import org.apache.airavata.credential.store.datamodel.PasswordCredential;
+import org.apache.airavata.credential.store.datamodel.SSHCredential;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.airavata.credential.store.store.impl.CertificateCredentialWriter;
+import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
+import org.apache.airavata.credential.store.store.impl.SSHCredentialWriter;
+import org.apache.airavata.credential.store.util.TokenGenerator;
+import org.apache.airavata.credential.store.util.Utility;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import sun.security.provider.X509Factory;
+
+import java.io.ByteArrayInputStream;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.UUID;
+
+public class CredentialStoreServerHandler implements CredentialStoreService.Iface {
+    protected static Logger log = LoggerFactory.getLogger(CredentialStoreServerHandler.class);
+    private DBUtil dbUtil;
+    private SSHCredentialWriter sshCredentialWriter;
+    private CertificateCredentialWriter certificateCredentialWriter;
+    private CredentialReaderImpl credentialReader;
+
+    public CredentialStoreServerHandler() throws ApplicationSettingsException, IllegalAccessException, ClassNotFoundException, InstantiationException {
+        String jdbcUrl = ServerSettings.getCredentialStoreDBURL();
+        String userName = ServerSettings.getCredentialStoreDBUser();
+        String password = ServerSettings.getCredentialStoreDBPassword();
+        String driverName = ServerSettings.getCredentialStoreDBDriver();
+
+        log.debug("Starting credential store, connecting to database - " + jdbcUrl + " DB user - " + userName + " driver name - " + driverName);
+        dbUtil = new DBUtil(jdbcUrl, userName, password, driverName);
+        sshCredentialWriter = new SSHCredentialWriter(dbUtil);
+        certificateCredentialWriter = new CertificateCredentialWriter(dbUtil);
+        credentialReader = new CredentialReaderImpl(dbUtil);
+    }
+
+    @Override
+    public String getCSServiceVersion() throws TException {
+        return cs_cpi_serviceConstants.CS_CPI_VERSION;
+    }
+
+    @Override
+    public String addSSHCredential(SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
+        try {
+            org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential credential = new org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential();
+            credential.setGateway(sshCredential.getGatewayId());
+            credential.setPortalUserName(sshCredential.getUsername());
+            // only username and gateway id will be sent by client.
+            String token = TokenGenerator.generateToken(sshCredential.getGatewayId(), null);
+            credential.setToken(token);
+            credential.setPassphrase(String.valueOf(UUID.randomUUID()));
+            if (sshCredential.getPrivateKey() != null) {
+                credential.setPrivateKey(sshCredential.getPrivateKey().getBytes());
+            }
+            if (sshCredential.getPublicKey() != null) {
+                credential.setPublicKey(sshCredential.getPublicKey().getBytes());
+            }
+            if (sshCredential.getPublicKey() == null || sshCredential.getPrivateKey() == null) {
+                credential = Utility.generateKeyPair(credential);
+            }
+            sshCredentialWriter.writeCredentials(credential);
+            return token;
+        } catch (CredentialStoreException e) {
+            log.error("Error occurred while saving SSH Credentials.", e);
+            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while saving SSH Credentials.");
+        } catch (Exception e) {
+            log.error("Error occurred while generating key pair.", e);
+            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while generating key pair..");
+        }
+    }
+
+    @Override
+    public String addCertificateCredential(CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
+        try {
+            org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential credential = new org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential();
+            credential.setPortalUserName(certificateCredential.getCommunityUser().getUsername());
+            credential.setCommunityUser(new CommunityUser(certificateCredential.getCommunityUser().getGatewayNmae(),
+                    certificateCredential.getCommunityUser().getUsername(), certificateCredential.getCommunityUser().getUserEmail()));
+            String token = TokenGenerator.generateToken(certificateCredential.getCommunityUser().getGatewayNmae(), null);
+            credential.setToken(token);
+            Base64 encoder = new Base64(64);
+            byte [] decoded = encoder.decode(certificateCredential.getX509Cert().replaceAll(X509Factory.BEGIN_CERT, "").replaceAll(X509Factory.END_CERT, ""));
+            CertificateFactory cf = CertificateFactory.getInstance("X.509");
+            X509Certificate certificate = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(decoded));
+            X509Certificate[] certificates = new X509Certificate[1];
+            certificates[0] = certificate;
+            credential.setCertificates(certificates);
+            certificateCredentialWriter.writeCredentials(credential);
+            return token;
+        } catch (CredentialStoreException e) {
+            log.error("Error occurred while saving Certificate Credentials.", e);
+            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while saving Certificate Credentials.");
+        } catch (Exception e) {
+            log.error("Error occurred while converting to X509 certificate.", e);
+            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while converting to X509 certificate..");
+        }
+    }
+
+    @Override
+    public String addPasswordCredential(PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
+        return null;
+    }
+
+    @Override
+    public SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
+        try {
+            Credential credential = credentialReader.getCredential(gatewayId, tokenId);
+            if (credential instanceof org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) {
+                org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential credential1 = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential;
+                SSHCredential sshCredential = new SSHCredential();
+                sshCredential.setUsername(credential1.getPortalUserName());
+                sshCredential.setGatewayId(credential1.getGateway());
+                sshCredential.setPublicKey(new String(credential1.getPublicKey()));
+                sshCredential.setPrivateKey(new String(credential1.getPrivateKey()));
+                sshCredential.setPassphrase(credential1.getPassphrase());
+                sshCredential.setToken(credential1.getToken());
+                sshCredential.setPersistedTime(credential1.getCertificateRequestedTime().getTime());
+                return sshCredential;
+            } else {
+                log.info("Could not find SSH credentials for token - " + tokenId + " and "
+                        + "gateway id - " + gatewayId);
+                return null;
+            }
+        } catch (CredentialStoreException e) {
+            log.error("Error occurred while retrieving SSH credentialfor token - " +  tokenId + " and gateway id - " + gatewayId, e);
+            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while retrieving SSH credential for token - " +  tokenId + " and gateway id - " + gatewayId);
+        }
+    }
+
+    @Override
+    public CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
+        try {
+            Credential credential = credentialReader.getCredential(gatewayId, tokenId);
+            if (credential instanceof org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential) {
+                org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential credential1 = (org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential) credential;
+                CertificateCredential certificateCredential = new CertificateCredential();
+                org.apache.airavata.credential.store.datamodel.CommunityUser communityUser = new org.apache.airavata.credential.store.datamodel.CommunityUser();
+                communityUser.setGatewayNmae(credential1.getCommunityUser().getGatewayName());
+                communityUser.setUsername(credential1.getCommunityUser().getUserName());
+                communityUser.setUserEmail(credential1.getCommunityUser().getUserEmail());
+                certificateCredential.setCommunityUser(communityUser);
+                certificateCredential.setToken(credential1.getToken());
+                certificateCredential.setLifeTime(credential1.getLifeTime());
+                certificateCredential.setNotAfter(credential1.getNotAfter());
+                certificateCredential.setNotBefore(credential1.getNotBefore());
+                certificateCredential.setPersistedTime(credential1.getCertificateRequestedTime().getTime());
+                if (credential1.getPrivateKey() != null){
+                    certificateCredential.setPrivateKey(credential1.getPrivateKey().toString());
+                }
+                certificateCredential.setX509Cert(credential1.getCertificates()[0].toString());
+                return certificateCredential;
+            } else {
+                log.info("Could not find Certificate credentials for token - " + tokenId + " and "
+                        + "gateway id - " + gatewayId);
+                return null;
+            }
+        } catch (CredentialStoreException e) {
+            log.error("Error occurred while retrieving Certificate credential for token - " +  tokenId + " and gateway id - " + gatewayId, e);
+            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while retrieving Certificate credential for token - " +  tokenId + " and gateway id - " + gatewayId);
+        }
+    }
+
+    @Override
+    public PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
+        return null;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java
new file mode 100644
index 0000000..b2e8786
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * 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.credential.store.servlet;
+
+import edu.uiuc.ncsa.myproxy.oa4mp.client.loader.ClientBootstrapper;
+import edu.uiuc.ncsa.security.core.util.ConfigurationLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletContext;
+import java.io.File;
+
+/**
+ * Bootstrapper class for credential-store.
+ */
+public class CredentialBootstrapper extends ClientBootstrapper {
+
+    protected static Logger log = LoggerFactory.getLogger(CredentialBootstrapper.class);
+
+    public ConfigurationLoader getConfigurationLoader(ServletContext servletContext) throws Exception {
+
+        File currentDirectory = new File(".");
+
+        log.info("Current directory is - " + currentDirectory.getAbsolutePath());
+
+        return super.getConfigurationLoader(servletContext);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java
new file mode 100644
index 0000000..66d4be7
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java
@@ -0,0 +1,272 @@
+/*
+ *
+ * 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.credential.store.servlet;
+
+import edu.uiuc.ncsa.myproxy.oa4mp.client.AssetResponse;
+import edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment;
+import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPService;
+import edu.uiuc.ncsa.myproxy.oa4mp.client.servlet.ClientServlet;
+import edu.uiuc.ncsa.security.core.exceptions.GeneralException;
+import edu.uiuc.ncsa.security.servlet.JSPUtil;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ApplicationSettings;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
+import org.apache.airavata.credential.store.notifier.NotifierBootstrap;
+import org.apache.airavata.credential.store.notifier.impl.EmailNotifierConfiguration;
+import org.apache.airavata.credential.store.store.impl.CertificateCredentialWriter;
+import org.apache.airavata.credential.store.util.ConfigurationReader;
+import org.apache.airavata.credential.store.util.CredentialStoreConstants;
+import org.apache.airavata.credential.store.util.PrivateKeyStore;
+import org.apache.airavata.credential.store.util.Utility;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.Map;
+
+import static edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment.CALLBACK_URI_KEY;
+
+/**
+ * Callback from the portal will come here. In this class we will store incomming certificate to the database. Partly
+ * taken from OA4MP code base.
+ */
+public class CredentialStoreCallbackServlet extends ClientServlet {
+
+    private OA4MPService oa4mpService;
+
+    private CertificateCredentialWriter certificateCredentialWriter;
+
+    private static ConfigurationReader configurationReader;
+
+    private NotifierBootstrap notifierBootstrap;
+
+    public void init() throws ServletException {
+
+        DBUtil dbUtil;
+
+        try {
+            AiravataUtils.setExecutionAsServer();
+            dbUtil = DBUtil.getCredentialStoreDBUtil();
+        } catch (Exception e) {
+            throw new ServletException("Error initializing database operations.", e);
+        }
+
+        try {
+            configurationReader = new ConfigurationReader();
+            super.init();
+            certificateCredentialWriter = new CertificateCredentialWriter(dbUtil);
+        } catch (Exception e) {
+            throw new ServletException("Error initializing configuration reader.", e);
+        }
+
+
+        // initialize notifier
+        try {
+            boolean enabled = Boolean.parseBoolean(ApplicationSettings.getCredentialStoreNotifierEnabled());
+
+            if (enabled) {
+                EmailNotifierConfiguration notifierConfiguration
+                        = EmailNotifierConfiguration.getEmailNotifierConfigurations();
+                long duration = Long.parseLong(ApplicationSettings.getCredentialStoreNotifierDuration());
+
+                notifierBootstrap = new NotifierBootstrap(duration, dbUtil, notifierConfiguration);
+            }
+
+        } catch (ApplicationSettingsException e) {
+            throw new ServletException("Error initializing notifier.", e);
+        }
+
+
+        info("Credential store callback initialized successfully.");
+    }
+
+    @Override
+    public OA4MPService getOA4MPService() {
+        return oa4mpService;
+    }
+
+    @Override
+    public void loadEnvironment() throws IOException {
+        environment = getConfigurationLoader().load();
+        oa4mpService = new OA4MPService((ClientEnvironment) environment);
+    }
+
+    @Override
+    protected void doIt(HttpServletRequest request, HttpServletResponse response) throws Throwable {
+
+        String gatewayName = request.getParameter(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER);
+        String portalUserName = request.getParameter(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER);
+        String durationParameter = request.getParameter(CredentialStoreConstants.DURATION_QUERY_PARAMETER);
+        String contactEmail = request.getParameter(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER);
+        String portalTokenId = request.getParameter(CredentialStoreConstants.PORTAL_TOKEN_ID_ASSIGNED);
+
+        // TODO remove hard coded values, once passing query parameters is
+        // fixed in OA4MP client api
+        long duration = 864000;
+
+        if (durationParameter != null) {
+            duration = Long.parseLong(durationParameter);
+        }
+
+        if (portalTokenId == null) {
+            error("Token given by portal is invalid.");
+            GeneralException ge = new GeneralException("Error: The token presented by portal is null.");
+            request.setAttribute("exception", ge);
+            JSPUtil.fwd(request, response, configurationReader.getErrorUrl());
+            return;
+        }
+
+        info("Gateway name " + gatewayName);
+        info("Portal user name " + portalUserName);
+        info("Community user contact email " + contactEmail);
+        info("Token id presented " + portalTokenId);
+
+        info("2.a. Getting token and verifier.");
+        String token = request.getParameter(CONST(ClientEnvironment.TOKEN));
+        String verifier = request.getParameter(CONST(ClientEnvironment.VERIFIER));
+        if (token == null || verifier == null) {
+            warn("2.a. The token is " + (token == null ? "null" : token) + " and the verifier is "
+                    + (verifier == null ? "null" : verifier));
+            GeneralException ge = new GeneralException(
+                    "Error: This servlet requires parameters for the token and verifier. It cannot be called directly.");
+            request.setAttribute("exception", ge);
+            JSPUtil.fwd(request, response, configurationReader.getErrorUrl());
+            return;
+        }
+        info("2.a Token and verifier found.");
+        X509Certificate[] certificates;
+        AssetResponse assetResponse = null;
+
+        PrivateKey privateKey;
+
+        try {
+
+            PrivateKeyStore privateKeyStore = PrivateKeyStore.getPrivateKeyStore();
+            privateKey = privateKeyStore.getKey(portalTokenId);
+
+            if (privateKey != null) {
+                info("Found private key for token " + portalTokenId);
+            } else {
+                info("Could not find private key for token " + portalTokenId);
+            }
+
+            info("2.a. Getting the cert(s) from the service");
+            assetResponse = getOA4MPService().getCert(token, verifier);
+
+            certificates = assetResponse.getX509Certificates();
+
+        } catch (Throwable t) {
+            warn("2.a. Exception from the server: " + t.getCause().getMessage());
+            error("Exception while trying to get cert. message:" + t.getMessage());
+            request.setAttribute("exception", t);
+            JSPUtil.fwd(request, response, configurationReader.getErrorUrl());
+            return;
+        }
+
+        info("2.b. Done! Displaying success page.");
+
+        CertificateCredential certificateCredential = new CertificateCredential();
+
+        certificateCredential.setNotBefore(Utility.convertDateToString(certificates[0].getNotBefore())); //TODO check this is correct
+        certificateCredential.setNotAfter(Utility.convertDateToString(certificates[0].getNotAfter()));
+        certificateCredential.setCertificates(certificates);
+        certificateCredential.setPrivateKey(privateKey);
+        certificateCredential
+                .setCommunityUser(new CommunityUser(gatewayName, assetResponse.getUsername(), contactEmail));
+        certificateCredential.setPortalUserName(portalUserName);
+        certificateCredential.setLifeTime(duration);
+        certificateCredential.setToken(portalTokenId);
+
+
+        certificateCredentialWriter.writeCredentials(certificateCredential);
+
+        StringBuilder stringBuilder = new StringBuilder("Certificate for community user ");
+        stringBuilder.append(assetResponse.getUsername()).append(" successfully persisted.");
+        stringBuilder.append(" Certificate DN - ").append(certificates[0].getSubjectDN());
+
+        info(stringBuilder.toString());
+
+        if (isUrlInSameServer(configurationReader.getSuccessUrl())) {
+
+            String contextPath = request.getContextPath();
+            if (!contextPath.endsWith("/")) {
+                contextPath = contextPath + "/";
+            }
+            request.setAttribute("action", contextPath);
+            request.setAttribute("tokenId", portalTokenId);
+            JSPUtil.fwd(request, response, configurationReader.getSuccessUrl());
+        } else {
+
+            String urlToRedirect = decorateUrlWithToken(configurationReader.getSuccessUrl(), portalTokenId);
+
+            info("Redirecting to url - " + urlToRedirect);
+
+            response.sendRedirect(urlToRedirect);
+        }
+
+        info("2.a. Completely finished with delegation.");
+
+    }
+
+    private boolean isUrlInSameServer(String url) {
+
+        return !(url.toLowerCase().startsWith("http") || url.toLowerCase().startsWith("https"));
+
+    }
+
+    private String decorateUrlWithToken(String url, String tokenId) {
+
+        StringBuilder stringBuilder = new StringBuilder(url);
+        stringBuilder.append("?tokenId=").append(tokenId);
+        return stringBuilder.toString();
+    }
+
+    private Map<String, String> createQueryParameters(String gatewayName, String portalUserName, String portalEmail,
+            String tokenId) {
+
+        String callbackUriKey = getEnvironment().getConstants().get(CALLBACK_URI_KEY);
+        ClientEnvironment clientEnvironment = (ClientEnvironment) getEnvironment();
+
+        String callbackUri = clientEnvironment.getCallback().toString();
+
+        StringBuilder stringBuilder = new StringBuilder(callbackUri);
+
+        stringBuilder.append("?").append(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER).append("=").append(gatewayName).append("&")
+                .append(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER).append("=").append(portalUserName).append("&")
+                .append(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER).append("=").append(portalEmail).append("&")
+                .append(CredentialStoreConstants.PORTAL_TOKEN_ID_ASSIGNED).append("=").append(tokenId);
+
+        info("Callback URI is set to - " + stringBuilder.toString());
+
+        Map<String, String> parameters = new HashMap<String, String>();
+        parameters.put(callbackUriKey, stringBuilder.toString());
+
+        return parameters;
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
new file mode 100644
index 0000000..3b70242
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
@@ -0,0 +1,183 @@
+/*
+ *
+ * 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.credential.store.servlet;
+
+import edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment;
+import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPResponse;
+import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPService;
+import edu.uiuc.ncsa.myproxy.oa4mp.client.servlet.ClientServlet;
+import edu.uiuc.ncsa.security.servlet.JSPUtil;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.airavata.credential.store.util.ConfigurationReader;
+import org.apache.airavata.credential.store.util.CredentialStoreConstants;
+import org.apache.airavata.credential.store.util.PrivateKeyStore;
+import org.apache.airavata.credential.store.util.TokenGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
+import static edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment.CALLBACK_URI_KEY;
+
+/**
+ * When portal initiate a request to get credentials it will hit this servlet.
+ */
+public class CredentialStoreStartServlet extends ClientServlet {
+
+    private static ConfigurationReader configurationReader = null;
+
+    private static Logger log = LoggerFactory.getLogger(CredentialStoreStartServlet.class);
+    private OA4MPService oa4mpService;
+
+    protected String decorateURI(URI inputURI, Map<String, String> parameters) {
+
+        if (parameters.isEmpty()) {
+            return inputURI.toString();
+        }
+
+        String stringUri = inputURI.toString();
+        StringBuilder stringBuilder = new StringBuilder(stringUri);
+
+        boolean isFirst = true;
+
+        for (Map.Entry<String, String> entry : parameters.entrySet()) {
+            if (isFirst) {
+                stringBuilder.append("?");
+                isFirst = false;
+            } else {
+                stringBuilder.append("&");
+            }
+
+            stringBuilder.append(entry.getKey()).append("=").append(entry.getValue());
+        }
+
+        return stringBuilder.toString();
+
+    }
+
+    public void init() throws ServletException {
+
+        super.init();
+
+        try {
+            if (configurationReader == null) {
+                configurationReader = new ConfigurationReader();
+            }
+        } catch (CredentialStoreException e) {
+            throw new ServletException(e);
+        }
+
+    }
+
+    @Override
+    public OA4MPService getOA4MPService() {
+        return oa4mpService;
+    }
+
+    @Override
+    public void loadEnvironment() throws IOException {
+        environment = getConfigurationLoader().load();
+        oa4mpService = new OA4MPService((ClientEnvironment) environment);
+    }
+
+    @Override
+    protected void doIt(HttpServletRequest request, HttpServletResponse response) throws Throwable {
+
+        String gatewayName
+                = request.getParameter(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER);
+        String portalUserName
+                = request.getParameter(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER);
+        String contactEmail
+                = request.getParameter(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER);
+        String associatedToken = TokenGenerator.generateToken(gatewayName, portalUserName);
+
+        if (gatewayName == null) {
+            JSPUtil.handleException(new RuntimeException("Please specify a gateway name."), request, response,
+                    configurationReader.getErrorUrl());
+            return;
+        }
+
+        if (portalUserName == null) {
+            JSPUtil.handleException(new RuntimeException("Please specify a portal user name."), request, response,
+                    configurationReader.getErrorUrl());
+            return;
+        }
+
+        if (contactEmail == null) {
+            JSPUtil.handleException(new RuntimeException("Please specify a contact email address for community"
+                    + " user account."), request, response, configurationReader.getErrorUrl());
+            return;
+        }
+
+        log.info("1.a. Starting transaction");
+        OA4MPResponse gtwResp;
+
+        Map<String, String> queryParameters = new HashMap<String, String>();
+        queryParameters.put(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER, gatewayName);
+        queryParameters.put(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER, portalUserName);
+        queryParameters.put(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER, contactEmail);
+        queryParameters.put(CredentialStoreConstants.PORTAL_TOKEN_ID_ASSIGNED, associatedToken);
+
+        Map<String, String> additionalParameters = new HashMap<String, String>();
+
+        if (getOA4MPService() == null) {
+            loadEnvironment();
+        }
+
+        String modifiedCallbackUri = decorateURI(getOA4MPService().getEnvironment().getCallback(), queryParameters);
+
+        info("The modified callback URI - " + modifiedCallbackUri);
+
+        additionalParameters.put(getEnvironment().getConstants().get(CALLBACK_URI_KEY), modifiedCallbackUri);
+
+        try {
+            gtwResp = getOA4MPService().requestCert(additionalParameters);
+
+            // Private key in store
+            PrivateKeyStore privateKeyStore = PrivateKeyStore.getPrivateKeyStore();
+            privateKeyStore.addKey(associatedToken, gtwResp.getPrivateKey());
+
+        } catch (Throwable t) {
+            JSPUtil.handleException(t, request, response, configurationReader.getErrorUrl());
+            return;
+        }
+        log.info("1.b. Got response. Creating page with redirect for " + gtwResp.getRedirect().getHost());
+        // Normally, we'd just do a redirect, but we will put up a page and show the redirect to the user.
+        // The client response contains the generated private key as well
+        // In a real application, the private key would be stored. This, however, exceeds the scope of this
+        // sample application -- all we need to do to complete the process is send along the redirect url.
+
+        request.setAttribute(REDIR, REDIR);
+        request.setAttribute("redirectUrl", gtwResp.getRedirect().toString());
+        request.setAttribute(ACTION_KEY, ACTION_KEY);
+        request.setAttribute("action", ACTION_REDIRECT_VALUE);
+        log.info("1.b. Showing redirect page.");
+        JSPUtil.fwd(request, response, configurationReader.getPortalRedirectUrl());
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java
new file mode 100644
index 0000000..fe54b8e
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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.credential.store.store;
+
+import org.apache.airavata.credential.store.credential.AuditInfo;
+import org.apache.airavata.credential.store.credential.Credential;
+
+import java.util.List;
+
+/**
+ * This interface provides an API for Credential Store. Provides methods to manipulate credential store data.
+ */
+public interface CredentialReader {
+
+    /**
+     * Retrieves the credential from the credential store.
+     * 
+     * @param gatewayId
+     *            The gateway id
+     * @param tokenId
+     *            The token id associated with the credential
+     * @return The Credential object associated with the token.
+     * @throws CredentialStoreException
+     *             If an error occurred while retrieving a credential.
+     */
+    Credential getCredential(String gatewayId, String tokenId) throws CredentialStoreException;
+
+    /**
+     * Gets the admin portal user name who retrieved given community user for given portal user name.
+     * 
+     * @param gatewayName
+     *            The gateway name
+     * @param tokenId
+     *            The issued token id.
+     * @return The portal user name who requested given community user credentials.
+     */
+    String getPortalUser(String gatewayName, String tokenId) throws CredentialStoreException;
+
+    /**
+     * Gets audit information related to given gateway name and community user name.
+     * 
+     * @param gatewayName
+     *            The gateway name.
+     * @param tokenId
+     *            The community user name.
+     * @return CertificateAuditInfo object.
+     */
+    AuditInfo getAuditInfo(String gatewayName, String tokenId) throws CredentialStoreException;
+
+    /**
+     * Gets all the credential records.
+     * @return All credential records as a list
+     * @throws CredentialStoreException If an error occurred while retrieving credentials.
+     */
+    public List<Credential> getAllCredentials() throws CredentialStoreException;
+
+    /**
+     * Updates the community user contact email address.
+     *
+     * @param gatewayName
+     *            The gateway name.
+     * @param communityUser
+     *            The community user name.
+     * @param email
+     *            The new email address.
+     */
+    void updateCommunityUserEmail(String gatewayName, String communityUser, String email)
+            throws CredentialStoreException;
+
+    /**
+     * Will remove credentials for the given gateway id and community user.
+     * 
+     * @param gatewayName
+     *            The gateway Id
+     * @param tokenId
+     *            The issued token id.
+     * @throws CredentialStoreException
+     *             If an error occurred while retrieving data.
+     */
+    void removeCredentials(String gatewayName, String tokenId) throws CredentialStoreException;
+    
+    /**
+     * Retrieves gatewayID from the credential store.
+     * 
+     * @param tokenId
+     *            The token id associated with the credential
+     * @return The Credential object associated with the token.
+     * @throws CredentialStoreException
+     *             If an error occurred while retrieving a credential.
+     */
+    String getGatewayID(String tokenId) throws CredentialStoreException;
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java
new file mode 100644
index 0000000..f4b5e21
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * 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.credential.store.store;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
+
+/**
+ * Factory class to create credential store readers.
+ */
+public class CredentialReaderFactory {
+
+    /**
+     * Creates a credential reader using supplied database configurations.
+     * @param dbUti The database configurations.
+     * @return CredentialReader object.
+     */
+    public static CredentialReader createCredentialStoreReader(DBUtil dbUti) throws ApplicationSettingsException {
+        return new CredentialReaderImpl(dbUti);
+    }
+
+    /**
+     * Creates credential reader using default configurations for credential store database.
+     * @return The credential reader.
+     * @throws ClassNotFoundException If an error occurred while instantiating jdbc driver
+     * @throws ApplicationSettingsException If an error occurred while reading database configurations.
+     * @throws InstantiationException If an error occurred while instantiating jdbc driver
+     * @throws IllegalAccessException A security exception accessing jdbc driver.
+     */
+    public static CredentialReader createCredentialStoreReader() throws ClassNotFoundException,
+            ApplicationSettingsException, InstantiationException, IllegalAccessException {
+        return new CredentialReaderImpl(DBUtil.getCredentialStoreDBUtil());
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java
new file mode 100644
index 0000000..07bed10
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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.credential.store.store;
+
+/**
+ * An exception class for credential store.
+ */
+public class CredentialStoreException extends Exception {
+
+    public CredentialStoreException() {
+        super();
+    }
+
+    public CredentialStoreException(String s) {
+        super(s);
+    }
+
+    public CredentialStoreException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java
new file mode 100644
index 0000000..05ae9fe
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * 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.credential.store.store;
+
+import org.apache.airavata.credential.store.credential.Credential;
+
+/**
+ * The entity who's writing credentials to DB will use this interface.
+ */
+public interface CredentialWriter {
+
+    /**
+     * Writes given credentials to a persistent storage.
+     * 
+     * @param credential
+     *            The credentials implementation.
+     */
+    void writeCredentials(Credential credential) throws CredentialStoreException;
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java
new file mode 100644
index 0000000..8b96187
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java
@@ -0,0 +1,121 @@
+/*
+ *
+ * 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.credential.store.store.impl;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ApplicationSettings;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.DefaultKeyStorePasswordCallback;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+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.impl.db.CommunityUserDAO;
+import org.apache.airavata.credential.store.store.impl.db.CredentialsDAO;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.airavata.credential.store.store.CredentialWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+/**
+ * Writes certificate credentials to database.
+ */
+public class CertificateCredentialWriter implements CredentialWriter {
+
+    private CredentialsDAO credentialsDAO;
+    private CommunityUserDAO communityUserDAO;
+
+    protected static Logger log = LoggerFactory.getLogger(CertificateCredentialWriter.class);
+
+    private DBUtil dbUtil;
+
+    public CertificateCredentialWriter(DBUtil dbUtil) throws ApplicationSettingsException {
+
+        this.dbUtil = dbUtil;
+
+        this.credentialsDAO = new CredentialsDAO(ApplicationSettings.getCredentialStoreKeyStorePath(),
+                ApplicationSettings.getCredentialStoreKeyAlias(), new DefaultKeyStorePasswordCallback());
+
+        communityUserDAO = new CommunityUserDAO();
+    }
+
+    public void writeCredentials(Credential credential) throws CredentialStoreException {
+
+        CertificateCredential certificateCredential = (CertificateCredential) credential;
+
+        Connection connection = null;
+
+        try {
+
+            connection = dbUtil.getConnection();
+            // Write community user
+            writeCommunityUser(certificateCredential.getCommunityUser(), credential.getToken(), connection);
+            // First delete existing credentials
+            credentialsDAO.deleteCredentials(certificateCredential.getCommunityUser().getGatewayName(),
+                    certificateCredential.getToken(), connection);
+            // Add the new certificate
+            credentialsDAO.addCredentials(certificateCredential.getCommunityUser().getGatewayName(), credential,
+                    connection);
+
+            if (!connection.getAutoCommit()) {
+                connection.commit();
+            }
+
+        } catch (SQLException e) {
+            if (connection != null) {
+                try {
+                    connection.rollback();
+                } catch (SQLException e1) {
+                    log.error("Unable to rollback transaction", e1);
+                }
+            }
+            throw new CredentialStoreException("Unable to retrieve database connection.", e);
+        } finally {
+            DBUtil.cleanup(connection);
+        }
+
+    }
+
+    public void writeCommunityUser(CommunityUser communityUser, String token, Connection connection)
+            throws CredentialStoreException {
+
+        // First delete existing community user
+        communityUserDAO.deleteCommunityUserByToken(communityUser, token, connection);
+
+        // Persist new community user
+        communityUserDAO.addCommunityUser(communityUser, token, connection);
+
+    }
+
+    /*
+     * TODO Remove later - If we dont need to expose this in the interface public void writeCommunityUser(CommunityUser
+     * communityUser, String token) throws CredentialStoreException {
+     * 
+     * Connection connection = null; try { connection = dbUtil.getConnection(); writeCommunityUser(communityUser, token,
+     * connection);
+     * 
+     * } catch (SQLException e) { throw new CredentialStoreException("Unable to retrieve database connection.", e); }
+     * finally { DBUtil.cleanup(connection); } }
+     */
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java
new file mode 100644
index 0000000..dc2fd60
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java
@@ -0,0 +1,162 @@
+/*
+ *
+ * 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.credential.store.store.impl;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ApplicationSettings;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.DefaultKeyStorePasswordCallback;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+import org.apache.airavata.credential.store.credential.Credential;
+import org.apache.airavata.credential.store.credential.impl.certificate.CertificateAuditInfo;
+import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
+import org.apache.airavata.credential.store.store.CredentialReader;
+import org.apache.airavata.credential.store.store.impl.db.CredentialsDAO;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+
+import java.io.Serializable;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.List;
+
+/**
+ * Credential store API implementation.
+ */
+public class CredentialReaderImpl implements CredentialReader, Serializable {
+
+    private CredentialsDAO credentialsDAO;
+
+    private DBUtil dbUtil;
+
+    public CredentialReaderImpl(DBUtil dbUtil) throws ApplicationSettingsException {
+
+        this.credentialsDAO = new CredentialsDAO(ApplicationSettings.getCredentialStoreKeyStorePath(),
+                ApplicationSettings.getCredentialStoreKeyAlias(), new DefaultKeyStorePasswordCallback());
+
+        this.dbUtil = dbUtil;
+    }
+
+    private Connection getConnection() throws CredentialStoreException {
+        try {
+            return this.dbUtil.getConnection();
+        } catch (SQLException e) {
+            throw new CredentialStoreException("Unable to retrieve database connection.", e);
+        }
+    }
+
+    @Override
+    public Credential getCredential(String gatewayId, String tokenId) throws CredentialStoreException {
+
+        Connection connection = getConnection();
+
+        try {
+            return this.credentialsDAO.getCredential(gatewayId, tokenId, connection);
+        } finally {
+            DBUtil.cleanup(connection);
+        }
+    }
+
+    public List<Credential> getAllCredentials() throws CredentialStoreException {
+
+        Connection connection = getConnection();
+
+        try {
+            return this.credentialsDAO.getCredentials(connection);
+        } finally {
+            DBUtil.cleanup(connection);
+        }
+
+    }
+
+    public String getPortalUser(String gatewayName, String tokenId) throws CredentialStoreException {
+
+        Connection connection = getConnection();
+
+        Credential credential;
+
+        try {
+            credential = this.credentialsDAO.getCredential(gatewayName, tokenId, connection);
+
+        } finally {
+            DBUtil.cleanup(connection);
+        }
+
+        return credential.getPortalUserName();
+    }
+
+    public CertificateAuditInfo getAuditInfo(String gatewayName, String tokenId) throws CredentialStoreException {
+
+        Connection connection = getConnection();
+
+        CertificateAuditInfo certificateAuditInfo;
+
+        try {
+
+            CertificateCredential certificateCredential = (CertificateCredential) this.credentialsDAO.getCredential(
+                    gatewayName, tokenId, connection);
+
+            certificateAuditInfo = new CertificateAuditInfo();
+
+            CommunityUser retrievedUser = certificateCredential.getCommunityUser();
+            certificateAuditInfo.setCommunityUserName(retrievedUser.getUserName());
+            certificateAuditInfo.setCredentialLifeTime(certificateCredential.getLifeTime());
+            certificateAuditInfo.setCredentialsRequestedTime(certificateCredential.getCertificateRequestedTime());
+            certificateAuditInfo.setGatewayName(gatewayName);
+            certificateAuditInfo.setNotAfter(certificateCredential.getNotAfter());
+            certificateAuditInfo.setNotBefore(certificateCredential.getNotBefore());
+            certificateAuditInfo.setPortalUserName(certificateCredential.getPortalUserName());
+
+        } finally {
+            DBUtil.cleanup(connection);
+        }
+
+        return certificateAuditInfo;
+    }
+
+    public void updateCommunityUserEmail(String gatewayName, String communityUser, String email)
+            throws CredentialStoreException {
+        // TODO
+    }
+
+    public void removeCredentials(String gatewayName, String tokenId) throws CredentialStoreException {
+
+        Connection connection = getConnection();
+
+        try {
+            credentialsDAO.deleteCredentials(gatewayName, tokenId, connection);
+        } finally {
+            DBUtil.cleanup(connection);
+        }
+
+    }
+
+	@Override
+	public String getGatewayID(String tokenId) throws CredentialStoreException {
+		 Connection connection = getConnection();
+	        try {
+	            return this.credentialsDAO.getGatewayID(tokenId, connection);
+	        } finally {
+	            DBUtil.cleanup(connection);
+	        }
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java
new file mode 100644
index 0000000..ad4f6b3
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java
@@ -0,0 +1,87 @@
+/*
+ *
+ * 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.credential.store.store.impl;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ApplicationSettings;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.DefaultKeyStorePasswordCallback;
+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.CredentialStoreException;
+import org.apache.airavata.credential.store.store.CredentialWriter;
+import org.apache.airavata.credential.store.store.impl.db.CredentialsDAO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Writes SSH credentials to database.
+ */
+public class SSHCredentialWriter implements CredentialWriter {
+
+    private CredentialsDAO credentialsDAO;
+    private DBUtil dbUtil;
+    
+    protected static Logger logger = LoggerFactory.getLogger(SSHCredentialWriter.class);
+
+    public SSHCredentialWriter(DBUtil dbUtil) throws ApplicationSettingsException {
+        this.dbUtil = dbUtil;
+        this.credentialsDAO = new CredentialsDAO(ApplicationSettings.getCredentialStoreKeyStorePath(),
+                ApplicationSettings.getCredentialStoreKeyAlias(), new DefaultKeyStorePasswordCallback());
+
+    }
+
+    public void writeCredentials(Credential credential) throws CredentialStoreException {
+
+        SSHCredential sshCredential = (SSHCredential) credential;
+        Connection connection = null;
+
+        try {
+            connection = dbUtil.getConnection();
+            // First delete existing credentials
+            credentialsDAO.deleteCredentials(sshCredential.getGateway(), sshCredential.getToken(), connection);
+            // Add the new certificate
+            credentialsDAO.addCredentials(sshCredential.getGateway(), credential, connection);
+
+            if (!connection.getAutoCommit()) {
+                connection.commit();
+            }
+
+        } catch (SQLException e) {
+            if (connection != null) {
+                try {
+                    connection.rollback();
+                } catch (SQLException e1) {
+                    logger.error("Unable to rollback transaction", e1);
+                }
+            }
+            throw new CredentialStoreException("Unable to retrieve database connection.", e);
+        } finally {
+            DBUtil.cleanup(connection);
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
new file mode 100644
index 0000000..f55cd55
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
@@ -0,0 +1,257 @@
+/*
+ *
+ * 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.credential.store.store.impl.db;
+
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Data access class for community_user table.
+ */
+public class CommunityUserDAO extends ParentDAO {
+
+    public CommunityUserDAO() {
+        super();
+    }
+
+    public void addCommunityUser(CommunityUser user, String token, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "INSERT INTO COMMUNITY_USER VALUES (?, ?, ?, ?)";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, user.getGatewayName());
+            preparedStatement.setString(2, user.getUserName());
+            preparedStatement.setString(3, token);
+            preparedStatement.setString(4, user.getUserEmail());
+
+            preparedStatement.executeUpdate();
+
+            connection.commit();
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error persisting community user.");
+            stringBuilder.append("gateway - ").append(user.getGatewayName());
+            stringBuilder.append("community user name - ").append(user.getUserName());
+            stringBuilder.append("community user email - ").append(user.getUserEmail());
+            stringBuilder.append("token id - ").append(token);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+
+            DBUtil.cleanup(preparedStatement);
+        }
+    }
+
+    public void deleteCommunityUser(CommunityUser user, Connection connection) throws CredentialStoreException {
+
+        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, user.getGatewayName());
+            preparedStatement.setString(2, user.getUserName());
+
+            preparedStatement.executeUpdate();
+
+            connection.commit();
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error deleting community user.");
+            stringBuilder.append("gateway - ").append(user.getGatewayName());
+            stringBuilder.append("community user name - ").append(user.getUserName());
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement);
+        }
+    }
+
+    public void deleteCommunityUserByToken(CommunityUser user, String token, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=? AND TOKEN_ID=?";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, user.getGatewayName());
+            preparedStatement.setString(2, user.getUserName());
+            preparedStatement.setString(3, token);
+
+            preparedStatement.executeUpdate();
+
+            connection.commit();
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error deleting community user.");
+            stringBuilder.append("gateway - ").append(user.getGatewayName());
+            stringBuilder.append("community user name - ").append(user.getUserName());
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement);
+        }
+    }
+
+    public void updateCommunityUser(CommunityUser user) throws CredentialStoreException {
+
+        // TODO
+    }
+
+    public CommunityUser getCommunityUser(String gatewayName, String communityUserName, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, gatewayName);
+            preparedStatement.setString(2, communityUserName);
+
+            ResultSet resultSet = preparedStatement.executeQuery();
+
+            if (resultSet.next()) {
+                String email = resultSet.getString("COMMUNITY_USER_EMAIL"); // TODO fix typo
+
+                return new CommunityUser(gatewayName, communityUserName, email);
+
+            }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving community user.");
+            stringBuilder.append("gateway - ").append(gatewayName);
+            stringBuilder.append("community user name - ").append(communityUserName);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement);
+        }
+
+        return null;
+    }
+
+    public CommunityUser getCommunityUserByToken(String gatewayName, String tokenId, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND TOKEN_ID=?";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, gatewayName);
+            preparedStatement.setString(2, tokenId);
+
+            ResultSet resultSet = preparedStatement.executeQuery();
+
+            if (resultSet.next()) {
+                String communityUserName = resultSet.getString("COMMUNITY_USER_NAME");
+                String email = resultSet.getString("COMMUNITY_USER_EMAIL"); // TODO fix typo
+
+                return new CommunityUser(gatewayName, communityUserName, email);
+
+            }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving community user.");
+            stringBuilder.append("gateway - ").append(gatewayName);
+            stringBuilder.append("token- ").append(tokenId);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement);
+        }
+
+        return null;
+    }
+
+    public List<CommunityUser> getCommunityUsers(String gatewayName, Connection connection)
+            throws CredentialStoreException {
+
+        List<CommunityUser> userList = new ArrayList<CommunityUser>();
+
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=?";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, gatewayName);
+
+            ResultSet resultSet = preparedStatement.executeQuery();
+
+            while (resultSet.next()) {
+                String userName = resultSet.getString("COMMUNITY_USER_NAME");
+                String email = resultSet.getString("COMMUNITY_USER_EMAIL"); // TODO fix typo
+
+                userList.add(new CommunityUser(gatewayName, userName, email));
+
+            }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving community users for ");
+            stringBuilder.append("gateway - ").append(gatewayName);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement);
+        }
+
+        return userList;
+    }
+
+}


[32/62] [abbrv] airavata git commit: fixing monitoring issues with LSF

Posted by la...@apache.org.
fixing monitoring issues with LSF


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/04cecb4d
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/04cecb4d
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/04cecb4d

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 04cecb4d4c2d52883ca03cd5791c1031b7d2bd6c
Parents: 565b5a3
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Sat Mar 7 01:18:03 2015 -0500
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Sat Mar 7 01:18:03 2015 -0500

----------------------------------------------------------------------
 .../monitor/impl/pull/qstat/ResourceConnection.java   | 12 ++++++------
 .../apache/airavata/gfac/ssh/util/GFACSSHUtils.java   | 14 +++++++++++---
 .../airavata/gsi/ssh/api/job/LSFOutputParser.java     |  7 ++++---
 3 files changed, 21 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/04cecb4d/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 e13d907..f718535 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
@@ -113,27 +113,27 @@ public class ResourceConnection {
     private JobState getStatusFromString(String status) {
         log.info("parsing the job status returned : " + status);
         if (status != null) {
-            if ("C".equals(status) || "CD".equals(status) || "E".equals(status) || "CG".equals(status)) {
+            if ("C".equals(status) || "CD".equals(status) || "E".equals(status) || "CG".equals(status) || "DONE".equals(status)) {
                 return JobState.COMPLETE;
             } else if ("H".equals(status) || "h".equals(status)) {
                 return JobState.HELD;
-            } else if ("Q".equals(status) || "qw".equals(status)) {
+            } else if ("Q".equals(status) || "qw".equals(status) || "PEND".equals(status)) {
                 return JobState.QUEUED;
-            } else if ("R".equals(status) || "CF".equals(status) || "r".equals(status)) {
+            } else if ("R".equals(status) || "CF".equals(status) || "r".equals(status) || "RUN".equals(status)) {
                 return JobState.ACTIVE;
             } else if ("T".equals(status)) {
                 return JobState.HELD;
             } else if ("W".equals(status) || "PD".equals(status)) {
                 return JobState.QUEUED;
-            } else if ("S".equals(status)) {
+            } else if ("S".equals(status) || "PSUSP".equals(status) || "USUSP".equals(status) || "SSUSP".equals(status)) {
                 return JobState.SUSPENDED;
             } else if ("CA".equals(status)) {
                 return JobState.CANCELED;
-            } else if ("F".equals(status) || "NF".equals(status) || "TO".equals(status)) {
+            } else if ("F".equals(status) || "NF".equals(status) || "TO".equals(status) || "EXIT".equals(status)) {
                 return JobState.FAILED;
             } else if ("PR".equals(status) || "Er".equals(status)) {
                 return JobState.FAILED;
-            } else if ("U".equals(status)) {
+            } else if ("U".equals(status) || ("UNKWN".equals(status))) {
                 return JobState.UNKNOWN;
             }
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/04cecb4d/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 c4d25f5..890768a 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
@@ -325,9 +325,7 @@ public class GFACSSHUtils {
         if (computationalProjectAccount != null) {
             jobDescriptor.setAcountString(computationalProjectAccount);
         }
-        Random random = new Random();
-        int i = random.nextInt(Integer.MAX_VALUE);
-        jobDescriptor.setJobName(String.valueOf(i + 99999999));
+        jobDescriptor.setJobName(String.valueOf(generateJobName()));
         jobDescriptor.setWorkingDirectory(jobExecutionContext.getWorkingDir());
 
         List<String> inputValues = new ArrayList<String>();
@@ -455,6 +453,16 @@ public class GFACSSHUtils {
         return jobDescriptor;
     }
 
+    private static int generateJobName() {
+        Random random = new Random();
+        int i = random.nextInt(Integer.MAX_VALUE);
+        i = i + 99999999;
+        if(i<0) {
+            i = i * (-1);
+        }
+        return i;
+    }
+
     private static String parseCommand(String value, JobExecutionContext jobExecutionContext) {
         String parsedValue = value.replaceAll("\\$workingDir", jobExecutionContext.getWorkingDir());
         parsedValue = parsedValue.replaceAll("\\$inputDir", jobExecutionContext.getInputDir());

http://git-wip-us.apache.org/repos/asf/airavata/blob/04cecb4d/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
index bd02e37..71c3339 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
@@ -94,16 +94,17 @@ public class LSFOutputParser implements OutputParser {
         String test = "Job <2477982> is submitted to queue <short>.";
         System.out.println(test.substring(test.indexOf("<")+1, test.indexOf(">")));
         String test1 = "JOBID   USER    STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME\n" +
-                "2477983 cjh     RUN   short      ghpcc05     c17b06      *sleep_300 Feb 25 10:25";
+                "2636607 lg11w   RUN   long       ghpcc06     c11b02      *069656647 Mar  7 00:58\n" +
+                "2636582 lg11w   RUN   long       ghpcc06     c02b01      2134490944 Mar  7 00:48";
         Map<String, JobStatus> statusMap = new HashMap<String, JobStatus>();
-        statusMap.put("2477983,*sleep_300", JobStatus.U);
+        statusMap.put("2477983,2134490944", JobStatus.U);
         LSFOutputParser lsfOutputParser = new LSFOutputParser();
         try {
             lsfOutputParser.parseJobStatuses("cjh", statusMap, test1);
         } catch (SSHApiException e) {
             logger.error(e.getMessage(), e);
         }
-        System.out.println(statusMap.get("2477983,*sleep_300"));
+        System.out.println(statusMap.get("2477983,2134490944"));
 
     }
 }


[15/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
deleted file mode 100644
index 5d9c05c..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
+++ /dev/null
@@ -1,6888 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CredentialStoreService {
-
-  public interface Iface {
-
-    /**
-     * Query CS server to fetch the CPI version
-     */
-    public String getCSServiceVersion() throws org.apache.thrift.TException;
-
-    /**
-     * This method is to add SSHCredential which will return the token Id in success
-     * 
-     * 
-     * @param sshCredential
-     */
-    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-  }
-
-  public interface AsyncIface {
-
-    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-  }
-
-  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
-    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
-      public Factory() {}
-      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
-        return new Client(prot);
-      }
-      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
-        return new Client(iprot, oprot);
-      }
-    }
-
-    public Client(org.apache.thrift.protocol.TProtocol prot)
-    {
-      super(prot, prot);
-    }
-
-    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
-      super(iprot, oprot);
-    }
-
-    public String getCSServiceVersion() throws org.apache.thrift.TException
-    {
-      send_getCSServiceVersion();
-      return recv_getCSServiceVersion();
-    }
-
-    public void send_getCSServiceVersion() throws org.apache.thrift.TException
-    {
-      getCSServiceVersion_args args = new getCSServiceVersion_args();
-      sendBase("getCSServiceVersion", args);
-    }
-
-    public String recv_getCSServiceVersion() throws org.apache.thrift.TException
-    {
-      getCSServiceVersion_result result = new getCSServiceVersion_result();
-      receiveBase(result, "getCSServiceVersion");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCSServiceVersion failed: unknown result");
-    }
-
-    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_addSSHCredential(sshCredential);
-      return recv_addSSHCredential();
-    }
-
-    public void send_addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.thrift.TException
-    {
-      addSSHCredential_args args = new addSSHCredential_args();
-      args.setSshCredential(sshCredential);
-      sendBase("addSSHCredential", args);
-    }
-
-    public String recv_addSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      addSSHCredential_result result = new addSSHCredential_result();
-      receiveBase(result, "addSSHCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addSSHCredential failed: unknown result");
-    }
-
-    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_addCertificateCredential(certificateCredential);
-      return recv_addCertificateCredential();
-    }
-
-    public void send_addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.thrift.TException
-    {
-      addCertificateCredential_args args = new addCertificateCredential_args();
-      args.setCertificateCredential(certificateCredential);
-      sendBase("addCertificateCredential", args);
-    }
-
-    public String recv_addCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      addCertificateCredential_result result = new addCertificateCredential_result();
-      receiveBase(result, "addCertificateCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addCertificateCredential failed: unknown result");
-    }
-
-    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_addPasswordCredential(passwordCredential);
-      return recv_addPasswordCredential();
-    }
-
-    public void send_addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.thrift.TException
-    {
-      addPasswordCredential_args args = new addPasswordCredential_args();
-      args.setPasswordCredential(passwordCredential);
-      sendBase("addPasswordCredential", args);
-    }
-
-    public String recv_addPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      addPasswordCredential_result result = new addPasswordCredential_result();
-      receiveBase(result, "addPasswordCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addPasswordCredential failed: unknown result");
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_getSSHCredential(tokenId, gatewayId);
-      return recv_getSSHCredential();
-    }
-
-    public void send_getSSHCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
-    {
-      getSSHCredential_args args = new getSSHCredential_args();
-      args.setTokenId(tokenId);
-      args.setGatewayId(gatewayId);
-      sendBase("getSSHCredential", args);
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential recv_getSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      getSSHCredential_result result = new getSSHCredential_result();
-      receiveBase(result, "getSSHCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSSHCredential failed: unknown result");
-    }
-
-    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_getCertificateCredential(tokenId, gatewayId);
-      return recv_getCertificateCredential();
-    }
-
-    public void send_getCertificateCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
-    {
-      getCertificateCredential_args args = new getCertificateCredential_args();
-      args.setTokenId(tokenId);
-      args.setGatewayId(gatewayId);
-      sendBase("getCertificateCredential", args);
-    }
-
-    public org.apache.airavata.credential.store.datamodel.CertificateCredential recv_getCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      getCertificateCredential_result result = new getCertificateCredential_result();
-      receiveBase(result, "getCertificateCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCertificateCredential failed: unknown result");
-    }
-
-    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_getPasswordCredential(tokenId, gatewayId);
-      return recv_getPasswordCredential();
-    }
-
-    public void send_getPasswordCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
-    {
-      getPasswordCredential_args args = new getPasswordCredential_args();
-      args.setTokenId(tokenId);
-      args.setGatewayId(gatewayId);
-      sendBase("getPasswordCredential", args);
-    }
-
-    public org.apache.airavata.credential.store.datamodel.PasswordCredential recv_getPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      getPasswordCredential_result result = new getPasswordCredential_result();
-      receiveBase(result, "getPasswordCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPasswordCredential failed: unknown result");
-    }
-
-  }
-  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
-    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
-      private org.apache.thrift.async.TAsyncClientManager clientManager;
-      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
-      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
-        this.clientManager = clientManager;
-        this.protocolFactory = protocolFactory;
-      }
-      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
-        return new AsyncClient(protocolFactory, clientManager, transport);
-      }
-    }
-
-    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
-      super(protocolFactory, clientManager, transport);
-    }
-
-    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getCSServiceVersion_call method_call = new getCSServiceVersion_call(resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getCSServiceVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
-      public getCSServiceVersion_call(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);
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCSServiceVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getCSServiceVersion_args args = new getCSServiceVersion_args();
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getCSServiceVersion();
-      }
-    }
-
-    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      addSSHCredential_call method_call = new addSSHCredential_call(sshCredential, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class addSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential;
-      public addSSHCredential_call(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, 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.sshCredential = sshCredential;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        addSSHCredential_args args = new addSSHCredential_args();
-        args.setSshCredential(sshCredential);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_addSSHCredential();
-      }
-    }
-
-    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      addCertificateCredential_call method_call = new addCertificateCredential_call(certificateCredential, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class addCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential;
-      public addCertificateCredential_call(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, 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.certificateCredential = certificateCredential;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        addCertificateCredential_args args = new addCertificateCredential_args();
-        args.setCertificateCredential(certificateCredential);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_addCertificateCredential();
-      }
-    }
-
-    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      addPasswordCredential_call method_call = new addPasswordCredential_call(passwordCredential, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class addPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential;
-      public addPasswordCredential_call(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, 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.passwordCredential = passwordCredential;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        addPasswordCredential_args args = new addPasswordCredential_args();
-        args.setPasswordCredential(passwordCredential);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_addPasswordCredential();
-      }
-    }
-
-    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getSSHCredential_call method_call = new getSSHCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String tokenId;
-      private String gatewayId;
-      public getSSHCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
-        this.gatewayId = gatewayId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getSSHCredential_args args = new getSSHCredential_args();
-        args.setTokenId(tokenId);
-        args.setGatewayId(gatewayId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.credential.store.datamodel.SSHCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getSSHCredential();
-      }
-    }
-
-    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getCertificateCredential_call method_call = new getCertificateCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String tokenId;
-      private String gatewayId;
-      public getCertificateCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
-        this.gatewayId = gatewayId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getCertificateCredential_args args = new getCertificateCredential_args();
-        args.setTokenId(tokenId);
-        args.setGatewayId(gatewayId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.credential.store.datamodel.CertificateCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getCertificateCredential();
-      }
-    }
-
-    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getPasswordCredential_call method_call = new getPasswordCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String tokenId;
-      private String gatewayId;
-      public getPasswordCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
-        this.gatewayId = gatewayId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getPasswordCredential_args args = new getPasswordCredential_args();
-        args.setTokenId(tokenId);
-        args.setGatewayId(gatewayId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.credential.store.datamodel.PasswordCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getPasswordCredential();
-      }
-    }
-
-  }
-
-  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
-    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
-    public Processor(I iface) {
-      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
-    }
-
-    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
-      super(iface, getProcessMap(processMap));
-    }
-
-    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
-      processMap.put("getCSServiceVersion", new getCSServiceVersion());
-      processMap.put("addSSHCredential", new addSSHCredential());
-      processMap.put("addCertificateCredential", new addCertificateCredential());
-      processMap.put("addPasswordCredential", new addPasswordCredential());
-      processMap.put("getSSHCredential", new getSSHCredential());
-      processMap.put("getCertificateCredential", new getCertificateCredential());
-      processMap.put("getPasswordCredential", new getPasswordCredential());
-      return processMap;
-    }
-
-    public static class getCSServiceVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCSServiceVersion_args> {
-      public getCSServiceVersion() {
-        super("getCSServiceVersion");
-      }
-
-      public getCSServiceVersion_args getEmptyArgsInstance() {
-        return new getCSServiceVersion_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getCSServiceVersion_result getResult(I iface, getCSServiceVersion_args args) throws org.apache.thrift.TException {
-        getCSServiceVersion_result result = new getCSServiceVersion_result();
-        result.success = iface.getCSServiceVersion();
-        return result;
-      }
-    }
-
-    public static class addSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addSSHCredential_args> {
-      public addSSHCredential() {
-        super("addSSHCredential");
-      }
-
-      public addSSHCredential_args getEmptyArgsInstance() {
-        return new addSSHCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public addSSHCredential_result getResult(I iface, addSSHCredential_args args) throws org.apache.thrift.TException {
-        addSSHCredential_result result = new addSSHCredential_result();
-        try {
-          result.success = iface.addSSHCredential(args.sshCredential);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class addCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addCertificateCredential_args> {
-      public addCertificateCredential() {
-        super("addCertificateCredential");
-      }
-
-      public addCertificateCredential_args getEmptyArgsInstance() {
-        return new addCertificateCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public addCertificateCredential_result getResult(I iface, addCertificateCredential_args args) throws org.apache.thrift.TException {
-        addCertificateCredential_result result = new addCertificateCredential_result();
-        try {
-          result.success = iface.addCertificateCredential(args.certificateCredential);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class addPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addPasswordCredential_args> {
-      public addPasswordCredential() {
-        super("addPasswordCredential");
-      }
-
-      public addPasswordCredential_args getEmptyArgsInstance() {
-        return new addPasswordCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public addPasswordCredential_result getResult(I iface, addPasswordCredential_args args) throws org.apache.thrift.TException {
-        addPasswordCredential_result result = new addPasswordCredential_result();
-        try {
-          result.success = iface.addPasswordCredential(args.passwordCredential);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class getSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSSHCredential_args> {
-      public getSSHCredential() {
-        super("getSSHCredential");
-      }
-
-      public getSSHCredential_args getEmptyArgsInstance() {
-        return new getSSHCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getSSHCredential_result getResult(I iface, getSSHCredential_args args) throws org.apache.thrift.TException {
-        getSSHCredential_result result = new getSSHCredential_result();
-        try {
-          result.success = iface.getSSHCredential(args.tokenId, args.gatewayId);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class getCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCertificateCredential_args> {
-      public getCertificateCredential() {
-        super("getCertificateCredential");
-      }
-
-      public getCertificateCredential_args getEmptyArgsInstance() {
-        return new getCertificateCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getCertificateCredential_result getResult(I iface, getCertificateCredential_args args) throws org.apache.thrift.TException {
-        getCertificateCredential_result result = new getCertificateCredential_result();
-        try {
-          result.success = iface.getCertificateCredential(args.tokenId, args.gatewayId);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class getPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPasswordCredential_args> {
-      public getPasswordCredential() {
-        super("getPasswordCredential");
-      }
-
-      public getPasswordCredential_args getEmptyArgsInstance() {
-        return new getPasswordCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getPasswordCredential_result getResult(I iface, getPasswordCredential_args args) throws org.apache.thrift.TException {
-        getPasswordCredential_result result = new getPasswordCredential_result();
-        try {
-          result.success = iface.getPasswordCredential(args.tokenId, args.gatewayId);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-  }
-
-  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
-    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
-    public AsyncProcessor(I iface) {
-      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
-    }
-
-    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
-      super(iface, getProcessMap(processMap));
-    }
-
-    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
-      processMap.put("getCSServiceVersion", new getCSServiceVersion());
-      processMap.put("addSSHCredential", new addSSHCredential());
-      processMap.put("addCertificateCredential", new addCertificateCredential());
-      processMap.put("addPasswordCredential", new addPasswordCredential());
-      processMap.put("getSSHCredential", new getSSHCredential());
-      processMap.put("getCertificateCredential", new getCertificateCredential());
-      processMap.put("getPasswordCredential", new getPasswordCredential());
-      return processMap;
-    }
-
-    public static class getCSServiceVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCSServiceVersion_args, String> {
-      public getCSServiceVersion() {
-        super("getCSServiceVersion");
-      }
-
-      public getCSServiceVersion_args getEmptyArgsInstance() {
-        return new getCSServiceVersion_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            getCSServiceVersion_result result = new getCSServiceVersion_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getCSServiceVersion_result result = new getCSServiceVersion_result();
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getCSServiceVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.getCSServiceVersion(resultHandler);
-      }
-    }
-
-    public static class addSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addSSHCredential_args, String> {
-      public addSSHCredential() {
-        super("addSSHCredential");
-      }
-
-      public addSSHCredential_args getEmptyArgsInstance() {
-        return new addSSHCredential_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            addSSHCredential_result result = new addSSHCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            addSSHCredential_result result = new addSSHCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, addSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.addSSHCredential(args.sshCredential,resultHandler);
-      }
-    }
-
-    public static class addCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addCertificateCredential_args, String> {
-      public addCertificateCredential() {
-        super("addCertificateCredential");
-      }
-
-      public addCertificateCredential_args getEmptyArgsInstance() {
-        return new addCertificateCredential_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            addCertificateCredential_result result = new addCertificateCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            addCertificateCredential_result result = new addCertificateCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, addCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.addCertificateCredential(args.certificateCredential,resultHandler);
-      }
-    }
-
-    public static class addPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addPasswordCredential_args, String> {
-      public addPasswordCredential() {
-        super("addPasswordCredential");
-      }
-
-      public addPasswordCredential_args getEmptyArgsInstance() {
-        return new addPasswordCredential_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            addPasswordCredential_result result = new addPasswordCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            addPasswordCredential_result result = new addPasswordCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, addPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.addPasswordCredential(args.passwordCredential,resultHandler);
-      }
-    }
-
-    public static class getSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSSHCredential_args, org.apache.airavata.credential.store.datamodel.SSHCredential> {
-      public getSSHCredential() {
-        super("getSSHCredential");
-      }
-
-      public getSSHCredential_args getEmptyArgsInstance() {
-        return new getSSHCredential_args();
-      }
-
-      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential>() { 
-          public void onComplete(org.apache.airavata.credential.store.datamodel.SSHCredential o) {
-            getSSHCredential_result result = new getSSHCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getSSHCredential_result result = new getSSHCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> resultHandler) throws TException {
-        iface.getSSHCredential(args.tokenId, args.gatewayId,resultHandler);
-      }
-    }
-
-    public static class getCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCertificateCredential_args, org.apache.airavata.credential.store.datamodel.CertificateCredential> {
-      public getCertificateCredential() {
-        super("getCertificateCredential");
-      }
-
-      public getCertificateCredential_args getEmptyArgsInstance() {
-        return new getCertificateCredential_args();
-      }
-
-      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential>() { 
-          public void onComplete(org.apache.airavata.credential.store.datamodel.CertificateCredential o) {
-            getCertificateCredential_result result = new getCertificateCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getCertificateCredential_result result = new getCertificateCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> resultHandler) throws TException {
-        iface.getCertificateCredential(args.tokenId, args.gatewayId,resultHandler);
-      }
-    }
-
-    public static class getPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPasswordCredential_args, org.apache.airavata.credential.store.datamodel.PasswordCredential> {
-      public getPasswordCredential() {
-        super("getPasswordCredential");
-      }
-
-      public getPasswordCredential_args getEmptyArgsInstance() {
-        return new getPasswordCredential_args();
-      }
-
-      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential>() { 
-          public void onComplete(org.apache.airavata.credential.store.datamodel.PasswordCredential o) {
-            getPasswordCredential_result result = new getPasswordCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getPasswordCredential_result result = new getPasswordCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> resultHandler) throws TException {
-        iface.getPasswordCredential(args.tokenId, args.gatewayId,resultHandler);
-      }
-    }
-
-  }
-
-  public static class getCSServiceVersion_args implements org.apache.thrift.TBase<getCSServiceVersion_args, getCSServiceVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_args");
-
-
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-    static {
-      schemes.put(StandardScheme.class, new getCSServiceVersion_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getCSServiceVersion_argsTupleSchemeFactory());
-    }
-
-
-    /** 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 {
-;
-
-      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-      static {
-        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-          byName.put(field.getFieldName(), field);
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, or null if its not found.
-       */
-      public static _Fields findByThriftId(int fieldId) {
-        switch(fieldId) {
-          default:
-            return null;
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, throwing an exception
-       * if it is not found.
-       */
-      public static _Fields findByThriftIdOrThrow(int fieldId) {
-        _Fields fields = findByThriftId(fieldId);
-        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-        return fields;
-      }
-
-      /**
-       * Find the _Fields constant that matches name, or null if its not found.
-       */
-      public static _Fields findByName(String name) {
-        return byName.get(name);
-      }
-
-      private final short _thriftId;
-      private final String _fieldName;
-
-      _Fields(short thriftId, String fieldName) {
-        _thriftId = thriftId;
-        _fieldName = fieldName;
-      }
-
-      public short getThriftFieldId() {
-        return _thriftId;
-      }
-
-      public String getFieldName() {
-        return _fieldName;
-      }
-    }
-    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-    static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_args.class, metaDataMap);
-    }
-
-    public getCSServiceVersion_args() {
-    }
-
-    /**
-     * Performs a deep copy on <i>other</i>.
-     */
-    public getCSServiceVersion_args(getCSServiceVersion_args other) {
-    }
-
-    public getCSServiceVersion_args deepCopy() {
-      return new getCSServiceVersion_args(this);
-    }
-
-    @Override
-    public void clear() {
-    }
-
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      }
-      throw new IllegalStateException();
-    }
-
-    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-    public boolean isSet(_Fields field) {
-      if (field == null) {
-        throw new IllegalArgumentException();
-      }
-
-      switch (field) {
-      }
-      throw new IllegalStateException();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof getCSServiceVersion_args)
-        return this.equals((getCSServiceVersion_args)that);
-      return false;
-    }
-
-    public boolean equals(getCSServiceVersion_args that) {
-      if (that == null)
-        return false;
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      return 0;
-    }
-
-    @Override
-    public int compareTo(getCSServiceVersion_args other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
-
-      int lastComparison = 0;
-
-      return 0;
-    }
-
-    public _Fields fieldForId(int fieldId) {
-      return _Fields.findByThriftId(fieldId);
-    }
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-    }
-
-    @Override
-    public String toString() {
-      StringBuilder sb = new StringBuilder("getCSServiceVersion_args(");
-      boolean first = true;
-
-      sb.append(")");
-      return sb.toString();
-    }
-
-    public void validate() throws org.apache.thrift.TException {
-      // check for required fields
-      // check for sub-struct validity
-    }
-
-    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-      try {
-        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-      try {
-        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private static class getCSServiceVersion_argsStandardSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_argsStandardScheme getScheme() {
-        return new getCSServiceVersion_argsStandardScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_argsStandardScheme extends StandardScheme<getCSServiceVersion_args> {
-
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        org.apache.thrift.protocol.TField schemeField;
-        iprot.readStructBegin();
-        while (true)
-        {
-          schemeField = iprot.readFieldBegin();
-          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-            break;
-          }
-          switch (schemeField.id) {
-            default:
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-          }
-          iprot.readFieldEnd();
-        }
-        iprot.readStructEnd();
-
-        // check for required fields of primitive type, which can't be checked in the validate method
-        struct.validate();
-      }
-
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        struct.validate();
-
-        oprot.writeStructBegin(STRUCT_DESC);
-        oprot.writeFieldStop();
-        oprot.writeStructEnd();
-      }
-
-    }
-
-    private static class getCSServiceVersion_argsTupleSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_argsTupleScheme getScheme() {
-        return new getCSServiceVersion_argsTupleScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_argsTupleScheme extends TupleScheme<getCSServiceVersion_args> {
-
-      @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        TTupleProtocol oprot = (TTupleProtocol) prot;
-      }
-
-      @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        TTupleProtocol iprot = (TTupleProtocol) prot;
-      }
-    }
-
-  }
-
-  public static class getCSServiceVersion_result implements org.apache.thrift.TBase<getCSServiceVersion_result, getCSServiceVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_result");
-
-    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
-
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-    static {
-      schemes.put(StandardScheme.class, new getCSServiceVersion_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getCSServiceVersion_resultTupleSchemeFactory());
-    }
-
-    public String success; // 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 {
-      SUCCESS((short)0, "success");
-
-      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-      static {
-        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-          byName.put(field.getFieldName(), field);
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, or null if its not found.
-       */
-      public static _Fields findByThriftId(int fieldId) {
-        switch(fieldId) {
-          case 0: // SUCCESS
-            return SUCCESS;
-          default:
-            return null;
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, throwing an exception
-       * if it is not found.
-       */
-      public static _Fields findByThriftIdOrThrow(int fieldId) {
-        _Fields fields = findByThriftId(fieldId);
-        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-        return fields;
-      }
-
-      /**
-       * Find the _Fields constant that matches name, or null if its not found.
-       */
-      public static _Fields findByName(String name) {
-        return byName.get(name);
-      }
-
-      private final short _thriftId;
-      private final String _fieldName;
-
-      _Fields(short thriftId, String fieldName) {
-        _thriftId = thriftId;
-        _fieldName = fieldName;
-      }
-
-      public short getThriftFieldId() {
-        return _thriftId;
-      }
-
-      public String getFieldName() {
-        return _fieldName;
-      }
-    }
-
-    // isset id assignments
-    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-    static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-      metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_result.class, metaDataMap);
-    }
-
-    public getCSServiceVersion_result() {
-    }
-
-    public getCSServiceVersion_result(
-      String success)
-    {
-      this();
-      this.success = success;
-    }
-
-    /**
-     * Performs a deep copy on <i>other</i>.
-     */
-    public getCSServiceVersion_result(getCSServiceVersion_result other) {
-      if (other.isSetSuccess()) {
-        this.success = other.success;
-      }
-    }
-
-    public getCSServiceVersion_result deepCopy() {
-      return new getCSServiceVersion_result(this);
-    }
-
-    @Override
-    public void clear() {
-      this.success = null;
-    }
-
-    public String getSuccess() {
-      return this.success;
-    }
-
-    public getCSServiceVersion_result setSuccess(String success) {
-      this.success = success;
-      return this;
-    }
-
-    public void unsetSuccess() {
-      this.success = null;
-    }
-
-    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-    public boolean isSetSuccess() {
-      return this.success != null;
-    }
-
-    public void setSuccessIsSet(boolean value) {
-      if (!value) {
-        this.success = null;
-      }
-    }
-
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      case SUCCESS:
-        if (value == null) {
-          unsetSuccess();
-        } else {
-          setSuccess((String)value);
-        }
-        break;
-
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      case SUCCESS:
-        return getSuccess();
-
-      }
-      throw new IllegalStateException();
-    }
-
-    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-    public boolean isSet(_Fields field) {
-      if (field == null) {
-        throw new IllegalArgumentException();
-      }
-
-      switch (field) {
-      case SUCCESS:
-        return isSetSuccess();
-      }
-      throw new IllegalStateException();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof getCSServiceVersion_result)
-        return this.equals((getCSServiceVersion_result)that);
-      return false;
-    }
-
-    public boolean equals(getCSServiceVersion_result that) {
-      if (that == null)
-        return false;
-
-      boolean this_present_success = true && this.isSetSuccess();
-      boolean that_present_success = true && that.isSetSuccess();
-      if (this_present_success || that_present_success) {
-        if (!(this_present_success && that_present_success))
-          return false;
-        if (!this.success.equals(that.success))
-          return false;
-      }
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      return 0;
-    }
-
-    @Override
-    public int compareTo(getCSServiceVersion_result other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
-
-      int lastComparison = 0;
-
-      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetSuccess()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
-      return 0;
-    }
-
-    public _Fields fieldForId(int fieldId) {
-      return _Fields.findByThriftId(fieldId);
-    }
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-      }
-
-    @Override
-    public String toString() {
-      StringBuilder sb = new StringBuilder("getCSServiceVersion_result(");
-      boolean first = true;
-
-      sb.append("success:");
-      if (this.success == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.success);
-      }
-      first = false;
-      sb.append(")");
-      return sb.toString();
-    }
-
-    public void validate() throws org.apache.thrift.TException {
-      // check for required fields
-      // check for sub-struct validity
-    }
-
-    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-      try {
-        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-      try {
-        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private static class getCSServiceVersion_resultStandardSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_resultStandardScheme getScheme() {
-        return new getCSServiceVersion_resultStandardScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_resultStandardScheme extends StandardScheme<getCSServiceVersion_result> {
-
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        org.apache.thrift.protocol.TField schemeField;
-        iprot.readStructBegin();
-        while (true)
-        {
-          schemeField = iprot.readFieldBegin();
-          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-            break;
-          }
-          switch (schemeField.id) {
-            case 0: // SUCCESS
-              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-                struct.success = iprot.readString();
-                struct.setSuccessIsSet(true);
-              } else { 
-                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-              }
-              break;
-            default:
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-          }
-          iprot.readFieldEnd();
-        }
-        iprot.readStructEnd();
-
-        // check for required fields of primitive type, which can't be checked in the validate method
-        struct.validate();
-      }
-
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        struct.validate();
-
-        oprot.writeStructBegin(STRUCT_DESC);
-        if (struct.success != null) {
-          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-          oprot.writeString(struct.success);
-          oprot.writeFieldEnd();
-        }
-        oprot.writeFieldStop();
-        oprot.writeStructEnd();
-      }
-
-    }
-
-    private static class getCSServiceVersion_resultTupleSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_resultTupleScheme getScheme() {
-        return new getCSServiceVersion_resultTupleScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_resultTupleScheme extends TupleScheme<getCSServiceVersion_result> {
-
-      @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        TTupleProtocol oprot = (TTupleProtocol) prot;
-        BitSet optionals = new BitSet();
-        if (struct.isSetSuccess()) {
-          optionals.set(0);
-        }
-        oprot.writeBitSet(optionals, 1);
-        if (struct.isSetSuccess()) {
-          oprot.writeString(struct.success);
-        }
-      }
-
-      @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(1);
-        if (incoming.get(0)) {
-          struct.success = iprot.readString();
-          struct.setSuccessIsSet(true);
-        }
-      }
-    }
-
-  }
-
-  public static class addSSHCredential_args implements org.apache.thrift.TBase<addSSHCredential_args, addSSHCredential_args._Fields>, java.io.Serializable, Cloneable, Comparable<addSSHCredential_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSSHCredential_args");
-
-    private static final org.apache.thrift.protocol.TField SSH_CREDENTIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("sshCredential", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-    static {
-      schemes.put(StandardScheme.class, new addSSHCredential_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new addSSHCredential_argsTupleSchemeFactory());
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential; // 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 {
-      SSH_CREDENTIAL((short)1, "sshCredential");
-
-      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-      static {
-        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-          byName.put(field.getFieldName(), field);
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, or null if its not found.
-       */
-      public static _Fields findByThriftId(int fieldId) {
-        switch(fieldId) {
-          case 1: // SSH_CREDENTIAL
-            return SSH_CREDENTIAL;
-          default:
-            return null;
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, throwing an exception
-       * if it is not found.
-       */
-      public static _Fields findByThriftIdOrThrow(int fieldId) {
-        _Fields fields = findByThriftId(fieldId);
-        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-        return fields;
-      }
-
-      /**
-       * Find the _Fields constant that matches name, or null if its not found.
-       */
-      public static _Fields findByName(String name) {
-        return byName.get(name);
-      }
-
-      private final short _thriftId;
-      private final String _fieldName;
-
-      _Fields(short thriftId, String fieldName) {
-        _thriftId = thriftId;
-        _fieldName = fieldName;
-      }
-
-      public short getThriftFieldId() {
-        return _thriftId;
-      }
-
-      public String getFieldName() {
-        return _fieldName;
-      }
-    }
-
-    // isset id assignments
-    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-    static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      tmpMap.put(_Fields.SSH_CREDENTIAL, new org.apache.thrift.meta_data.FieldMetaData("sshCredential", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.credential.store.datamodel.SSHCredential.class)));
-      metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addSSHCredential_args.class, metaDataMap);
-    }
-
-    public addSSHCredential_args() {
-    }
-
-    public addSSHCredential_args(
-      org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential)
-    {
-      this();
-      this.sshCredential = sshCredential;
-    }
-
-    /**
-     * Performs a deep copy on <i>other</i>.
-     */
-    public addSSHCredential_args(addSSHCredential_args other) {
-      if (other.isSetSshCredential()) {
-        this.sshCredential = new org.apache.airavata.credential.store.datamodel.SSHCredential(other.sshCredential);
-      }
-    }
-
-    public addSSHCredential_args deepCopy() {
-      return new addSSHCredential_args(this);
-    }
-
-    @Override
-    public void clear() {
-      this.sshCredential = null;
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential getSshCredential() {
-      return this.sshCredential;
-    }
-
-    public addSSHCredential_args setSshCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) {
-      this.sshCredential = sshCredential;
-      return this;
-    }
-
-    public void unsetSshCredential() {
-      this.sshCredential = null;
-    }
-
-    /** Returns true if field sshCredential is set (has been assigned a value) and false otherwise */
-    public boolean isSetSshCredential() {
-      return this.sshCredential != null;
-    }
-
-    public void setSshCredentialIsSet(boolean value) {
-      if (!value) {
-        this.sshCredential = null;
-      }
-    }
-
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      case SSH_CREDENTIAL:
-        if (value == null) {
-          unsetSshCredential();
-        } else {
-          setSshCredential((org.apache.airavata.credential.store.datamodel.SSHCredential)value);
-        }
-        break;
-
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      case SSH_CREDENTIAL:
-        return getSshCredential();
-
-      }
-      throw new IllegalStateException();
-    }
-
-    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-    public boolean isSet(_Fields field) {
-      if (field == null) {
-        throw new IllegalArgumentException();
-      }
-
-      switch (field) {
-      case SSH_CREDENTIAL:
-        return isSetSshCredential();
-      }
-      throw new IllegalStateException();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof addSSHCredential_args)
-        return this.equals((addSSHCredential_args)that);
-      return false;
-    }
-
-    public boolean equals(addSSHCredential_args that) {
-      if (that == null)
-        return false;
-
-      boolean this_present_sshCredential = true && this.isSetSshCredential();
-      boolean that_present_sshCredential = true && that.isSetSshCredential();
-      if (this_present_sshCredential || that_present_sshCredential) {
-        if (!(this_present_sshCredential && that_present_sshCredential))
-          return false;
-        if (!this.sshCredential.equals(that.sshCredential))
-          return false;
-      }
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      return 0;
-    }
-
-    @Override
-    public int compareTo(addSSHCredential_args other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
-
-      int lastComparison = 0;
-
-      lastComparison = Boolean.valueOf(isSetSshCredential()).compareTo(other.isSetSshCredential());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetSshCredential()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sshCredential, other.sshCredential);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
-      return 0;
-    }
-
-    public _Fields fieldForId(int fieldId) {
-      return _Fields.findByThriftId(fieldId);
-    }
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-    }
-
-    @Override
-    public String toString() {
-      StringBuilder sb = new StringBuilder("addSSHCredential_args(");
-      boolean first = true;
-
-      sb.append("sshCredential:");
-      if (this.sshCredential == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.sshCredential);
-      }
-      first = false;
-      sb.append(")");
-      return sb.toString();
-    }
-
-    public void validate() throws org.apache.thrift.TException {
-      // check for required fields
-      if (sshCredential == null) {
-        throw new org.apache.thrift.protocol.TProtocolException("Required field 'sshCredential' was not present! Struct: " + toString());
-      }
-      // check for sub-struct validity
-      if (sshCredential != null) {
-        sshCredential.validate();
-      }
-    }
-
-    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-      try {
-        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    p

<TRUNCATED>

[48/62] [abbrv] airavata git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata

Posted by la...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: f31637e8c10559ca070a49036e69776b43cb2333
Parents: 674db3c 13b480d
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Wed Mar 11 18:07:12 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Wed Mar 11 18:07:12 2015 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 630 ++++++-------------
 .../tools/RegisterSampleApplications.java       | 180 +++++-
 .../server/src/main/resources/LSFTemplate.xslt  |   3 +-
 .../gfac/ssh/provider/impl/SSHProvider.java     |   1 +
 .../gsissh/src/main/resources/LSFTemplate.xslt  |   2 +-
 5 files changed, 371 insertions(+), 445 deletions(-)
----------------------------------------------------------------------



[37/62] [abbrv] airavata git commit: generated thrift files

Posted by la...@apache.org.
generated thrift files

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/7883eb97
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/7883eb97
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/7883eb97

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 7883eb971f8c468698a15bd7c7317c14530efaa7
Parents: 8d3b137
Author: msmemon <sh...@gmail.com>
Authored: Tue Mar 10 16:52:24 2015 +0100
Committer: msmemon <sh...@gmail.com>
Committed: Tue Mar 10 16:52:24 2015 +0100

----------------------------------------------------------------------
 .../lib/airavata/computeResourceModel_types.cpp | 203 ++++++++++-------
 .../lib/airavata/computeResourceModel_types.h   |  38 +++-
 .../Model/AppCatalog/ComputeResource/Types.php  |  49 ++++
 .../computeresource/UnicoreJobSubmission.java   | 222 ++++++++++++++++++-
 .../computeResourceModel.thrift                 |  26 ++-
 5 files changed, 441 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/7883eb97/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
index d54c519..4d52172 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
@@ -137,6 +137,16 @@ const char* _kDataMovementProtocolNames[] = {
 };
 const std::map<int, const char*> _DataMovementProtocol_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kDataMovementProtocolValues, _kDataMovementProtocolNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
 
+int _kAuthenticationModeValues[] = {
+  AuthenticationMode::SERVER_ISSUED,
+  AuthenticationMode::MYPROXY_ISSUED
+};
+const char* _kAuthenticationModeNames[] = {
+  "SERVER_ISSUED",
+  "MYPROXY_ISSUED"
+};
+const std::map<int, const char*> _AuthenticationMode_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kAuthenticationModeValues, _kAuthenticationModeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
 int _kProviderNameValues[] = {
   ProviderName::EC2,
   ProviderName::AWSEC2,
@@ -1180,8 +1190,8 @@ void swap(GlobusJobSubmission &a, GlobusJobSubmission &b) {
   swap(a.__isset, b.__isset);
 }
 
-const char* UnicoreJobSubmission::ascii_fingerprint = "D9F4CFE2F293A8B1052FD3031DD2C847";
-const uint8_t UnicoreJobSubmission::binary_fingerprint[16] = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47};
+const char* UnicoreJobSubmission::ascii_fingerprint = "06B870319715692996F28828C4AF836C";
+const uint8_t UnicoreJobSubmission::binary_fingerprint[16] = {0x06,0xB8,0x70,0x31,0x97,0x15,0x69,0x29,0x96,0xF2,0x88,0x28,0xC4,0xAF,0x83,0x6C};
 
 uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -1197,6 +1207,7 @@ uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot
   bool isset_jobSubmissionInterfaceId = false;
   bool isset_securityProtocol = false;
   bool isset_unicoreEndPointURL = false;
+  bool isset_authenticationMode = false;
 
   while (true)
   {
@@ -1232,6 +1243,24 @@ uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot
           xfer += iprot->skip(ftype);
         }
         break;
+      case 4:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          int32_t ecast29;
+          xfer += iprot->readI32(ecast29);
+          this->authenticationMode = (AuthenticationMode::type)ecast29;
+          isset_authenticationMode = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 5:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->userDN);
+          this->__isset.userDN = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -1247,6 +1276,8 @@ uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot
     throw TProtocolException(TProtocolException::INVALID_DATA);
   if (!isset_unicoreEndPointURL)
     throw TProtocolException(TProtocolException::INVALID_DATA);
+  if (!isset_authenticationMode)
+    throw TProtocolException(TProtocolException::INVALID_DATA);
   return xfer;
 }
 
@@ -1266,6 +1297,15 @@ uint32_t UnicoreJobSubmission::write(::apache::thrift::protocol::TProtocol* opro
   xfer += oprot->writeString(this->unicoreEndPointURL);
   xfer += oprot->writeFieldEnd();
 
+  xfer += oprot->writeFieldBegin("authenticationMode", ::apache::thrift::protocol::T_I32, 4);
+  xfer += oprot->writeI32((int32_t)this->authenticationMode);
+  xfer += oprot->writeFieldEnd();
+
+  if (this->__isset.userDN) {
+    xfer += oprot->writeFieldBegin("userDN", ::apache::thrift::protocol::T_STRING, 5);
+    xfer += oprot->writeString(this->userDN);
+    xfer += oprot->writeFieldEnd();
+  }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
   return xfer;
@@ -1276,6 +1316,9 @@ void swap(UnicoreJobSubmission &a, UnicoreJobSubmission &b) {
   swap(a.jobSubmissionInterfaceId, b.jobSubmissionInterfaceId);
   swap(a.securityProtocol, b.securityProtocol);
   swap(a.unicoreEndPointURL, b.unicoreEndPointURL);
+  swap(a.authenticationMode, b.authenticationMode);
+  swap(a.userDN, b.userDN);
+  swap(a.__isset, b.__isset);
 }
 
 const char* CloudJobSubmission::ascii_fingerprint = "F98AE2E6E51F2426504F2566EB71B5CC";
@@ -1317,9 +1360,9 @@ uint32_t CloudJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot)
         break;
       case 2:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast29;
-          xfer += iprot->readI32(ecast29);
-          this->securityProtocol = (SecurityProtocol::type)ecast29;
+          int32_t ecast30;
+          xfer += iprot->readI32(ecast30);
+          this->securityProtocol = (SecurityProtocol::type)ecast30;
           isset_securityProtocol = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1343,9 +1386,9 @@ uint32_t CloudJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot)
         break;
       case 5:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast30;
-          xfer += iprot->readI32(ecast30);
-          this->providerName = (ProviderName::type)ecast30;
+          int32_t ecast31;
+          xfer += iprot->readI32(ecast31);
+          this->providerName = (ProviderName::type)ecast31;
           isset_providerName = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1462,9 +1505,9 @@ uint32_t JobSubmissionInterface::read(::apache::thrift::protocol::TProtocol* ipr
         break;
       case 2:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast31;
-          xfer += iprot->readI32(ecast31);
-          this->jobSubmissionProtocol = (JobSubmissionProtocol::type)ecast31;
+          int32_t ecast32;
+          xfer += iprot->readI32(ecast32);
+          this->jobSubmissionProtocol = (JobSubmissionProtocol::type)ecast32;
           isset_jobSubmissionProtocol = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1560,9 +1603,9 @@ uint32_t DataMovementInterface::read(::apache::thrift::protocol::TProtocol* ipro
         break;
       case 2:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast32;
-          xfer += iprot->readI32(ecast32);
-          this->dataMovementProtocol = (DataMovementProtocol::type)ecast32;
+          int32_t ecast33;
+          xfer += iprot->readI32(ecast33);
+          this->dataMovementProtocol = (DataMovementProtocol::type)ecast33;
           isset_dataMovementProtocol = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1667,14 +1710,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->hostAliases.clear();
-            uint32_t _size33;
-            ::apache::thrift::protocol::TType _etype36;
-            xfer += iprot->readListBegin(_etype36, _size33);
-            this->hostAliases.resize(_size33);
-            uint32_t _i37;
-            for (_i37 = 0; _i37 < _size33; ++_i37)
+            uint32_t _size34;
+            ::apache::thrift::protocol::TType _etype37;
+            xfer += iprot->readListBegin(_etype37, _size34);
+            this->hostAliases.resize(_size34);
+            uint32_t _i38;
+            for (_i38 = 0; _i38 < _size34; ++_i38)
             {
-              xfer += iprot->readString(this->hostAliases[_i37]);
+              xfer += iprot->readString(this->hostAliases[_i38]);
             }
             xfer += iprot->readListEnd();
           }
@@ -1687,14 +1730,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->ipAddresses.clear();
-            uint32_t _size38;
-            ::apache::thrift::protocol::TType _etype41;
-            xfer += iprot->readListBegin(_etype41, _size38);
-            this->ipAddresses.resize(_size38);
-            uint32_t _i42;
-            for (_i42 = 0; _i42 < _size38; ++_i42)
+            uint32_t _size39;
+            ::apache::thrift::protocol::TType _etype42;
+            xfer += iprot->readListBegin(_etype42, _size39);
+            this->ipAddresses.resize(_size39);
+            uint32_t _i43;
+            for (_i43 = 0; _i43 < _size39; ++_i43)
             {
-              xfer += iprot->readString(this->ipAddresses[_i42]);
+              xfer += iprot->readString(this->ipAddresses[_i43]);
             }
             xfer += iprot->readListEnd();
           }
@@ -1715,14 +1758,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->batchQueues.clear();
-            uint32_t _size43;
-            ::apache::thrift::protocol::TType _etype46;
-            xfer += iprot->readListBegin(_etype46, _size43);
-            this->batchQueues.resize(_size43);
-            uint32_t _i47;
-            for (_i47 = 0; _i47 < _size43; ++_i47)
+            uint32_t _size44;
+            ::apache::thrift::protocol::TType _etype47;
+            xfer += iprot->readListBegin(_etype47, _size44);
+            this->batchQueues.resize(_size44);
+            uint32_t _i48;
+            for (_i48 = 0; _i48 < _size44; ++_i48)
             {
-              xfer += this->batchQueues[_i47].read(iprot);
+              xfer += this->batchQueues[_i48].read(iprot);
             }
             xfer += iprot->readListEnd();
           }
@@ -1735,19 +1778,19 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_MAP) {
           {
             this->fileSystems.clear();
-            uint32_t _size48;
-            ::apache::thrift::protocol::TType _ktype49;
-            ::apache::thrift::protocol::TType _vtype50;
-            xfer += iprot->readMapBegin(_ktype49, _vtype50, _size48);
-            uint32_t _i52;
-            for (_i52 = 0; _i52 < _size48; ++_i52)
+            uint32_t _size49;
+            ::apache::thrift::protocol::TType _ktype50;
+            ::apache::thrift::protocol::TType _vtype51;
+            xfer += iprot->readMapBegin(_ktype50, _vtype51, _size49);
+            uint32_t _i53;
+            for (_i53 = 0; _i53 < _size49; ++_i53)
             {
-              FileSystems::type _key53;
-              int32_t ecast55;
-              xfer += iprot->readI32(ecast55);
-              _key53 = (FileSystems::type)ecast55;
-              std::string& _val54 = this->fileSystems[_key53];
-              xfer += iprot->readString(_val54);
+              FileSystems::type _key54;
+              int32_t ecast56;
+              xfer += iprot->readI32(ecast56);
+              _key54 = (FileSystems::type)ecast56;
+              std::string& _val55 = this->fileSystems[_key54];
+              xfer += iprot->readString(_val55);
             }
             xfer += iprot->readMapEnd();
           }
@@ -1760,14 +1803,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->jobSubmissionInterfaces.clear();
-            uint32_t _size56;
-            ::apache::thrift::protocol::TType _etype59;
-            xfer += iprot->readListBegin(_etype59, _size56);
-            this->jobSubmissionInterfaces.resize(_size56);
-            uint32_t _i60;
-            for (_i60 = 0; _i60 < _size56; ++_i60)
+            uint32_t _size57;
+            ::apache::thrift::protocol::TType _etype60;
+            xfer += iprot->readListBegin(_etype60, _size57);
+            this->jobSubmissionInterfaces.resize(_size57);
+            uint32_t _i61;
+            for (_i61 = 0; _i61 < _size57; ++_i61)
             {
-              xfer += this->jobSubmissionInterfaces[_i60].read(iprot);
+              xfer += this->jobSubmissionInterfaces[_i61].read(iprot);
             }
             xfer += iprot->readListEnd();
           }
@@ -1780,14 +1823,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->dataMovementInterfaces.clear();
-            uint32_t _size61;
-            ::apache::thrift::protocol::TType _etype64;
-            xfer += iprot->readListBegin(_etype64, _size61);
-            this->dataMovementInterfaces.resize(_size61);
-            uint32_t _i65;
-            for (_i65 = 0; _i65 < _size61; ++_i65)
+            uint32_t _size62;
+            ::apache::thrift::protocol::TType _etype65;
+            xfer += iprot->readListBegin(_etype65, _size62);
+            this->dataMovementInterfaces.resize(_size62);
+            uint32_t _i66;
+            for (_i66 = 0; _i66 < _size62; ++_i66)
             {
-              xfer += this->dataMovementInterfaces[_i65].read(iprot);
+              xfer += this->dataMovementInterfaces[_i66].read(iprot);
             }
             xfer += iprot->readListEnd();
           }
@@ -1836,10 +1879,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("hostAliases", ::apache::thrift::protocol::T_LIST, 3);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->hostAliases.size()));
-      std::vector<std::string> ::const_iterator _iter66;
-      for (_iter66 = this->hostAliases.begin(); _iter66 != this->hostAliases.end(); ++_iter66)
+      std::vector<std::string> ::const_iterator _iter67;
+      for (_iter67 = this->hostAliases.begin(); _iter67 != this->hostAliases.end(); ++_iter67)
       {
-        xfer += oprot->writeString((*_iter66));
+        xfer += oprot->writeString((*_iter67));
       }
       xfer += oprot->writeListEnd();
     }
@@ -1849,10 +1892,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("ipAddresses", ::apache::thrift::protocol::T_LIST, 4);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->ipAddresses.size()));
-      std::vector<std::string> ::const_iterator _iter67;
-      for (_iter67 = this->ipAddresses.begin(); _iter67 != this->ipAddresses.end(); ++_iter67)
+      std::vector<std::string> ::const_iterator _iter68;
+      for (_iter68 = this->ipAddresses.begin(); _iter68 != this->ipAddresses.end(); ++_iter68)
       {
-        xfer += oprot->writeString((*_iter67));
+        xfer += oprot->writeString((*_iter68));
       }
       xfer += oprot->writeListEnd();
     }
@@ -1867,10 +1910,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("batchQueues", ::apache::thrift::protocol::T_LIST, 6);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->batchQueues.size()));
-      std::vector<BatchQueue> ::const_iterator _iter68;
-      for (_iter68 = this->batchQueues.begin(); _iter68 != this->batchQueues.end(); ++_iter68)
+      std::vector<BatchQueue> ::const_iterator _iter69;
+      for (_iter69 = this->batchQueues.begin(); _iter69 != this->batchQueues.end(); ++_iter69)
       {
-        xfer += (*_iter68).write(oprot);
+        xfer += (*_iter69).write(oprot);
       }
       xfer += oprot->writeListEnd();
     }
@@ -1880,11 +1923,11 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("fileSystems", ::apache::thrift::protocol::T_MAP, 7);
     {
       xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_I32, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->fileSystems.size()));
-      std::map<FileSystems::type, std::string> ::const_iterator _iter69;
-      for (_iter69 = this->fileSystems.begin(); _iter69 != this->fileSystems.end(); ++_iter69)
+      std::map<FileSystems::type, std::string> ::const_iterator _iter70;
+      for (_iter70 = this->fileSystems.begin(); _iter70 != this->fileSystems.end(); ++_iter70)
       {
-        xfer += oprot->writeI32((int32_t)_iter69->first);
-        xfer += oprot->writeString(_iter69->second);
+        xfer += oprot->writeI32((int32_t)_iter70->first);
+        xfer += oprot->writeString(_iter70->second);
       }
       xfer += oprot->writeMapEnd();
     }
@@ -1894,10 +1937,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("jobSubmissionInterfaces", ::apache::thrift::protocol::T_LIST, 8);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->jobSubmissionInterfaces.size()));
-      std::vector<JobSubmissionInterface> ::const_iterator _iter70;
-      for (_iter70 = this->jobSubmissionInterfaces.begin(); _iter70 != this->jobSubmissionInterfaces.end(); ++_iter70)
+      std::vector<JobSubmissionInterface> ::const_iterator _iter71;
+      for (_iter71 = this->jobSubmissionInterfaces.begin(); _iter71 != this->jobSubmissionInterfaces.end(); ++_iter71)
       {
-        xfer += (*_iter70).write(oprot);
+        xfer += (*_iter71).write(oprot);
       }
       xfer += oprot->writeListEnd();
     }
@@ -1907,10 +1950,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("dataMovementInterfaces", ::apache::thrift::protocol::T_LIST, 9);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->dataMovementInterfaces.size()));
-      std::vector<DataMovementInterface> ::const_iterator _iter71;
-      for (_iter71 = this->dataMovementInterfaces.begin(); _iter71 != this->dataMovementInterfaces.end(); ++_iter71)
+      std::vector<DataMovementInterface> ::const_iterator _iter72;
+      for (_iter72 = this->dataMovementInterfaces.begin(); _iter72 != this->dataMovementInterfaces.end(); ++_iter72)
       {
-        xfer += (*_iter71).write(oprot);
+        xfer += (*_iter72).write(oprot);
       }
       xfer += oprot->writeListEnd();
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/7883eb97/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
index 76037b2..b1b70d5 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
@@ -117,6 +117,15 @@ struct DataMovementProtocol {
 
 extern const std::map<int, const char*> _DataMovementProtocol_VALUES_TO_NAMES;
 
+struct AuthenticationMode {
+  enum type {
+    SERVER_ISSUED = 0,
+    MYPROXY_ISSUED = 1
+  };
+};
+
+extern const std::map<int, const char*> _AuthenticationMode_VALUES_TO_NAMES;
+
 struct ProviderName {
   enum type {
     EC2 = 0,
@@ -720,14 +729,18 @@ class GlobusJobSubmission {
 
 void swap(GlobusJobSubmission &a, GlobusJobSubmission &b);
 
+typedef struct _UnicoreJobSubmission__isset {
+  _UnicoreJobSubmission__isset() : userDN(false) {}
+  bool userDN;
+} _UnicoreJobSubmission__isset;
 
 class UnicoreJobSubmission {
  public:
 
-  static const char* ascii_fingerprint; // = "D9F4CFE2F293A8B1052FD3031DD2C847";
-  static const uint8_t binary_fingerprint[16]; // = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47};
+  static const char* ascii_fingerprint; // = "06B870319715692996F28828C4AF836C";
+  static const uint8_t binary_fingerprint[16]; // = {0x06,0xB8,0x70,0x31,0x97,0x15,0x69,0x29,0x96,0xF2,0x88,0x28,0xC4,0xAF,0x83,0x6C};
 
-  UnicoreJobSubmission() : jobSubmissionInterfaceId("DO_NOT_SET_AT_CLIENTS"), securityProtocol((SecurityProtocol::type)0), unicoreEndPointURL() {
+  UnicoreJobSubmission() : jobSubmissionInterfaceId("DO_NOT_SET_AT_CLIENTS"), securityProtocol((SecurityProtocol::type)0), unicoreEndPointURL(), authenticationMode((AuthenticationMode::type)0), userDN() {
   }
 
   virtual ~UnicoreJobSubmission() throw() {}
@@ -735,6 +748,10 @@ class UnicoreJobSubmission {
   std::string jobSubmissionInterfaceId;
   SecurityProtocol::type securityProtocol;
   std::string unicoreEndPointURL;
+  AuthenticationMode::type authenticationMode;
+  std::string userDN;
+
+  _UnicoreJobSubmission__isset __isset;
 
   void __set_jobSubmissionInterfaceId(const std::string& val) {
     jobSubmissionInterfaceId = val;
@@ -748,6 +765,15 @@ class UnicoreJobSubmission {
     unicoreEndPointURL = val;
   }
 
+  void __set_authenticationMode(const AuthenticationMode::type val) {
+    authenticationMode = val;
+  }
+
+  void __set_userDN(const std::string& val) {
+    userDN = val;
+    __isset.userDN = true;
+  }
+
   bool operator == (const UnicoreJobSubmission & rhs) const
   {
     if (!(jobSubmissionInterfaceId == rhs.jobSubmissionInterfaceId))
@@ -756,6 +782,12 @@ class UnicoreJobSubmission {
       return false;
     if (!(unicoreEndPointURL == rhs.unicoreEndPointURL))
       return false;
+    if (!(authenticationMode == rhs.authenticationMode))
+      return false;
+    if (__isset.userDN != rhs.__isset.userDN)
+      return false;
+    else if (__isset.userDN && !(userDN == rhs.userDN))
+      return false;
     return true;
   }
   bool operator != (const UnicoreJobSubmission &rhs) const {

http://git-wip-us.apache.org/repos/asf/airavata/blob/7883eb97/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
index 2280d94..9bfced0 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
@@ -120,6 +120,15 @@ final class DataMovementProtocol {
   );
 }
 
+final class AuthenticationMode {
+  const SERVER_ISSUED = 0;
+  const MYPROXY_ISSUED = 1;
+  static public $__names = array(
+    0 => 'SERVER_ISSUED',
+    1 => 'MYPROXY_ISSUED',
+  );
+}
+
 final class ProviderName {
   const EC2 = 0;
   const AWSEC2 = 1;
@@ -1381,6 +1390,8 @@ class UnicoreJobSubmission {
   public $jobSubmissionInterfaceId = "DO_NOT_SET_AT_CLIENTS";
   public $securityProtocol = null;
   public $unicoreEndPointURL = null;
+  public $authenticationMode = null;
+  public $userDN = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -1397,6 +1408,14 @@ class UnicoreJobSubmission {
           'var' => 'unicoreEndPointURL',
           'type' => TType::STRING,
           ),
+        4 => array(
+          'var' => 'authenticationMode',
+          'type' => TType::I32,
+          ),
+        5 => array(
+          'var' => 'userDN',
+          'type' => TType::STRING,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -1409,6 +1428,12 @@ class UnicoreJobSubmission {
       if (isset($vals['unicoreEndPointURL'])) {
         $this->unicoreEndPointURL = $vals['unicoreEndPointURL'];
       }
+      if (isset($vals['authenticationMode'])) {
+        $this->authenticationMode = $vals['authenticationMode'];
+      }
+      if (isset($vals['userDN'])) {
+        $this->userDN = $vals['userDN'];
+      }
     }
   }
 
@@ -1452,6 +1477,20 @@ class UnicoreJobSubmission {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 4:
+          if ($ftype == TType::I32) {
+            $xfer += $input->readI32($this->authenticationMode);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 5:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->userDN);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -1480,6 +1519,16 @@ class UnicoreJobSubmission {
       $xfer += $output->writeString($this->unicoreEndPointURL);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->authenticationMode !== null) {
+      $xfer += $output->writeFieldBegin('authenticationMode', TType::I32, 4);
+      $xfer += $output->writeI32($this->authenticationMode);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->userDN !== null) {
+      $xfer += $output->writeFieldBegin('userDN', TType::STRING, 5);
+      $xfer += $output->writeString($this->userDN);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata/blob/7883eb97/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
index 9a3ed90..d65ec86 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
@@ -54,6 +54,11 @@ import org.slf4j.LoggerFactory;
  * 
  * unicoreEndPointURL:
  *  unicoreGateway End Point. The provider will query this service to fetch required service end points.
+ * authenticationMode
+ *  The authenticationMode defines the way certificate is fetched.
+ * userDN
+ *  This attribute captures the userDN used for launching jobs and create temporary storages. The attribute should be
+ *  provided if the authentication mode is set as SERVER_ISSUED.
  */
 @SuppressWarnings("all") public class UnicoreJobSubmission implements org.apache.thrift.TBase<UnicoreJobSubmission, UnicoreJobSubmission._Fields>, java.io.Serializable, Cloneable, Comparable<UnicoreJobSubmission> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnicoreJobSubmission");
@@ -61,6 +66,8 @@ import org.slf4j.LoggerFactory;
   private static final org.apache.thrift.protocol.TField JOB_SUBMISSION_INTERFACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("jobSubmissionInterfaceId", org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField SECURITY_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("securityProtocol", org.apache.thrift.protocol.TType.I32, (short)2);
   private static final org.apache.thrift.protocol.TField UNICORE_END_POINT_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("unicoreEndPointURL", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField AUTHENTICATION_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("authenticationMode", org.apache.thrift.protocol.TType.I32, (short)4);
+  private static final org.apache.thrift.protocol.TField USER_DN_FIELD_DESC = new org.apache.thrift.protocol.TField("userDN", org.apache.thrift.protocol.TType.STRING, (short)5);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -71,6 +78,8 @@ import org.slf4j.LoggerFactory;
   private String jobSubmissionInterfaceId; // required
   private SecurityProtocol securityProtocol; // required
   private String unicoreEndPointURL; // required
+  private AuthenticationMode authenticationMode; // required
+  private String userDN; // optional
 
   /** 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 {
@@ -80,7 +89,13 @@ import org.slf4j.LoggerFactory;
      * @see SecurityProtocol
      */
     SECURITY_PROTOCOL((short)2, "securityProtocol"),
-    UNICORE_END_POINT_URL((short)3, "unicoreEndPointURL");
+    UNICORE_END_POINT_URL((short)3, "unicoreEndPointURL"),
+    /**
+     * 
+     * @see AuthenticationMode
+     */
+    AUTHENTICATION_MODE((short)4, "authenticationMode"),
+    USER_DN((short)5, "userDN");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -101,6 +116,10 @@ import org.slf4j.LoggerFactory;
           return SECURITY_PROTOCOL;
         case 3: // UNICORE_END_POINT_URL
           return UNICORE_END_POINT_URL;
+        case 4: // AUTHENTICATION_MODE
+          return AUTHENTICATION_MODE;
+        case 5: // USER_DN
+          return USER_DN;
         default:
           return null;
       }
@@ -141,6 +160,7 @@ import org.slf4j.LoggerFactory;
   }
 
   // isset id assignments
+  private _Fields optionals[] = {_Fields.USER_DN};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -150,6 +170,10 @@ import org.slf4j.LoggerFactory;
         new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SecurityProtocol.class)));
     tmpMap.put(_Fields.UNICORE_END_POINT_URL, new org.apache.thrift.meta_data.FieldMetaData("unicoreEndPointURL", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.AUTHENTICATION_MODE, new org.apache.thrift.meta_data.FieldMetaData("authenticationMode", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AuthenticationMode.class)));
+    tmpMap.put(_Fields.USER_DN, new org.apache.thrift.meta_data.FieldMetaData("userDN", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UnicoreJobSubmission.class, metaDataMap);
   }
@@ -162,12 +186,14 @@ import org.slf4j.LoggerFactory;
   public UnicoreJobSubmission(
     String jobSubmissionInterfaceId,
     SecurityProtocol securityProtocol,
-    String unicoreEndPointURL)
+    String unicoreEndPointURL,
+    AuthenticationMode authenticationMode)
   {
     this();
     this.jobSubmissionInterfaceId = jobSubmissionInterfaceId;
     this.securityProtocol = securityProtocol;
     this.unicoreEndPointURL = unicoreEndPointURL;
+    this.authenticationMode = authenticationMode;
   }
 
   /**
@@ -183,6 +209,12 @@ import org.slf4j.LoggerFactory;
     if (other.isSetUnicoreEndPointURL()) {
       this.unicoreEndPointURL = other.unicoreEndPointURL;
     }
+    if (other.isSetAuthenticationMode()) {
+      this.authenticationMode = other.authenticationMode;
+    }
+    if (other.isSetUserDN()) {
+      this.userDN = other.userDN;
+    }
   }
 
   public UnicoreJobSubmission deepCopy() {
@@ -195,6 +227,8 @@ import org.slf4j.LoggerFactory;
 
     this.securityProtocol = null;
     this.unicoreEndPointURL = null;
+    this.authenticationMode = null;
+    this.userDN = null;
   }
 
   public String getJobSubmissionInterfaceId() {
@@ -274,6 +308,60 @@ import org.slf4j.LoggerFactory;
     }
   }
 
+  /**
+   * 
+   * @see AuthenticationMode
+   */
+  public AuthenticationMode getAuthenticationMode() {
+    return this.authenticationMode;
+  }
+
+  /**
+   * 
+   * @see AuthenticationMode
+   */
+  public void setAuthenticationMode(AuthenticationMode authenticationMode) {
+    this.authenticationMode = authenticationMode;
+  }
+
+  public void unsetAuthenticationMode() {
+    this.authenticationMode = null;
+  }
+
+  /** Returns true if field authenticationMode is set (has been assigned a value) and false otherwise */
+  public boolean isSetAuthenticationMode() {
+    return this.authenticationMode != null;
+  }
+
+  public void setAuthenticationModeIsSet(boolean value) {
+    if (!value) {
+      this.authenticationMode = null;
+    }
+  }
+
+  public String getUserDN() {
+    return this.userDN;
+  }
+
+  public void setUserDN(String userDN) {
+    this.userDN = userDN;
+  }
+
+  public void unsetUserDN() {
+    this.userDN = null;
+  }
+
+  /** Returns true if field userDN is set (has been assigned a value) and false otherwise */
+  public boolean isSetUserDN() {
+    return this.userDN != null;
+  }
+
+  public void setUserDNIsSet(boolean value) {
+    if (!value) {
+      this.userDN = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case JOB_SUBMISSION_INTERFACE_ID:
@@ -300,6 +388,22 @@ import org.slf4j.LoggerFactory;
       }
       break;
 
+    case AUTHENTICATION_MODE:
+      if (value == null) {
+        unsetAuthenticationMode();
+      } else {
+        setAuthenticationMode((AuthenticationMode)value);
+      }
+      break;
+
+    case USER_DN:
+      if (value == null) {
+        unsetUserDN();
+      } else {
+        setUserDN((String)value);
+      }
+      break;
+
     }
   }
 
@@ -314,6 +418,12 @@ import org.slf4j.LoggerFactory;
     case UNICORE_END_POINT_URL:
       return getUnicoreEndPointURL();
 
+    case AUTHENTICATION_MODE:
+      return getAuthenticationMode();
+
+    case USER_DN:
+      return getUserDN();
+
     }
     throw new IllegalStateException();
   }
@@ -331,6 +441,10 @@ import org.slf4j.LoggerFactory;
       return isSetSecurityProtocol();
     case UNICORE_END_POINT_URL:
       return isSetUnicoreEndPointURL();
+    case AUTHENTICATION_MODE:
+      return isSetAuthenticationMode();
+    case USER_DN:
+      return isSetUserDN();
     }
     throw new IllegalStateException();
   }
@@ -375,6 +489,24 @@ import org.slf4j.LoggerFactory;
         return false;
     }
 
+    boolean this_present_authenticationMode = true && this.isSetAuthenticationMode();
+    boolean that_present_authenticationMode = true && that.isSetAuthenticationMode();
+    if (this_present_authenticationMode || that_present_authenticationMode) {
+      if (!(this_present_authenticationMode && that_present_authenticationMode))
+        return false;
+      if (!this.authenticationMode.equals(that.authenticationMode))
+        return false;
+    }
+
+    boolean this_present_userDN = true && this.isSetUserDN();
+    boolean that_present_userDN = true && that.isSetUserDN();
+    if (this_present_userDN || that_present_userDN) {
+      if (!(this_present_userDN && that_present_userDN))
+        return false;
+      if (!this.userDN.equals(that.userDN))
+        return false;
+    }
+
     return true;
   }
 
@@ -421,6 +553,26 @@ import org.slf4j.LoggerFactory;
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetAuthenticationMode()).compareTo(other.isSetAuthenticationMode());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetAuthenticationMode()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authenticationMode, other.authenticationMode);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUserDN()).compareTo(other.isSetUserDN());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUserDN()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userDN, other.userDN);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -464,6 +616,24 @@ import org.slf4j.LoggerFactory;
       sb.append(this.unicoreEndPointURL);
     }
     first = false;
+    if (!first) sb.append(", ");
+    sb.append("authenticationMode:");
+    if (this.authenticationMode == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.authenticationMode);
+    }
+    first = false;
+    if (isSetUserDN()) {
+      if (!first) sb.append(", ");
+      sb.append("userDN:");
+      if (this.userDN == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.userDN);
+      }
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }
@@ -482,6 +652,10 @@ import org.slf4j.LoggerFactory;
       throw new org.apache.thrift.protocol.TProtocolException("Required field 'unicoreEndPointURL' is unset! Struct:" + toString());
     }
 
+    if (!isSetAuthenticationMode()) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'authenticationMode' is unset! Struct:" + toString());
+    }
+
     // check for sub-struct validity
   }
 
@@ -543,6 +717,22 @@ import org.slf4j.LoggerFactory;
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 4: // AUTHENTICATION_MODE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.authenticationMode = AuthenticationMode.findByValue(iprot.readI32());
+              struct.setAuthenticationModeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // USER_DN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.userDN = iprot.readString();
+              struct.setUserDNIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -571,6 +761,18 @@ import org.slf4j.LoggerFactory;
         oprot.writeString(struct.unicoreEndPointURL);
         oprot.writeFieldEnd();
       }
+      if (struct.authenticationMode != null) {
+        oprot.writeFieldBegin(AUTHENTICATION_MODE_FIELD_DESC);
+        oprot.writeI32(struct.authenticationMode.getValue());
+        oprot.writeFieldEnd();
+      }
+      if (struct.userDN != null) {
+        if (struct.isSetUserDN()) {
+          oprot.writeFieldBegin(USER_DN_FIELD_DESC);
+          oprot.writeString(struct.userDN);
+          oprot.writeFieldEnd();
+        }
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -591,6 +793,15 @@ import org.slf4j.LoggerFactory;
       oprot.writeString(struct.jobSubmissionInterfaceId);
       oprot.writeI32(struct.securityProtocol.getValue());
       oprot.writeString(struct.unicoreEndPointURL);
+      oprot.writeI32(struct.authenticationMode.getValue());
+      BitSet optionals = new BitSet();
+      if (struct.isSetUserDN()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetUserDN()) {
+        oprot.writeString(struct.userDN);
+      }
     }
 
     @Override
@@ -602,6 +813,13 @@ import org.slf4j.LoggerFactory;
       struct.setSecurityProtocolIsSet(true);
       struct.unicoreEndPointURL = iprot.readString();
       struct.setUnicoreEndPointURLIsSet(true);
+      struct.authenticationMode = AuthenticationMode.findByValue(iprot.readI32());
+      struct.setAuthenticationModeIsSet(true);
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.userDN = iprot.readString();
+        struct.setUserDNIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/7883eb97/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift b/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
index 8e89908..9bf1b72 100644
--- a/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
@@ -329,6 +329,20 @@ struct GlobusJobSubmission {
 }
 
 /**
+ * AuthenticationMode
+ *
+ * SERVER_ISSUED: use CA credentials to generate a certificate based on user name. 
+ * server properties. 
+ * MYPROXY_ISSUED: rely on GSI method implementation already provided 
+ * by Airavata security libs. 
+*/
+enum AuthenticationMode {
+    SERVER_ISSUED,
+    MYPROXY_ISSUED
+}
+
+
+/**
  * Unicore Job Submission
  *
  * unicoreEndPointURL:
@@ -347,18 +361,6 @@ struct UnicoreJobSubmission {
     5: optional string userDN
 }
 
-/**
- * AuthenticationMode
- *
- * SERVER_ISSUED: use CA credentials to generate a certificate based on user name. 
- * server properties. 
- * MYPROXY_ISSUED: rely on GSI method implementation already provided 
- * by Airavata security libs. 
-*/
-enum AuthenticationMode {
-    SERVER_ISSUED,
-    MYPROXY_ISSUED
-}
 
 
 /**


[19/62] [abbrv] airavata git commit: Reorganizing duplicate generated classed and instead using the stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
deleted file mode 100644
index 2b8858e..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
+++ /dev/null
@@ -1,55 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class cs_cpi_serviceConstants {
-
-  public static final String CS_CPI_VERSION = "0.15.0";
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
deleted file mode 100644
index ae37b1d..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
+++ /dev/null
@@ -1,1104 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CertificateCredential implements org.apache.thrift.TBase<CertificateCredential, CertificateCredential._Fields>, java.io.Serializable, Cloneable, Comparable<CertificateCredential> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CertificateCredential");
-
-  private static final org.apache.thrift.protocol.TField COMMUNITY_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("communityUser", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-  private static final org.apache.thrift.protocol.TField X509_CERT_FIELD_DESC = new org.apache.thrift.protocol.TField("x509Cert", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField NOT_AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("notAfter", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)4);
-  private static final org.apache.thrift.protocol.TField LIFE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lifeTime", org.apache.thrift.protocol.TType.I64, (short)5);
-  private static final org.apache.thrift.protocol.TField NOT_BEFORE_FIELD_DESC = new org.apache.thrift.protocol.TField("notBefore", org.apache.thrift.protocol.TType.STRING, (short)6);
-  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)7);
-  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)8);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new CertificateCredentialStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new CertificateCredentialTupleSchemeFactory());
-  }
-
-  public CommunityUser communityUser; // required
-  public String x509Cert; // required
-  public String notAfter; // optional
-  public String privateKey; // optional
-  public long lifeTime; // optional
-  public String notBefore; // optional
-  public long persistedTime; // optional
-  public String token; // optional
-
-  /** 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 {
-    COMMUNITY_USER((short)1, "communityUser"),
-    X509_CERT((short)2, "x509Cert"),
-    NOT_AFTER((short)3, "notAfter"),
-    PRIVATE_KEY((short)4, "privateKey"),
-    LIFE_TIME((short)5, "lifeTime"),
-    NOT_BEFORE((short)6, "notBefore"),
-    PERSISTED_TIME((short)7, "persistedTime"),
-    TOKEN((short)8, "token");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // COMMUNITY_USER
-          return COMMUNITY_USER;
-        case 2: // X509_CERT
-          return X509_CERT;
-        case 3: // NOT_AFTER
-          return NOT_AFTER;
-        case 4: // PRIVATE_KEY
-          return PRIVATE_KEY;
-        case 5: // LIFE_TIME
-          return LIFE_TIME;
-        case 6: // NOT_BEFORE
-          return NOT_BEFORE;
-        case 7: // PERSISTED_TIME
-          return PERSISTED_TIME;
-        case 8: // TOKEN
-          return TOKEN;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __LIFETIME_ISSET_ID = 0;
-  private static final int __PERSISTEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.NOT_AFTER,_Fields.PRIVATE_KEY,_Fields.LIFE_TIME,_Fields.NOT_BEFORE,_Fields.PERSISTED_TIME,_Fields.TOKEN};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.COMMUNITY_USER, new org.apache.thrift.meta_data.FieldMetaData("communityUser", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CommunityUser.class)));
-    tmpMap.put(_Fields.X509_CERT, new org.apache.thrift.meta_data.FieldMetaData("x509Cert", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.NOT_AFTER, new org.apache.thrift.meta_data.FieldMetaData("notAfter", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.LIFE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lifeTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.NOT_BEFORE, new org.apache.thrift.meta_data.FieldMetaData("notBefore", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CertificateCredential.class, metaDataMap);
-  }
-
-  public CertificateCredential() {
-  }
-
-  public CertificateCredential(
-    CommunityUser communityUser,
-    String x509Cert)
-  {
-    this();
-    this.communityUser = communityUser;
-    this.x509Cert = x509Cert;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public CertificateCredential(CertificateCredential other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetCommunityUser()) {
-      this.communityUser = new CommunityUser(other.communityUser);
-    }
-    if (other.isSetX509Cert()) {
-      this.x509Cert = other.x509Cert;
-    }
-    if (other.isSetNotAfter()) {
-      this.notAfter = other.notAfter;
-    }
-    if (other.isSetPrivateKey()) {
-      this.privateKey = other.privateKey;
-    }
-    this.lifeTime = other.lifeTime;
-    if (other.isSetNotBefore()) {
-      this.notBefore = other.notBefore;
-    }
-    this.persistedTime = other.persistedTime;
-    if (other.isSetToken()) {
-      this.token = other.token;
-    }
-  }
-
-  public CertificateCredential deepCopy() {
-    return new CertificateCredential(this);
-  }
-
-  @Override
-  public void clear() {
-    this.communityUser = null;
-    this.x509Cert = null;
-    this.notAfter = null;
-    this.privateKey = null;
-    setLifeTimeIsSet(false);
-    this.lifeTime = 0;
-    this.notBefore = null;
-    setPersistedTimeIsSet(false);
-    this.persistedTime = 0;
-    this.token = null;
-  }
-
-  public CommunityUser getCommunityUser() {
-    return this.communityUser;
-  }
-
-  public CertificateCredential setCommunityUser(CommunityUser communityUser) {
-    this.communityUser = communityUser;
-    return this;
-  }
-
-  public void unsetCommunityUser() {
-    this.communityUser = null;
-  }
-
-  /** Returns true if field communityUser is set (has been assigned a value) and false otherwise */
-  public boolean isSetCommunityUser() {
-    return this.communityUser != null;
-  }
-
-  public void setCommunityUserIsSet(boolean value) {
-    if (!value) {
-      this.communityUser = null;
-    }
-  }
-
-  public String getX509Cert() {
-    return this.x509Cert;
-  }
-
-  public CertificateCredential setX509Cert(String x509Cert) {
-    this.x509Cert = x509Cert;
-    return this;
-  }
-
-  public void unsetX509Cert() {
-    this.x509Cert = null;
-  }
-
-  /** Returns true if field x509Cert is set (has been assigned a value) and false otherwise */
-  public boolean isSetX509Cert() {
-    return this.x509Cert != null;
-  }
-
-  public void setX509CertIsSet(boolean value) {
-    if (!value) {
-      this.x509Cert = null;
-    }
-  }
-
-  public String getNotAfter() {
-    return this.notAfter;
-  }
-
-  public CertificateCredential setNotAfter(String notAfter) {
-    this.notAfter = notAfter;
-    return this;
-  }
-
-  public void unsetNotAfter() {
-    this.notAfter = null;
-  }
-
-  /** Returns true if field notAfter is set (has been assigned a value) and false otherwise */
-  public boolean isSetNotAfter() {
-    return this.notAfter != null;
-  }
-
-  public void setNotAfterIsSet(boolean value) {
-    if (!value) {
-      this.notAfter = null;
-    }
-  }
-
-  public String getPrivateKey() {
-    return this.privateKey;
-  }
-
-  public CertificateCredential setPrivateKey(String privateKey) {
-    this.privateKey = privateKey;
-    return this;
-  }
-
-  public void unsetPrivateKey() {
-    this.privateKey = null;
-  }
-
-  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
-  public boolean isSetPrivateKey() {
-    return this.privateKey != null;
-  }
-
-  public void setPrivateKeyIsSet(boolean value) {
-    if (!value) {
-      this.privateKey = null;
-    }
-  }
-
-  public long getLifeTime() {
-    return this.lifeTime;
-  }
-
-  public CertificateCredential setLifeTime(long lifeTime) {
-    this.lifeTime = lifeTime;
-    setLifeTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetLifeTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIFETIME_ISSET_ID);
-  }
-
-  /** Returns true if field lifeTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetLifeTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __LIFETIME_ISSET_ID);
-  }
-
-  public void setLifeTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIFETIME_ISSET_ID, value);
-  }
-
-  public String getNotBefore() {
-    return this.notBefore;
-  }
-
-  public CertificateCredential setNotBefore(String notBefore) {
-    this.notBefore = notBefore;
-    return this;
-  }
-
-  public void unsetNotBefore() {
-    this.notBefore = null;
-  }
-
-  /** Returns true if field notBefore is set (has been assigned a value) and false otherwise */
-  public boolean isSetNotBefore() {
-    return this.notBefore != null;
-  }
-
-  public void setNotBeforeIsSet(boolean value) {
-    if (!value) {
-      this.notBefore = null;
-    }
-  }
-
-  public long getPersistedTime() {
-    return this.persistedTime;
-  }
-
-  public CertificateCredential setPersistedTime(long persistedTime) {
-    this.persistedTime = persistedTime;
-    setPersistedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetPersistedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetPersistedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  public void setPersistedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
-  }
-
-  public String getToken() {
-    return this.token;
-  }
-
-  public CertificateCredential setToken(String token) {
-    this.token = token;
-    return this;
-  }
-
-  public void unsetToken() {
-    this.token = null;
-  }
-
-  /** Returns true if field token is set (has been assigned a value) and false otherwise */
-  public boolean isSetToken() {
-    return this.token != null;
-  }
-
-  public void setTokenIsSet(boolean value) {
-    if (!value) {
-      this.token = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case COMMUNITY_USER:
-      if (value == null) {
-        unsetCommunityUser();
-      } else {
-        setCommunityUser((CommunityUser)value);
-      }
-      break;
-
-    case X509_CERT:
-      if (value == null) {
-        unsetX509Cert();
-      } else {
-        setX509Cert((String)value);
-      }
-      break;
-
-    case NOT_AFTER:
-      if (value == null) {
-        unsetNotAfter();
-      } else {
-        setNotAfter((String)value);
-      }
-      break;
-
-    case PRIVATE_KEY:
-      if (value == null) {
-        unsetPrivateKey();
-      } else {
-        setPrivateKey((String)value);
-      }
-      break;
-
-    case LIFE_TIME:
-      if (value == null) {
-        unsetLifeTime();
-      } else {
-        setLifeTime((Long)value);
-      }
-      break;
-
-    case NOT_BEFORE:
-      if (value == null) {
-        unsetNotBefore();
-      } else {
-        setNotBefore((String)value);
-      }
-      break;
-
-    case PERSISTED_TIME:
-      if (value == null) {
-        unsetPersistedTime();
-      } else {
-        setPersistedTime((Long)value);
-      }
-      break;
-
-    case TOKEN:
-      if (value == null) {
-        unsetToken();
-      } else {
-        setToken((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case COMMUNITY_USER:
-      return getCommunityUser();
-
-    case X509_CERT:
-      return getX509Cert();
-
-    case NOT_AFTER:
-      return getNotAfter();
-
-    case PRIVATE_KEY:
-      return getPrivateKey();
-
-    case LIFE_TIME:
-      return Long.valueOf(getLifeTime());
-
-    case NOT_BEFORE:
-      return getNotBefore();
-
-    case PERSISTED_TIME:
-      return Long.valueOf(getPersistedTime());
-
-    case TOKEN:
-      return getToken();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case COMMUNITY_USER:
-      return isSetCommunityUser();
-    case X509_CERT:
-      return isSetX509Cert();
-    case NOT_AFTER:
-      return isSetNotAfter();
-    case PRIVATE_KEY:
-      return isSetPrivateKey();
-    case LIFE_TIME:
-      return isSetLifeTime();
-    case NOT_BEFORE:
-      return isSetNotBefore();
-    case PERSISTED_TIME:
-      return isSetPersistedTime();
-    case TOKEN:
-      return isSetToken();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof CertificateCredential)
-      return this.equals((CertificateCredential)that);
-    return false;
-  }
-
-  public boolean equals(CertificateCredential that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_communityUser = true && this.isSetCommunityUser();
-    boolean that_present_communityUser = true && that.isSetCommunityUser();
-    if (this_present_communityUser || that_present_communityUser) {
-      if (!(this_present_communityUser && that_present_communityUser))
-        return false;
-      if (!this.communityUser.equals(that.communityUser))
-        return false;
-    }
-
-    boolean this_present_x509Cert = true && this.isSetX509Cert();
-    boolean that_present_x509Cert = true && that.isSetX509Cert();
-    if (this_present_x509Cert || that_present_x509Cert) {
-      if (!(this_present_x509Cert && that_present_x509Cert))
-        return false;
-      if (!this.x509Cert.equals(that.x509Cert))
-        return false;
-    }
-
-    boolean this_present_notAfter = true && this.isSetNotAfter();
-    boolean that_present_notAfter = true && that.isSetNotAfter();
-    if (this_present_notAfter || that_present_notAfter) {
-      if (!(this_present_notAfter && that_present_notAfter))
-        return false;
-      if (!this.notAfter.equals(that.notAfter))
-        return false;
-    }
-
-    boolean this_present_privateKey = true && this.isSetPrivateKey();
-    boolean that_present_privateKey = true && that.isSetPrivateKey();
-    if (this_present_privateKey || that_present_privateKey) {
-      if (!(this_present_privateKey && that_present_privateKey))
-        return false;
-      if (!this.privateKey.equals(that.privateKey))
-        return false;
-    }
-
-    boolean this_present_lifeTime = true && this.isSetLifeTime();
-    boolean that_present_lifeTime = true && that.isSetLifeTime();
-    if (this_present_lifeTime || that_present_lifeTime) {
-      if (!(this_present_lifeTime && that_present_lifeTime))
-        return false;
-      if (this.lifeTime != that.lifeTime)
-        return false;
-    }
-
-    boolean this_present_notBefore = true && this.isSetNotBefore();
-    boolean that_present_notBefore = true && that.isSetNotBefore();
-    if (this_present_notBefore || that_present_notBefore) {
-      if (!(this_present_notBefore && that_present_notBefore))
-        return false;
-      if (!this.notBefore.equals(that.notBefore))
-        return false;
-    }
-
-    boolean this_present_persistedTime = true && this.isSetPersistedTime();
-    boolean that_present_persistedTime = true && that.isSetPersistedTime();
-    if (this_present_persistedTime || that_present_persistedTime) {
-      if (!(this_present_persistedTime && that_present_persistedTime))
-        return false;
-      if (this.persistedTime != that.persistedTime)
-        return false;
-    }
-
-    boolean this_present_token = true && this.isSetToken();
-    boolean that_present_token = true && that.isSetToken();
-    if (this_present_token || that_present_token) {
-      if (!(this_present_token && that_present_token))
-        return false;
-      if (!this.token.equals(that.token))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(CertificateCredential other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetCommunityUser()).compareTo(other.isSetCommunityUser());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCommunityUser()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.communityUser, other.communityUser);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetX509Cert()).compareTo(other.isSetX509Cert());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetX509Cert()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.x509Cert, other.x509Cert);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetNotAfter()).compareTo(other.isSetNotAfter());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetNotAfter()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notAfter, other.notAfter);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPrivateKey()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetLifeTime()).compareTo(other.isSetLifeTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetLifeTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lifeTime, other.lifeTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetNotBefore()).compareTo(other.isSetNotBefore());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetNotBefore()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notBefore, other.notBefore);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPersistedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetToken()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("CertificateCredential(");
-    boolean first = true;
-
-    sb.append("communityUser:");
-    if (this.communityUser == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.communityUser);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("x509Cert:");
-    if (this.x509Cert == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.x509Cert);
-    }
-    first = false;
-    if (isSetNotAfter()) {
-      if (!first) sb.append(", ");
-      sb.append("notAfter:");
-      if (this.notAfter == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.notAfter);
-      }
-      first = false;
-    }
-    if (isSetPrivateKey()) {
-      if (!first) sb.append(", ");
-      sb.append("privateKey:");
-      if (this.privateKey == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.privateKey);
-      }
-      first = false;
-    }
-    if (isSetLifeTime()) {
-      if (!first) sb.append(", ");
-      sb.append("lifeTime:");
-      sb.append(this.lifeTime);
-      first = false;
-    }
-    if (isSetNotBefore()) {
-      if (!first) sb.append(", ");
-      sb.append("notBefore:");
-      if (this.notBefore == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.notBefore);
-      }
-      first = false;
-    }
-    if (isSetPersistedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("persistedTime:");
-      sb.append(this.persistedTime);
-      first = false;
-    }
-    if (isSetToken()) {
-      if (!first) sb.append(", ");
-      sb.append("token:");
-      if (this.token == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.token);
-      }
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (communityUser == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'communityUser' was not present! Struct: " + toString());
-    }
-    if (x509Cert == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'x509Cert' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-    if (communityUser != null) {
-      communityUser.validate();
-    }
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class CertificateCredentialStandardSchemeFactory implements SchemeFactory {
-    public CertificateCredentialStandardScheme getScheme() {
-      return new CertificateCredentialStandardScheme();
-    }
-  }
-
-  private static class CertificateCredentialStandardScheme extends StandardScheme<CertificateCredential> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, CertificateCredential struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // COMMUNITY_USER
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-              struct.communityUser = new CommunityUser();
-              struct.communityUser.read(iprot);
-              struct.setCommunityUserIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // X509_CERT
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.x509Cert = iprot.readString();
-              struct.setX509CertIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // NOT_AFTER
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.notAfter = iprot.readString();
-              struct.setNotAfterIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // PRIVATE_KEY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.privateKey = iprot.readString();
-              struct.setPrivateKeyIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // LIFE_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.lifeTime = iprot.readI64();
-              struct.setLifeTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // NOT_BEFORE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.notBefore = iprot.readString();
-              struct.setNotBeforeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 7: // PERSISTED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.persistedTime = iprot.readI64();
-              struct.setPersistedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 8: // TOKEN
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.token = iprot.readString();
-              struct.setTokenIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, CertificateCredential struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.communityUser != null) {
-        oprot.writeFieldBegin(COMMUNITY_USER_FIELD_DESC);
-        struct.communityUser.write(oprot);
-        oprot.writeFieldEnd();
-      }
-      if (struct.x509Cert != null) {
-        oprot.writeFieldBegin(X509_CERT_FIELD_DESC);
-        oprot.writeString(struct.x509Cert);
-        oprot.writeFieldEnd();
-      }
-      if (struct.notAfter != null) {
-        if (struct.isSetNotAfter()) {
-          oprot.writeFieldBegin(NOT_AFTER_FIELD_DESC);
-          oprot.writeString(struct.notAfter);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.privateKey != null) {
-        if (struct.isSetPrivateKey()) {
-          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
-          oprot.writeString(struct.privateKey);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetLifeTime()) {
-        oprot.writeFieldBegin(LIFE_TIME_FIELD_DESC);
-        oprot.writeI64(struct.lifeTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.notBefore != null) {
-        if (struct.isSetNotBefore()) {
-          oprot.writeFieldBegin(NOT_BEFORE_FIELD_DESC);
-          oprot.writeString(struct.notBefore);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.persistedTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.token != null) {
-        if (struct.isSetToken()) {
-          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
-          oprot.writeString(struct.token);
-          oprot.writeFieldEnd();
-        }
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class CertificateCredentialTupleSchemeFactory implements SchemeFactory {
-    public CertificateCredentialTupleScheme getScheme() {
-      return new CertificateCredentialTupleScheme();
-    }
-  }
-
-  private static class CertificateCredentialTupleScheme extends TupleScheme<CertificateCredential> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      struct.communityUser.write(oprot);
-      oprot.writeString(struct.x509Cert);
-      BitSet optionals = new BitSet();
-      if (struct.isSetNotAfter()) {
-        optionals.set(0);
-      }
-      if (struct.isSetPrivateKey()) {
-        optionals.set(1);
-      }
-      if (struct.isSetLifeTime()) {
-        optionals.set(2);
-      }
-      if (struct.isSetNotBefore()) {
-        optionals.set(3);
-      }
-      if (struct.isSetPersistedTime()) {
-        optionals.set(4);
-      }
-      if (struct.isSetToken()) {
-        optionals.set(5);
-      }
-      oprot.writeBitSet(optionals, 6);
-      if (struct.isSetNotAfter()) {
-        oprot.writeString(struct.notAfter);
-      }
-      if (struct.isSetPrivateKey()) {
-        oprot.writeString(struct.privateKey);
-      }
-      if (struct.isSetLifeTime()) {
-        oprot.writeI64(struct.lifeTime);
-      }
-      if (struct.isSetNotBefore()) {
-        oprot.writeString(struct.notBefore);
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeI64(struct.persistedTime);
-      }
-      if (struct.isSetToken()) {
-        oprot.writeString(struct.token);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.communityUser = new CommunityUser();
-      struct.communityUser.read(iprot);
-      struct.setCommunityUserIsSet(true);
-      struct.x509Cert = iprot.readString();
-      struct.setX509CertIsSet(true);
-      BitSet incoming = iprot.readBitSet(6);
-      if (incoming.get(0)) {
-        struct.notAfter = iprot.readString();
-        struct.setNotAfterIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.privateKey = iprot.readString();
-        struct.setPrivateKeyIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.lifeTime = iprot.readI64();
-        struct.setLifeTimeIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.notBefore = iprot.readString();
-        struct.setNotBeforeIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.persistedTime = iprot.readI64();
-        struct.setPersistedTimeIsSet(true);
-      }
-      if (incoming.get(5)) {
-        struct.token = iprot.readString();
-        struct.setTokenIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
deleted file mode 100644
index 9b62310..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
+++ /dev/null
@@ -1,589 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser");
-
-  private static final org.apache.thrift.protocol.TField GATEWAY_NMAE_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayNmae", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField USER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userEmail", org.apache.thrift.protocol.TType.STRING, (short)3);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new CommunityUserStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new CommunityUserTupleSchemeFactory());
-  }
-
-  public String gatewayNmae; // required
-  public String username; // required
-  public String userEmail; // 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 {
-    GATEWAY_NMAE((short)1, "gatewayNmae"),
-    USERNAME((short)2, "username"),
-    USER_EMAIL((short)3, "userEmail");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // GATEWAY_NMAE
-          return GATEWAY_NMAE;
-        case 2: // USERNAME
-          return USERNAME;
-        case 3: // USER_EMAIL
-          return USER_EMAIL;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.GATEWAY_NMAE, new org.apache.thrift.meta_data.FieldMetaData("gatewayNmae", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", 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(CommunityUser.class, metaDataMap);
-  }
-
-  public CommunityUser() {
-  }
-
-  public CommunityUser(
-    String gatewayNmae,
-    String username,
-    String userEmail)
-  {
-    this();
-    this.gatewayNmae = gatewayNmae;
-    this.username = username;
-    this.userEmail = userEmail;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public CommunityUser(CommunityUser other) {
-    if (other.isSetGatewayNmae()) {
-      this.gatewayNmae = other.gatewayNmae;
-    }
-    if (other.isSetUsername()) {
-      this.username = other.username;
-    }
-    if (other.isSetUserEmail()) {
-      this.userEmail = other.userEmail;
-    }
-  }
-
-  public CommunityUser deepCopy() {
-    return new CommunityUser(this);
-  }
-
-  @Override
-  public void clear() {
-    this.gatewayNmae = null;
-    this.username = null;
-    this.userEmail = null;
-  }
-
-  public String getGatewayNmae() {
-    return this.gatewayNmae;
-  }
-
-  public CommunityUser setGatewayNmae(String gatewayNmae) {
-    this.gatewayNmae = gatewayNmae;
-    return this;
-  }
-
-  public void unsetGatewayNmae() {
-    this.gatewayNmae = null;
-  }
-
-  /** Returns true if field gatewayNmae is set (has been assigned a value) and false otherwise */
-  public boolean isSetGatewayNmae() {
-    return this.gatewayNmae != null;
-  }
-
-  public void setGatewayNmaeIsSet(boolean value) {
-    if (!value) {
-      this.gatewayNmae = null;
-    }
-  }
-
-  public String getUsername() {
-    return this.username;
-  }
-
-  public CommunityUser setUsername(String username) {
-    this.username = username;
-    return this;
-  }
-
-  public void unsetUsername() {
-    this.username = null;
-  }
-
-  /** Returns true if field username is set (has been assigned a value) and false otherwise */
-  public boolean isSetUsername() {
-    return this.username != null;
-  }
-
-  public void setUsernameIsSet(boolean value) {
-    if (!value) {
-      this.username = null;
-    }
-  }
-
-  public String getUserEmail() {
-    return this.userEmail;
-  }
-
-  public CommunityUser setUserEmail(String userEmail) {
-    this.userEmail = userEmail;
-    return this;
-  }
-
-  public void unsetUserEmail() {
-    this.userEmail = null;
-  }
-
-  /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
-  public boolean isSetUserEmail() {
-    return this.userEmail != null;
-  }
-
-  public void setUserEmailIsSet(boolean value) {
-    if (!value) {
-      this.userEmail = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case GATEWAY_NMAE:
-      if (value == null) {
-        unsetGatewayNmae();
-      } else {
-        setGatewayNmae((String)value);
-      }
-      break;
-
-    case USERNAME:
-      if (value == null) {
-        unsetUsername();
-      } else {
-        setUsername((String)value);
-      }
-      break;
-
-    case USER_EMAIL:
-      if (value == null) {
-        unsetUserEmail();
-      } else {
-        setUserEmail((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case GATEWAY_NMAE:
-      return getGatewayNmae();
-
-    case USERNAME:
-      return getUsername();
-
-    case USER_EMAIL:
-      return getUserEmail();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case GATEWAY_NMAE:
-      return isSetGatewayNmae();
-    case USERNAME:
-      return isSetUsername();
-    case USER_EMAIL:
-      return isSetUserEmail();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof CommunityUser)
-      return this.equals((CommunityUser)that);
-    return false;
-  }
-
-  public boolean equals(CommunityUser that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_gatewayNmae = true && this.isSetGatewayNmae();
-    boolean that_present_gatewayNmae = true && that.isSetGatewayNmae();
-    if (this_present_gatewayNmae || that_present_gatewayNmae) {
-      if (!(this_present_gatewayNmae && that_present_gatewayNmae))
-        return false;
-      if (!this.gatewayNmae.equals(that.gatewayNmae))
-        return false;
-    }
-
-    boolean this_present_username = true && this.isSetUsername();
-    boolean that_present_username = true && that.isSetUsername();
-    if (this_present_username || that_present_username) {
-      if (!(this_present_username && that_present_username))
-        return false;
-      if (!this.username.equals(that.username))
-        return false;
-    }
-
-    boolean this_present_userEmail = true && this.isSetUserEmail();
-    boolean that_present_userEmail = true && that.isSetUserEmail();
-    if (this_present_userEmail || that_present_userEmail) {
-      if (!(this_present_userEmail && that_present_userEmail))
-        return false;
-      if (!this.userEmail.equals(that.userEmail))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(CommunityUser other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetGatewayNmae()).compareTo(other.isSetGatewayNmae());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGatewayNmae()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayNmae, other.gatewayNmae);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUsername()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(other.isSetUserEmail());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUserEmail()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, other.userEmail);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("CommunityUser(");
-    boolean first = true;
-
-    sb.append("gatewayNmae:");
-    if (this.gatewayNmae == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.gatewayNmae);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("username:");
-    if (this.username == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.username);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("userEmail:");
-    if (this.userEmail == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.userEmail);
-    }
-    first = false;
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (gatewayNmae == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayNmae' was not present! Struct: " + toString());
-    }
-    if (username == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
-    }
-    if (userEmail == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'userEmail' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class CommunityUserStandardSchemeFactory implements SchemeFactory {
-    public CommunityUserStandardScheme getScheme() {
-      return new CommunityUserStandardScheme();
-    }
-  }
-
-  private static class CommunityUserStandardScheme extends StandardScheme<CommunityUser> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, CommunityUser struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // GATEWAY_NMAE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.gatewayNmae = iprot.readString();
-              struct.setGatewayNmaeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // USERNAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.username = iprot.readString();
-              struct.setUsernameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // USER_EMAIL
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.userEmail = iprot.readString();
-              struct.setUserEmailIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, CommunityUser struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.gatewayNmae != null) {
-        oprot.writeFieldBegin(GATEWAY_NMAE_FIELD_DESC);
-        oprot.writeString(struct.gatewayNmae);
-        oprot.writeFieldEnd();
-      }
-      if (struct.username != null) {
-        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
-        oprot.writeString(struct.username);
-        oprot.writeFieldEnd();
-      }
-      if (struct.userEmail != null) {
-        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
-        oprot.writeString(struct.userEmail);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class CommunityUserTupleSchemeFactory implements SchemeFactory {
-    public CommunityUserTupleScheme getScheme() {
-      return new CommunityUserTupleScheme();
-    }
-  }
-
-  private static class CommunityUserTupleScheme extends TupleScheme<CommunityUser> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.gatewayNmae);
-      oprot.writeString(struct.username);
-      oprot.writeString(struct.userEmail);
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.gatewayNmae = iprot.readString();
-      struct.setGatewayNmaeIsSet(true);
-      struct.username = iprot.readString();
-      struct.setUsernameIsSet(true);
-      struct.userEmail = iprot.readString();
-      struct.setUserEmailIsSet(true);
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
deleted file mode 100644
index f6b6837..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
+++ /dev/null
@@ -1,698 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class PasswordCredential implements org.apache.thrift.TBase<PasswordCredential, PasswordCredential._Fields>, java.io.Serializable, Cloneable, Comparable<PasswordCredential> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PasswordCredential");
-
-  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)3);
-  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new PasswordCredentialStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new PasswordCredentialTupleSchemeFactory());
-  }
-
-  public String username; // required
-  public String password; // required
-  public long persistedTime; // optional
-  public String token; // optional
-
-  /** 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 {
-    USERNAME((short)1, "username"),
-    PASSWORD((short)2, "password"),
-    PERSISTED_TIME((short)3, "persistedTime"),
-    TOKEN((short)4, "token");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // USERNAME
-          return USERNAME;
-        case 2: // PASSWORD
-          return PASSWORD;
-        case 3: // PERSISTED_TIME
-          return PERSISTED_TIME;
-        case 4: // TOKEN
-          return TOKEN;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __PERSISTEDTIME_ISSET_ID = 0;
-  private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.PERSISTED_TIME,_Fields.TOKEN};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PasswordCredential.class, metaDataMap);
-  }
-
-  public PasswordCredential() {
-  }
-
-  public PasswordCredential(
-    String username,
-    String password)
-  {
-    this();
-    this.username = username;
-    this.password = password;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public PasswordCredential(PasswordCredential other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetUsername()) {
-      this.username = other.username;
-    }
-    if (other.isSetPassword()) {
-      this.password = other.password;
-    }
-    this.persistedTime = other.persistedTime;
-    if (other.isSetToken()) {
-      this.token = other.token;
-    }
-  }
-
-  public PasswordCredential deepCopy() {
-    return new PasswordCredential(this);
-  }
-
-  @Override
-  public void clear() {
-    this.username = null;
-    this.password = null;
-    setPersistedTimeIsSet(false);
-    this.persistedTime = 0;
-    this.token = null;
-  }
-
-  public String getUsername() {
-    return this.username;
-  }
-
-  public PasswordCredential setUsername(String username) {
-    this.username = username;
-    return this;
-  }
-
-  public void unsetUsername() {
-    this.username = null;
-  }
-
-  /** Returns true if field username is set (has been assigned a value) and false otherwise */
-  public boolean isSetUsername() {
-    return this.username != null;
-  }
-
-  public void setUsernameIsSet(boolean value) {
-    if (!value) {
-      this.username = null;
-    }
-  }
-
-  public String getPassword() {
-    return this.password;
-  }
-
-  public PasswordCredential setPassword(String password) {
-    this.password = password;
-    return this;
-  }
-
-  public void unsetPassword() {
-    this.password = null;
-  }
-
-  /** Returns true if field password is set (has been assigned a value) and false otherwise */
-  public boolean isSetPassword() {
-    return this.password != null;
-  }
-
-  public void setPasswordIsSet(boolean value) {
-    if (!value) {
-      this.password = null;
-    }
-  }
-
-  public long getPersistedTime() {
-    return this.persistedTime;
-  }
-
-  public PasswordCredential setPersistedTime(long persistedTime) {
-    this.persistedTime = persistedTime;
-    setPersistedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetPersistedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetPersistedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  public void setPersistedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
-  }
-
-  public String getToken() {
-    return this.token;
-  }
-
-  public PasswordCredential setToken(String token) {
-    this.token = token;
-    return this;
-  }
-
-  public void unsetToken() {
-    this.token = null;
-  }
-
-  /** Returns true if field token is set (has been assigned a value) and false otherwise */
-  public boolean isSetToken() {
-    return this.token != null;
-  }
-
-  public void setTokenIsSet(boolean value) {
-    if (!value) {
-      this.token = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case USERNAME:
-      if (value == null) {
-        unsetUsername();
-      } else {
-        setUsername((String)value);
-      }
-      break;
-
-    case PASSWORD:
-      if (value == null) {
-        unsetPassword();
-      } else {
-        setPassword((String)value);
-      }
-      break;
-
-    case PERSISTED_TIME:
-      if (value == null) {
-        unsetPersistedTime();
-      } else {
-        setPersistedTime((Long)value);
-      }
-      break;
-
-    case TOKEN:
-      if (value == null) {
-        unsetToken();
-      } else {
-        setToken((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case USERNAME:
-      return getUsername();
-
-    case PASSWORD:
-      return getPassword();
-
-    case PERSISTED_TIME:
-      return Long.valueOf(getPersistedTime());
-
-    case TOKEN:
-      return getToken();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case USERNAME:
-      return isSetUsername();
-    case PASSWORD:
-      return isSetPassword();
-    case PERSISTED_TIME:
-      return isSetPersistedTime();
-    case TOKEN:
-      return isSetToken();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof PasswordCredential)
-      return this.equals((PasswordCredential)that);
-    return false;
-  }
-
-  public boolean equals(PasswordCredential that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_username = true && this.isSetUsername();
-    boolean that_present_username = true && that.isSetUsername();
-    if (this_present_username || that_present_username) {
-      if (!(this_present_username && that_present_username))
-        return false;
-      if (!this.username.equals(that.username))
-        return false;
-    }
-
-    boolean this_present_password = true && this.isSetPassword();
-    boolean that_present_password = true && that.isSetPassword();
-    if (this_present_password || that_present_password) {
-      if (!(this_present_password && that_present_password))
-        return false;
-      if (!this.password.equals(that.password))
-        return false;
-    }
-
-    boolean this_present_persistedTime = true && this.isSetPersistedTime();
-    boolean that_present_persistedTime = true && that.isSetPersistedTime();
-    if (this_present_persistedTime || that_present_persistedTime) {
-      if (!(this_present_persistedTime && that_present_persistedTime))
-        return false;
-      if (this.persistedTime != that.persistedTime)
-        return false;
-    }
-
-    boolean this_present_token = true && this.isSetToken();
-    boolean that_present_token = true && that.isSetToken();
-    if (this_present_token || that_present_token) {
-      if (!(this_present_token && that_present_token))
-        return false;
-      if (!this.token.equals(that.token))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(PasswordCredential other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUsername()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPassword()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPersistedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetToken()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("PasswordCredential(");
-    boolean first = true;
-
-    sb.append("username:");
-    if (this.username == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.username);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("password:");
-    if (this.password == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.password);
-    }
-    first = false;
-    if (isSetPersistedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("persistedTime:");
-      sb.append(this.persistedTime);
-      first = false;
-    }
-    if (isSetToken()) {
-      if (!first) sb.append(", ");
-      sb.append("token:");
-      if (this.token == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.token);
-      }
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (username == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
-    }
-    if (password == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'password' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class PasswordCredentialStandardSchemeFactory implements SchemeFactory {
-    public PasswordCredentialStandardScheme getScheme() {
-      return new PasswordCredentialStandardScheme();
-    }
-  }
-
-  private static class PasswordCredentialStandardScheme extends StandardScheme<PasswordCredential> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, PasswordCredential struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // USERNAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.username = iprot.readString();
-              struct.setUsernameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // PASSWORD
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.password = iprot.readString();
-              struct.setPasswordIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // PERSISTED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.persistedTime = iprot.readI64();
-              struct.setPersistedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // TOKEN
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.token = iprot.readString();
-              struct.setTokenIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, PasswordCredential struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.username != null) {
-        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
-        oprot.writeString(struct.username);
-        oprot.writeFieldEnd();
-      }
-      if (struct.password != null) {
-        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
-        oprot.writeString(struct.password);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.persistedTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.token != null) {
-        if (struct.isSetToken()) {
-          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
-          oprot.writeString(struct.token);
-          oprot.writeFieldEnd();
-        }
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class PasswordCredentialTupleSchemeFactory implements SchemeFactory {
-    public PasswordCredentialTupleScheme getScheme() {
-      return new PasswordCredentialTupleScheme();
-    }
-  }
-
-  private static class PasswordCredentialTupleScheme extends TupleScheme<PasswordCredential> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.username);
-      oprot.writeString(struct.password);
-      BitSet optionals = new BitSet();
-      if (struct.isSetPersistedTime()) {
-        optionals.set(0);
-      }
-      if (struct.isSetToken()) {
-        optionals.set(1);
-      }
-      oprot.writeBitSet(optionals, 2);
-      if (struct.isSetPersistedTime()) {
-        oprot.writeI64(struct.persistedTime);
-      }
-      if (struct.isSetToken()) {
-        oprot.writeString(struct.token);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.username = iprot.readString();
-      struct.setUsernameIsSet(true);
-      struct.password = iprot.readString();
-      struct.setPasswordIsSet(true);
-      BitSet incoming = iprot.readBitSet(2);
-      if (incoming.get(0)) {
-        struct.persistedTime = iprot.readI64();
-        struct.setPersistedTimeIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.token = iprot.readString();
-        struct.setTokenIsSet(true);
-      }
-    }
-  }
-
-}
-


[21/62] [abbrv] airavata git commit: Reorganizing duplicate generated classed and instead using the stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
Reorganizing duplicate generated classed and instead using the  stubs artifact - AIRAVATA-1621


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: b25e0a5db9d137731a2bd0f9a7c2ed1368e6f0e7
Parents: 58c58cf
Author: Suresh Marru <sm...@apache.org>
Authored: Thu Mar 5 23:29:26 2015 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Thu Mar 5 23:29:26 2015 -0500

----------------------------------------------------------------------
 .../apache/airavata/common/utils/Constants.java |    4 +-
 .../credential-store-service/pom.xml            |  268 +-
 .../credential/store/client/TestSSLClient.java  |    8 +-
 .../store/cpi/CredentialStoreService.java       | 6888 ------------------
 .../store/cpi/cs_cpi_serviceConstants.java      |   55 -
 .../store/datamodel/CertificateCredential.java  | 1104 ---
 .../store/datamodel/CommunityUser.java          |  589 --
 .../store/datamodel/PasswordCredential.java     |  698 --
 .../store/datamodel/SSHCredential.java          |  998 ---
 .../store/datamodel/csDataModelConstants.java   |   55 -
 .../exception/CredentialStoreException.java     |  397 -
 .../store/server/CredentialStoreServer.java     |    4 +-
 .../server/CredentialStoreServerHandler.java    |   10 +-
 13 files changed, 150 insertions(+), 10928 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
index fd17064..154bea1 100644
--- a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
@@ -41,8 +41,8 @@ public final class Constants {
     public static final String ORCHESTRATOR_SERVER_PORT = "orchestrator.server.port";
     public static final String GFAC_SERVER_HOST = "gfac.server.host";
     public static final String GFAC_SERVER_PORT = "gfac.server.port";
-    public static final String CREDNETIAL_SERVER_HOST = "credential.store.server.host";
-    public static final String CREDNETIAL_SERVER_PORT = "credential.store.server.port";
+    public static final String CREDENTIAL_SERVER_HOST = "credential.store.server.host";
+    public static final String CREDENTIAL_SERVER_PORT = "credential.store.server.port";
     public static final String ZOOKEEPER_EXPERIMENT_CATALOG = "experiment-catalog";
     public static final String ZOOKEEPER_APPCATALOG = "app-catalog";
     public static final String ZOOKEEPER_RABBITMQ = "rabbit-mq";

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/pom.xml b/modules/credential-store/credential-store-service/pom.xml
index d8af25f..1595ed6 100644
--- a/modules/credential-store/credential-store-service/pom.xml
+++ b/modules/credential-store/credential-store-service/pom.xml
@@ -11,144 +11,150 @@
 	OF ANY ~ KIND, either express or implied. See the License for the specific 
 	language governing permissions and limitations under the License. -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<groupId>org.apache.airavata</groupId>
-		<artifactId>airavata</artifactId>
-		<version>0.15-SNAPSHOT</version>
-		<relativePath>../../../pom.xml</relativePath>
-	</parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata</artifactId>
+        <version>0.15-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
 
-	<modelVersion>4.0.0</modelVersion>
-	<artifactId>airavata-credential-store</artifactId>
-	<name>Airavata Credential Store</name>
-	<description>Module to manage credentials</description>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>airavata-credential-store</artifactId>
+    <name>Airavata Credential Store</name>
+    <description>Module to manage credentials</description>
 
-	<dependencies>
-		<dependency>
-			<groupId>edu.uiuc.ncsa.myproxy</groupId>
-			<artifactId>oa4mp-client-api</artifactId>
-			<version>${oa4mp.version}</version>
-		</dependency>
-		<dependency>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-credential-store-stubs</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>edu.uiuc.ncsa.myproxy</groupId>
+            <artifactId>oa4mp-client-api</artifactId>
+            <version>${oa4mp.version}</version>
+        </dependency>
+        <dependency>
             <groupId>edu.uiuc.ncsa.myproxy</groupId>
             <artifactId>oa4mp-client-loader-oauth1</artifactId>
             <version>${oa4mp.version}</version>
             <exclusions>
-        	<exclusion>
-          		<groupId>net.oauth.core</groupId> 
-          		<artifactId>oauth-httpclient4</artifactId>
-        	</exclusion>
-			<exclusion>
-				<groupId>net.oauth.core</groupId>
-				<artifactId>oauth-consumer</artifactId>
-			</exclusion>
-			<exclusion>
-				<groupId>mysql</groupId>
-				<artifactId>mysql-connector-java</artifactId>
-			</exclusion>
-			<exclusion>
-				<groupId>postgresql</groupId>
-				<artifactId>postgresql</artifactId>
-			</exclusion>
+                <exclusion>
+                    <groupId>net.oauth.core</groupId>
+                    <artifactId>oauth-httpclient4</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>net.oauth.core</groupId>
+                    <artifactId>oauth-consumer</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>mysql</groupId>
+                    <artifactId>mysql-connector-java</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>postgresql</groupId>
+                    <artifactId>postgresql</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.7</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derby</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbyclient</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbynet</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbytools</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>commons-dbcp</groupId>
-			<artifactId>commons-dbcp</artifactId>
-			<version>1.4</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-common-utils</artifactId>
-			<version>${project.version}</version>
-		</dependency> 
-		<dependency>
-			<groupId>com.jcraft</groupId>
-			<artifactId>jsch</artifactId>
-			<version>0.1.50</version>
-		</dependency>
-		<dependency>
-			<groupId>javax.servlet</groupId>
-			<artifactId>servlet-api</artifactId>
-			<version>2.5</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-email</artifactId>
-			<version>1.3.2</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>1.3.2</version>
-		</dependency>
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<version>${surefire.version}</version>
-				<inherited>true</inherited>
-				<configuration>
-					<systemPropertyVariables>
-						<credential.module.directory>${basedir}</credential.module.directory>
-					</systemPropertyVariables>
-					<excludes>
-						<exclude>**/DAOBaseTestCase.java</exclude>
-						<exclude>**/MappingDAOTest.java</exclude>
-					</excludes>
-					<testSourceDirectory>${basedir}\src\test\java\</testSourceDirectory>
-				</configuration>
-			</plugin>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.7</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>${derby.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <version>${derby.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbynet</artifactId>
+            <version>${derby.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbytools</artifactId>
+            <version>${derby.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <version>1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <version>0.1.50</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-email</artifactId>
+            <version>1.3.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>1.3.2</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>${surefire.version}</version>
+                <inherited>true</inherited>
+                <configuration>
+                    <systemPropertyVariables>
+                        <credential.module.directory>${basedir}</credential.module.directory>
+                    </systemPropertyVariables>
+                    <excludes>
+                        <exclude>**/DAOBaseTestCase.java</exclude>
+                        <exclude>**/MappingDAOTest.java</exclude>
+                    </excludes>
+                    <testSourceDirectory>${basedir}\src\test\java\</testSourceDirectory>
+                </configuration>
+            </plugin>
 
-		</plugins>
-		<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
-		<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
-		<testResources>
-			<testResource>
-				<directory>${project.basedir}/src/test/resources</directory>
-			</testResource>
-		</testResources>
-	</build>
+        </plugins>
+        <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
+        <testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
+        <testResources>
+            <testResource>
+                <directory>${project.basedir}/src/test/resources</directory>
+            </testResource>
+        </testResources>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
index 12105e2..cc5ebb6 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
@@ -56,8 +56,8 @@ public class TestSSLClient {
             String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
             String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
             params.setTrustStore(keystorePath, keystorePWD);
-            final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_PORT, "8960"));
-            final String serverHost = ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_HOST, null);
+            final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_PORT, "8960"));
+            final String serverHost = ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_HOST, null);
 
             transport = TSSLTransportFactory.getClientSocket(serverHost, serverPort, 10000, params);
             TProtocol protocol = new TBinaryProtocol(transport);
@@ -98,7 +98,7 @@ public class TestSSLClient {
             certificateCredential.setCommunityUser(communityUser);
             X509Certificate[] x509Certificates = new X509Certificate[1];
             KeyStore ks = KeyStore.getInstance("JKS");
-            File keyStoreFile = new File("/Users/chathuri/dev/airavata/credential-store/oa4mp/airavata.jks");
+            File keyStoreFile = new File("/Users/smarru/code/airavata-master/modules/configuration/server/src/main/resources/airavata.jks");
             FileInputStream fis = new FileInputStream(keyStoreFile);
             char[] password = "airavata".toCharArray();
             ks.load(fis,password);
@@ -114,7 +114,7 @@ public class TestSSLClient {
             System.out.println("Certificate Token :" + token);
             CertificateCredential credential = client.getCertificateCredential(token, "testGateway");
             System.out.println("certificate : " + credential.getX509Cert());
-            System.out.println("gateway name  : " + credential.getCommunityUser().getGatewayNmae());
+            System.out.println("gateway name  : " + credential.getCommunityUser().getGatewayName());
         }catch (TTransportException e) {
             e.printStackTrace();
         } catch (TException e) {


[46/62] [abbrv] airavata git commit: fixing LSF issues

Posted by la...@apache.org.
fixing LSF issues


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/13b480d8
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/13b480d8
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/13b480d8

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 13b480d84cdfcaf110536688309834122db8917e
Parents: c2bacf2 10c5abf
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Wed Mar 11 16:21:50 2015 -0400
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Wed Mar 11 16:21:50 2015 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |   34 +-
 .../java/org/apache/airavata/api/Airavata.java  | 5264 +++++++++++-------
 .../main/resources/lib/airavata/Airavata.cpp    |  381 ++
 .../src/main/resources/lib/airavata/Airavata.h  |  161 +
 .../lib/airavata/Airavata_server.skeleton.cpp   |    5 +
 .../lib/airavata/computeResourceModel_types.cpp |  203 +-
 .../lib/airavata/computeResourceModel_types.h   |   38 +-
 .../resources/lib/Airavata/API/Airavata.php     |  296 +
 .../Model/AppCatalog/ComputeResource/Types.php  |   49 +
 .../client/samples/CreateLaunchExperiment.java  |  584 +-
 .../tools/RegisterSampleApplications.java       |  158 +-
 .../computeresource/AuthenticationMode.java     |   70 +
 .../computeresource/UnicoreJobSubmission.java   |  222 +-
 .../airavataAPI.thrift                          |    6 +
 .../computeResourceModel.thrift                 |   25 +-
 .../catalog/data/impl/ComputeResourceImpl.java  |    1 +
 .../data/model/UnicoreJobSubmission.java        |   16 +-
 .../data/resources/AbstractResource.java        |    1 +
 .../resources/UnicoreJobSubmissionResource.java |   39 +-
 .../catalog/data/util/AppCatalogJPAUtils.java   |    1 +
 .../data/util/AppCatalogThriftConversion.java   |    3 +-
 .../src/main/resources/appcatalog-derby.sql     |    1 +
 .../src/main/resources/appcatalog-mysql.sql     |    1 +
 .../registry/jpa/impl/ExperimentRegistry.java   |    3 +
 24 files changed, 5039 insertions(+), 2523 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/13b480d8/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --cc airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index b5a5bcc,bb914fa..ed141b9
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@@ -58,13 -58,13 +58,13 @@@ public class CreateLaunchExperiment 
      private static final String DEFAULT_GATEWAY = "php_reference_gateway";
      private static Airavata.Client airavataClient;
  
 -    private static String echoAppId = "Echo_8506337e-ab7a-46b6-9b71-4a461b6c5e35";
 +    private static String echoAppId = "Echo_61988d1f-7ca9-47ba-9212-a0ac2e973cf1";
      private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
      private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
-     private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
+     private static String amberAppId = "Amber_aa083c86-4680-4002-b3ef-fad93c181926";
      private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
      private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
 -    private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f";
 +    private static String lammpsAppId = "LAMMPS_2472685b-8acf-497e-aafe-cc66fe5f4cb6";
      private static String nwchemAppId = "NWChem_2c8fee64-acf9-4a89-b6d3-91eb53c7640c";
      private static String trinityAppId = "Trinity_e894acf5-9bca-46e8-a1bd-7e2d5155191a";
      private static String autodockAppId = "AutoDock_43d9fdd0-c404-49f4-b913-3abf9080a8c9";
@@@ -162,7 -183,6 +183,7 @@@
  //                final String expId = createExperimentTRINITYStampede(airavataClient);
  //                final String expId = createExperimentAUTODOCKStampede(airavataClient); // this is not working , we need to register AutoDock app on stampede
  //                final String expId = createExperimentForLSF(airavataClient);
-                 final String expId = createExperimentLAMMPSForLSF(airavataClient);
++//                final String expId = createExperimentLAMMPSForLSF(airavataClient);
  //            	  final String expId = "Ultrascan_ln_eb029947-391a-4ccf-8ace-9bafebe07cc0";
                  System.out.println("Experiment ID : " + expId);
  //                updateExperiment(airavata, expId);
@@@ -1356,8 -1112,9 +1113,7 @@@
              for (InputDataObjectType inputDataObjectType : exInputs) {
                  inputDataObjectType.setValue("Hello World");
              }
 -        
              List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
- 
 -          
              Project project = ProjectModelUtil.createProject("default", "lg11w", "test project");
              String projectId = client.createProject(DEFAULT_GATEWAY, project);
  

http://git-wip-us.apache.org/repos/asf/airavata/blob/13b480d8/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------


[54/62] [abbrv] airavata git commit: moved userdn part to the more dynamic userconfiguration model

Posted by la...@apache.org.
moved userdn part to the more dynamic userconfiguration model 

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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: a4fb48915283c93af7d4a19076a6d81fec597f64
Parents: 73858d1
Author: msmemon <sh...@gmail.com>
Authored: Sun Mar 15 16:29:27 2015 +0100
Committer: msmemon <sh...@gmail.com>
Committed: Sun Mar 15 16:29:27 2015 +0100

----------------------------------------------------------------------
 .../lib/airavata/computeResourceModel_types.cpp | 203 +++++++----------
 .../lib/airavata/computeResourceModel_types.h   |  38 +---
 .../lib/airavata/experimentModel_types.cpp      |  36 ++-
 .../lib/airavata/experimentModel_types.h        |  34 ++-
 .../Model/AppCatalog/ComputeResource/Types.php  |  49 -----
 .../Model/Workspace/Experiment/Types.php        |  40 ++++
 .../computeresource/UnicoreJobSubmission.java   | 220 +------------------
 .../experiment/UserConfigurationData.java       | 205 ++++++++++++++++-
 .../computeResourceModel.thrift                 |  19 --
 .../experimentModel.thrift                      |   8 +-
 .../catalog/data/impl/ComputeResourceImpl.java  |   1 -
 .../data/model/UnicoreJobSubmission.java        |  13 --
 .../data/resources/AbstractResource.java        |   2 +-
 .../resources/UnicoreJobSubmissionResource.java |  27 +--
 .../catalog/data/util/AppCatalogJPAUtils.java   |   1 -
 .../data/util/AppCatalogThriftConversion.java   |   2 -
 .../src/main/resources/appcatalog-derby.sql     |   1 -
 .../src/main/resources/appcatalog-mysql.sql     |   1 -
 .../gfac/bes/provider/impl/BESProvider.java     |  10 +-
 19 files changed, 403 insertions(+), 507 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
index 4d52172..d54c519 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.cpp
@@ -137,16 +137,6 @@ const char* _kDataMovementProtocolNames[] = {
 };
 const std::map<int, const char*> _DataMovementProtocol_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kDataMovementProtocolValues, _kDataMovementProtocolNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
 
-int _kAuthenticationModeValues[] = {
-  AuthenticationMode::SERVER_ISSUED,
-  AuthenticationMode::MYPROXY_ISSUED
-};
-const char* _kAuthenticationModeNames[] = {
-  "SERVER_ISSUED",
-  "MYPROXY_ISSUED"
-};
-const std::map<int, const char*> _AuthenticationMode_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kAuthenticationModeValues, _kAuthenticationModeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
-
 int _kProviderNameValues[] = {
   ProviderName::EC2,
   ProviderName::AWSEC2,
@@ -1190,8 +1180,8 @@ void swap(GlobusJobSubmission &a, GlobusJobSubmission &b) {
   swap(a.__isset, b.__isset);
 }
 
-const char* UnicoreJobSubmission::ascii_fingerprint = "06B870319715692996F28828C4AF836C";
-const uint8_t UnicoreJobSubmission::binary_fingerprint[16] = {0x06,0xB8,0x70,0x31,0x97,0x15,0x69,0x29,0x96,0xF2,0x88,0x28,0xC4,0xAF,0x83,0x6C};
+const char* UnicoreJobSubmission::ascii_fingerprint = "D9F4CFE2F293A8B1052FD3031DD2C847";
+const uint8_t UnicoreJobSubmission::binary_fingerprint[16] = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47};
 
 uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -1207,7 +1197,6 @@ uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot
   bool isset_jobSubmissionInterfaceId = false;
   bool isset_securityProtocol = false;
   bool isset_unicoreEndPointURL = false;
-  bool isset_authenticationMode = false;
 
   while (true)
   {
@@ -1243,24 +1232,6 @@ uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot
           xfer += iprot->skip(ftype);
         }
         break;
-      case 4:
-        if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast29;
-          xfer += iprot->readI32(ecast29);
-          this->authenticationMode = (AuthenticationMode::type)ecast29;
-          isset_authenticationMode = true;
-        } else {
-          xfer += iprot->skip(ftype);
-        }
-        break;
-      case 5:
-        if (ftype == ::apache::thrift::protocol::T_STRING) {
-          xfer += iprot->readString(this->userDN);
-          this->__isset.userDN = true;
-        } else {
-          xfer += iprot->skip(ftype);
-        }
-        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -1276,8 +1247,6 @@ uint32_t UnicoreJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot
     throw TProtocolException(TProtocolException::INVALID_DATA);
   if (!isset_unicoreEndPointURL)
     throw TProtocolException(TProtocolException::INVALID_DATA);
-  if (!isset_authenticationMode)
-    throw TProtocolException(TProtocolException::INVALID_DATA);
   return xfer;
 }
 
@@ -1297,15 +1266,6 @@ uint32_t UnicoreJobSubmission::write(::apache::thrift::protocol::TProtocol* opro
   xfer += oprot->writeString(this->unicoreEndPointURL);
   xfer += oprot->writeFieldEnd();
 
-  xfer += oprot->writeFieldBegin("authenticationMode", ::apache::thrift::protocol::T_I32, 4);
-  xfer += oprot->writeI32((int32_t)this->authenticationMode);
-  xfer += oprot->writeFieldEnd();
-
-  if (this->__isset.userDN) {
-    xfer += oprot->writeFieldBegin("userDN", ::apache::thrift::protocol::T_STRING, 5);
-    xfer += oprot->writeString(this->userDN);
-    xfer += oprot->writeFieldEnd();
-  }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
   return xfer;
@@ -1316,9 +1276,6 @@ void swap(UnicoreJobSubmission &a, UnicoreJobSubmission &b) {
   swap(a.jobSubmissionInterfaceId, b.jobSubmissionInterfaceId);
   swap(a.securityProtocol, b.securityProtocol);
   swap(a.unicoreEndPointURL, b.unicoreEndPointURL);
-  swap(a.authenticationMode, b.authenticationMode);
-  swap(a.userDN, b.userDN);
-  swap(a.__isset, b.__isset);
 }
 
 const char* CloudJobSubmission::ascii_fingerprint = "F98AE2E6E51F2426504F2566EB71B5CC";
@@ -1360,9 +1317,9 @@ uint32_t CloudJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot)
         break;
       case 2:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast30;
-          xfer += iprot->readI32(ecast30);
-          this->securityProtocol = (SecurityProtocol::type)ecast30;
+          int32_t ecast29;
+          xfer += iprot->readI32(ecast29);
+          this->securityProtocol = (SecurityProtocol::type)ecast29;
           isset_securityProtocol = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1386,9 +1343,9 @@ uint32_t CloudJobSubmission::read(::apache::thrift::protocol::TProtocol* iprot)
         break;
       case 5:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast31;
-          xfer += iprot->readI32(ecast31);
-          this->providerName = (ProviderName::type)ecast31;
+          int32_t ecast30;
+          xfer += iprot->readI32(ecast30);
+          this->providerName = (ProviderName::type)ecast30;
           isset_providerName = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1505,9 +1462,9 @@ uint32_t JobSubmissionInterface::read(::apache::thrift::protocol::TProtocol* ipr
         break;
       case 2:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast32;
-          xfer += iprot->readI32(ecast32);
-          this->jobSubmissionProtocol = (JobSubmissionProtocol::type)ecast32;
+          int32_t ecast31;
+          xfer += iprot->readI32(ecast31);
+          this->jobSubmissionProtocol = (JobSubmissionProtocol::type)ecast31;
           isset_jobSubmissionProtocol = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1603,9 +1560,9 @@ uint32_t DataMovementInterface::read(::apache::thrift::protocol::TProtocol* ipro
         break;
       case 2:
         if (ftype == ::apache::thrift::protocol::T_I32) {
-          int32_t ecast33;
-          xfer += iprot->readI32(ecast33);
-          this->dataMovementProtocol = (DataMovementProtocol::type)ecast33;
+          int32_t ecast32;
+          xfer += iprot->readI32(ecast32);
+          this->dataMovementProtocol = (DataMovementProtocol::type)ecast32;
           isset_dataMovementProtocol = true;
         } else {
           xfer += iprot->skip(ftype);
@@ -1710,14 +1667,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->hostAliases.clear();
-            uint32_t _size34;
-            ::apache::thrift::protocol::TType _etype37;
-            xfer += iprot->readListBegin(_etype37, _size34);
-            this->hostAliases.resize(_size34);
-            uint32_t _i38;
-            for (_i38 = 0; _i38 < _size34; ++_i38)
+            uint32_t _size33;
+            ::apache::thrift::protocol::TType _etype36;
+            xfer += iprot->readListBegin(_etype36, _size33);
+            this->hostAliases.resize(_size33);
+            uint32_t _i37;
+            for (_i37 = 0; _i37 < _size33; ++_i37)
             {
-              xfer += iprot->readString(this->hostAliases[_i38]);
+              xfer += iprot->readString(this->hostAliases[_i37]);
             }
             xfer += iprot->readListEnd();
           }
@@ -1730,14 +1687,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->ipAddresses.clear();
-            uint32_t _size39;
-            ::apache::thrift::protocol::TType _etype42;
-            xfer += iprot->readListBegin(_etype42, _size39);
-            this->ipAddresses.resize(_size39);
-            uint32_t _i43;
-            for (_i43 = 0; _i43 < _size39; ++_i43)
+            uint32_t _size38;
+            ::apache::thrift::protocol::TType _etype41;
+            xfer += iprot->readListBegin(_etype41, _size38);
+            this->ipAddresses.resize(_size38);
+            uint32_t _i42;
+            for (_i42 = 0; _i42 < _size38; ++_i42)
             {
-              xfer += iprot->readString(this->ipAddresses[_i43]);
+              xfer += iprot->readString(this->ipAddresses[_i42]);
             }
             xfer += iprot->readListEnd();
           }
@@ -1758,14 +1715,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->batchQueues.clear();
-            uint32_t _size44;
-            ::apache::thrift::protocol::TType _etype47;
-            xfer += iprot->readListBegin(_etype47, _size44);
-            this->batchQueues.resize(_size44);
-            uint32_t _i48;
-            for (_i48 = 0; _i48 < _size44; ++_i48)
+            uint32_t _size43;
+            ::apache::thrift::protocol::TType _etype46;
+            xfer += iprot->readListBegin(_etype46, _size43);
+            this->batchQueues.resize(_size43);
+            uint32_t _i47;
+            for (_i47 = 0; _i47 < _size43; ++_i47)
             {
-              xfer += this->batchQueues[_i48].read(iprot);
+              xfer += this->batchQueues[_i47].read(iprot);
             }
             xfer += iprot->readListEnd();
           }
@@ -1778,19 +1735,19 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_MAP) {
           {
             this->fileSystems.clear();
-            uint32_t _size49;
-            ::apache::thrift::protocol::TType _ktype50;
-            ::apache::thrift::protocol::TType _vtype51;
-            xfer += iprot->readMapBegin(_ktype50, _vtype51, _size49);
-            uint32_t _i53;
-            for (_i53 = 0; _i53 < _size49; ++_i53)
+            uint32_t _size48;
+            ::apache::thrift::protocol::TType _ktype49;
+            ::apache::thrift::protocol::TType _vtype50;
+            xfer += iprot->readMapBegin(_ktype49, _vtype50, _size48);
+            uint32_t _i52;
+            for (_i52 = 0; _i52 < _size48; ++_i52)
             {
-              FileSystems::type _key54;
-              int32_t ecast56;
-              xfer += iprot->readI32(ecast56);
-              _key54 = (FileSystems::type)ecast56;
-              std::string& _val55 = this->fileSystems[_key54];
-              xfer += iprot->readString(_val55);
+              FileSystems::type _key53;
+              int32_t ecast55;
+              xfer += iprot->readI32(ecast55);
+              _key53 = (FileSystems::type)ecast55;
+              std::string& _val54 = this->fileSystems[_key53];
+              xfer += iprot->readString(_val54);
             }
             xfer += iprot->readMapEnd();
           }
@@ -1803,14 +1760,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->jobSubmissionInterfaces.clear();
-            uint32_t _size57;
-            ::apache::thrift::protocol::TType _etype60;
-            xfer += iprot->readListBegin(_etype60, _size57);
-            this->jobSubmissionInterfaces.resize(_size57);
-            uint32_t _i61;
-            for (_i61 = 0; _i61 < _size57; ++_i61)
+            uint32_t _size56;
+            ::apache::thrift::protocol::TType _etype59;
+            xfer += iprot->readListBegin(_etype59, _size56);
+            this->jobSubmissionInterfaces.resize(_size56);
+            uint32_t _i60;
+            for (_i60 = 0; _i60 < _size56; ++_i60)
             {
-              xfer += this->jobSubmissionInterfaces[_i61].read(iprot);
+              xfer += this->jobSubmissionInterfaces[_i60].read(iprot);
             }
             xfer += iprot->readListEnd();
           }
@@ -1823,14 +1780,14 @@ uint32_t ComputeResourceDescription::read(::apache::thrift::protocol::TProtocol*
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->dataMovementInterfaces.clear();
-            uint32_t _size62;
-            ::apache::thrift::protocol::TType _etype65;
-            xfer += iprot->readListBegin(_etype65, _size62);
-            this->dataMovementInterfaces.resize(_size62);
-            uint32_t _i66;
-            for (_i66 = 0; _i66 < _size62; ++_i66)
+            uint32_t _size61;
+            ::apache::thrift::protocol::TType _etype64;
+            xfer += iprot->readListBegin(_etype64, _size61);
+            this->dataMovementInterfaces.resize(_size61);
+            uint32_t _i65;
+            for (_i65 = 0; _i65 < _size61; ++_i65)
             {
-              xfer += this->dataMovementInterfaces[_i66].read(iprot);
+              xfer += this->dataMovementInterfaces[_i65].read(iprot);
             }
             xfer += iprot->readListEnd();
           }
@@ -1879,10 +1836,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("hostAliases", ::apache::thrift::protocol::T_LIST, 3);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->hostAliases.size()));
-      std::vector<std::string> ::const_iterator _iter67;
-      for (_iter67 = this->hostAliases.begin(); _iter67 != this->hostAliases.end(); ++_iter67)
+      std::vector<std::string> ::const_iterator _iter66;
+      for (_iter66 = this->hostAliases.begin(); _iter66 != this->hostAliases.end(); ++_iter66)
       {
-        xfer += oprot->writeString((*_iter67));
+        xfer += oprot->writeString((*_iter66));
       }
       xfer += oprot->writeListEnd();
     }
@@ -1892,10 +1849,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("ipAddresses", ::apache::thrift::protocol::T_LIST, 4);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->ipAddresses.size()));
-      std::vector<std::string> ::const_iterator _iter68;
-      for (_iter68 = this->ipAddresses.begin(); _iter68 != this->ipAddresses.end(); ++_iter68)
+      std::vector<std::string> ::const_iterator _iter67;
+      for (_iter67 = this->ipAddresses.begin(); _iter67 != this->ipAddresses.end(); ++_iter67)
       {
-        xfer += oprot->writeString((*_iter68));
+        xfer += oprot->writeString((*_iter67));
       }
       xfer += oprot->writeListEnd();
     }
@@ -1910,10 +1867,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("batchQueues", ::apache::thrift::protocol::T_LIST, 6);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->batchQueues.size()));
-      std::vector<BatchQueue> ::const_iterator _iter69;
-      for (_iter69 = this->batchQueues.begin(); _iter69 != this->batchQueues.end(); ++_iter69)
+      std::vector<BatchQueue> ::const_iterator _iter68;
+      for (_iter68 = this->batchQueues.begin(); _iter68 != this->batchQueues.end(); ++_iter68)
       {
-        xfer += (*_iter69).write(oprot);
+        xfer += (*_iter68).write(oprot);
       }
       xfer += oprot->writeListEnd();
     }
@@ -1923,11 +1880,11 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("fileSystems", ::apache::thrift::protocol::T_MAP, 7);
     {
       xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_I32, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->fileSystems.size()));
-      std::map<FileSystems::type, std::string> ::const_iterator _iter70;
-      for (_iter70 = this->fileSystems.begin(); _iter70 != this->fileSystems.end(); ++_iter70)
+      std::map<FileSystems::type, std::string> ::const_iterator _iter69;
+      for (_iter69 = this->fileSystems.begin(); _iter69 != this->fileSystems.end(); ++_iter69)
       {
-        xfer += oprot->writeI32((int32_t)_iter70->first);
-        xfer += oprot->writeString(_iter70->second);
+        xfer += oprot->writeI32((int32_t)_iter69->first);
+        xfer += oprot->writeString(_iter69->second);
       }
       xfer += oprot->writeMapEnd();
     }
@@ -1937,10 +1894,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("jobSubmissionInterfaces", ::apache::thrift::protocol::T_LIST, 8);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->jobSubmissionInterfaces.size()));
-      std::vector<JobSubmissionInterface> ::const_iterator _iter71;
-      for (_iter71 = this->jobSubmissionInterfaces.begin(); _iter71 != this->jobSubmissionInterfaces.end(); ++_iter71)
+      std::vector<JobSubmissionInterface> ::const_iterator _iter70;
+      for (_iter70 = this->jobSubmissionInterfaces.begin(); _iter70 != this->jobSubmissionInterfaces.end(); ++_iter70)
       {
-        xfer += (*_iter71).write(oprot);
+        xfer += (*_iter70).write(oprot);
       }
       xfer += oprot->writeListEnd();
     }
@@ -1950,10 +1907,10 @@ uint32_t ComputeResourceDescription::write(::apache::thrift::protocol::TProtocol
     xfer += oprot->writeFieldBegin("dataMovementInterfaces", ::apache::thrift::protocol::T_LIST, 9);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->dataMovementInterfaces.size()));
-      std::vector<DataMovementInterface> ::const_iterator _iter72;
-      for (_iter72 = this->dataMovementInterfaces.begin(); _iter72 != this->dataMovementInterfaces.end(); ++_iter72)
+      std::vector<DataMovementInterface> ::const_iterator _iter71;
+      for (_iter71 = this->dataMovementInterfaces.begin(); _iter71 != this->dataMovementInterfaces.end(); ++_iter71)
       {
-        xfer += (*_iter72).write(oprot);
+        xfer += (*_iter71).write(oprot);
       }
       xfer += oprot->writeListEnd();
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
index b1b70d5..76037b2 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/computeResourceModel_types.h
@@ -117,15 +117,6 @@ struct DataMovementProtocol {
 
 extern const std::map<int, const char*> _DataMovementProtocol_VALUES_TO_NAMES;
 
-struct AuthenticationMode {
-  enum type {
-    SERVER_ISSUED = 0,
-    MYPROXY_ISSUED = 1
-  };
-};
-
-extern const std::map<int, const char*> _AuthenticationMode_VALUES_TO_NAMES;
-
 struct ProviderName {
   enum type {
     EC2 = 0,
@@ -729,18 +720,14 @@ class GlobusJobSubmission {
 
 void swap(GlobusJobSubmission &a, GlobusJobSubmission &b);
 
-typedef struct _UnicoreJobSubmission__isset {
-  _UnicoreJobSubmission__isset() : userDN(false) {}
-  bool userDN;
-} _UnicoreJobSubmission__isset;
 
 class UnicoreJobSubmission {
  public:
 
-  static const char* ascii_fingerprint; // = "06B870319715692996F28828C4AF836C";
-  static const uint8_t binary_fingerprint[16]; // = {0x06,0xB8,0x70,0x31,0x97,0x15,0x69,0x29,0x96,0xF2,0x88,0x28,0xC4,0xAF,0x83,0x6C};
+  static const char* ascii_fingerprint; // = "D9F4CFE2F293A8B1052FD3031DD2C847";
+  static const uint8_t binary_fingerprint[16]; // = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47};
 
-  UnicoreJobSubmission() : jobSubmissionInterfaceId("DO_NOT_SET_AT_CLIENTS"), securityProtocol((SecurityProtocol::type)0), unicoreEndPointURL(), authenticationMode((AuthenticationMode::type)0), userDN() {
+  UnicoreJobSubmission() : jobSubmissionInterfaceId("DO_NOT_SET_AT_CLIENTS"), securityProtocol((SecurityProtocol::type)0), unicoreEndPointURL() {
   }
 
   virtual ~UnicoreJobSubmission() throw() {}
@@ -748,10 +735,6 @@ class UnicoreJobSubmission {
   std::string jobSubmissionInterfaceId;
   SecurityProtocol::type securityProtocol;
   std::string unicoreEndPointURL;
-  AuthenticationMode::type authenticationMode;
-  std::string userDN;
-
-  _UnicoreJobSubmission__isset __isset;
 
   void __set_jobSubmissionInterfaceId(const std::string& val) {
     jobSubmissionInterfaceId = val;
@@ -765,15 +748,6 @@ class UnicoreJobSubmission {
     unicoreEndPointURL = val;
   }
 
-  void __set_authenticationMode(const AuthenticationMode::type val) {
-    authenticationMode = val;
-  }
-
-  void __set_userDN(const std::string& val) {
-    userDN = val;
-    __isset.userDN = true;
-  }
-
   bool operator == (const UnicoreJobSubmission & rhs) const
   {
     if (!(jobSubmissionInterfaceId == rhs.jobSubmissionInterfaceId))
@@ -782,12 +756,6 @@ class UnicoreJobSubmission {
       return false;
     if (!(unicoreEndPointURL == rhs.unicoreEndPointURL))
       return false;
-    if (!(authenticationMode == rhs.authenticationMode))
-      return false;
-    if (__isset.userDN != rhs.__isset.userDN)
-      return false;
-    else if (__isset.userDN && !(userDN == rhs.userDN))
-      return false;
     return true;
   }
   bool operator != (const UnicoreJobSubmission &rhs) const {

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
index 2f1d21b..fe7890f 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.cpp
@@ -1195,8 +1195,8 @@ void swap(QualityOfServiceParams &a, QualityOfServiceParams &b) {
   swap(a.__isset, b.__isset);
 }
 
-const char* UserConfigurationData::ascii_fingerprint = "A39B8E6345C677771D939D170C65720F";
-const uint8_t UserConfigurationData::binary_fingerprint[16] = {0xA3,0x9B,0x8E,0x63,0x45,0xC6,0x77,0x77,0x1D,0x93,0x9D,0x17,0x0C,0x65,0x72,0x0F};
+const char* UserConfigurationData::ascii_fingerprint = "0EA9FCA690C445780E02BCAC89B1D820";
+const uint8_t UserConfigurationData::binary_fingerprint[16] = {0x0E,0xA9,0xFC,0xA6,0x90,0xC4,0x45,0x78,0x0E,0x02,0xBC,0xAC,0x89,0xB1,0xD8,0x20};
 
 uint32_t UserConfigurationData::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -1284,6 +1284,22 @@ uint32_t UserConfigurationData::read(::apache::thrift::protocol::TProtocol* ipro
           xfer += iprot->skip(ftype);
         }
         break;
+      case 9:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->userDN);
+          this->__isset.userDN = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 10:
+        if (ftype == ::apache::thrift::protocol::T_BOOL) {
+          xfer += iprot->readBool(this->generateCert);
+          this->__isset.generateCert = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -1342,6 +1358,16 @@ uint32_t UserConfigurationData::write(::apache::thrift::protocol::TProtocol* opr
     xfer += oprot->writeBool(this->throttleResources);
     xfer += oprot->writeFieldEnd();
   }
+  if (this->__isset.userDN) {
+    xfer += oprot->writeFieldBegin("userDN", ::apache::thrift::protocol::T_STRING, 9);
+    xfer += oprot->writeString(this->userDN);
+    xfer += oprot->writeFieldEnd();
+  }
+  if (this->__isset.generateCert) {
+    xfer += oprot->writeFieldBegin("generateCert", ::apache::thrift::protocol::T_BOOL, 10);
+    xfer += oprot->writeBool(this->generateCert);
+    xfer += oprot->writeFieldEnd();
+  }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
   return xfer;
@@ -1357,6 +1383,8 @@ void swap(UserConfigurationData &a, UserConfigurationData &b) {
   swap(a.advanceOutputDataHandling, b.advanceOutputDataHandling);
   swap(a.qosParams, b.qosParams);
   swap(a.throttleResources, b.throttleResources);
+  swap(a.userDN, b.userDN);
+  swap(a.generateCert, b.generateCert);
   swap(a.__isset, b.__isset);
 }
 
@@ -2708,8 +2736,8 @@ void swap(ValidationResults &a, ValidationResults &b) {
   swap(a.validationResultList, b.validationResultList);
 }
 
-const char* Experiment::ascii_fingerprint = "C610216A34DE0B4389362B3D5236F6F6";
-const uint8_t Experiment::binary_fingerprint[16] = {0xC6,0x10,0x21,0x6A,0x34,0xDE,0x0B,0x43,0x89,0x36,0x2B,0x3D,0x52,0x36,0xF6,0xF6};
+const char* Experiment::ascii_fingerprint = "AAB7BCD0F1CB7A0198FEF5DB532788A8";
+const uint8_t Experiment::binary_fingerprint[16] = {0xAA,0xB7,0xBC,0xD0,0xF1,0xCB,0x7A,0x01,0x98,0xFE,0xF5,0xDB,0x53,0x27,0x88,0xA8};
 
 uint32_t Experiment::read(::apache::thrift::protocol::TProtocol* iprot) {
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
index 15c0d4c..b09c480 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experimentModel_types.h
@@ -855,22 +855,24 @@ class QualityOfServiceParams {
 void swap(QualityOfServiceParams &a, QualityOfServiceParams &b);
 
 typedef struct _UserConfigurationData__isset {
-  _UserConfigurationData__isset() : shareExperimentPublicly(true), computationalResourceScheduling(false), advanceInputDataHandling(false), advanceOutputDataHandling(false), qosParams(false), throttleResources(true) {}
+  _UserConfigurationData__isset() : shareExperimentPublicly(true), computationalResourceScheduling(false), advanceInputDataHandling(false), advanceOutputDataHandling(false), qosParams(false), throttleResources(true), userDN(false), generateCert(true) {}
   bool shareExperimentPublicly;
   bool computationalResourceScheduling;
   bool advanceInputDataHandling;
   bool advanceOutputDataHandling;
   bool qosParams;
   bool throttleResources;
+  bool userDN;
+  bool generateCert;
 } _UserConfigurationData__isset;
 
 class UserConfigurationData {
  public:
 
-  static const char* ascii_fingerprint; // = "A39B8E6345C677771D939D170C65720F";
-  static const uint8_t binary_fingerprint[16]; // = {0xA3,0x9B,0x8E,0x63,0x45,0xC6,0x77,0x77,0x1D,0x93,0x9D,0x17,0x0C,0x65,0x72,0x0F};
+  static const char* ascii_fingerprint; // = "0EA9FCA690C445780E02BCAC89B1D820";
+  static const uint8_t binary_fingerprint[16]; // = {0x0E,0xA9,0xFC,0xA6,0x90,0xC4,0x45,0x78,0x0E,0x02,0xBC,0xAC,0x89,0xB1,0xD8,0x20};
 
-  UserConfigurationData() : airavataAutoSchedule(false), overrideManualScheduledParams(false), shareExperimentPublicly(false), throttleResources(false) {
+  UserConfigurationData() : airavataAutoSchedule(false), overrideManualScheduledParams(false), shareExperimentPublicly(false), throttleResources(false), userDN(), generateCert(false) {
   }
 
   virtual ~UserConfigurationData() throw() {}
@@ -883,6 +885,8 @@ class UserConfigurationData {
   AdvancedOutputDataHandling advanceOutputDataHandling;
   QualityOfServiceParams qosParams;
   bool throttleResources;
+  std::string userDN;
+  bool generateCert;
 
   _UserConfigurationData__isset __isset;
 
@@ -924,6 +928,16 @@ class UserConfigurationData {
     __isset.throttleResources = true;
   }
 
+  void __set_userDN(const std::string& val) {
+    userDN = val;
+    __isset.userDN = true;
+  }
+
+  void __set_generateCert(const bool val) {
+    generateCert = val;
+    __isset.generateCert = true;
+  }
+
   bool operator == (const UserConfigurationData & rhs) const
   {
     if (!(airavataAutoSchedule == rhs.airavataAutoSchedule))
@@ -954,6 +968,14 @@ class UserConfigurationData {
       return false;
     else if (__isset.throttleResources && !(throttleResources == rhs.throttleResources))
       return false;
+    if (__isset.userDN != rhs.__isset.userDN)
+      return false;
+    else if (__isset.userDN && !(userDN == rhs.userDN))
+      return false;
+    if (__isset.generateCert != rhs.__isset.generateCert)
+      return false;
+    else if (__isset.generateCert && !(generateCert == rhs.generateCert))
+      return false;
     return true;
   }
   bool operator != (const UserConfigurationData &rhs) const {
@@ -1747,8 +1769,8 @@ typedef struct _Experiment__isset {
 class Experiment {
  public:
 
-  static const char* ascii_fingerprint; // = "C610216A34DE0B4389362B3D5236F6F6";
-  static const uint8_t binary_fingerprint[16]; // = {0xC6,0x10,0x21,0x6A,0x34,0xDE,0x0B,0x43,0x89,0x36,0x2B,0x3D,0x52,0x36,0xF6,0xF6};
+  static const char* ascii_fingerprint; // = "AAB7BCD0F1CB7A0198FEF5DB532788A8";
+  static const uint8_t binary_fingerprint[16]; // = {0xAA,0xB7,0xBC,0xD0,0xF1,0xCB,0x7A,0x01,0x98,0xFE,0xF5,0xDB,0x53,0x27,0x88,0xA8};
 
   Experiment() : experimentID("DO_NOT_SET_AT_CLIENTS"), projectID("DEFAULT"), creationTime(0), userName(), name(), description(), applicationId(), applicationVersion(), workflowTemplateId(), workflowTemplateVersion(), enableEmailNotification(0), workflowExecutionInstanceId() {
   }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
index 9bfced0..2280d94 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
@@ -120,15 +120,6 @@ final class DataMovementProtocol {
   );
 }
 
-final class AuthenticationMode {
-  const SERVER_ISSUED = 0;
-  const MYPROXY_ISSUED = 1;
-  static public $__names = array(
-    0 => 'SERVER_ISSUED',
-    1 => 'MYPROXY_ISSUED',
-  );
-}
-
 final class ProviderName {
   const EC2 = 0;
   const AWSEC2 = 1;
@@ -1390,8 +1381,6 @@ class UnicoreJobSubmission {
   public $jobSubmissionInterfaceId = "DO_NOT_SET_AT_CLIENTS";
   public $securityProtocol = null;
   public $unicoreEndPointURL = null;
-  public $authenticationMode = null;
-  public $userDN = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -1408,14 +1397,6 @@ class UnicoreJobSubmission {
           'var' => 'unicoreEndPointURL',
           'type' => TType::STRING,
           ),
-        4 => array(
-          'var' => 'authenticationMode',
-          'type' => TType::I32,
-          ),
-        5 => array(
-          'var' => 'userDN',
-          'type' => TType::STRING,
-          ),
         );
     }
     if (is_array($vals)) {
@@ -1428,12 +1409,6 @@ class UnicoreJobSubmission {
       if (isset($vals['unicoreEndPointURL'])) {
         $this->unicoreEndPointURL = $vals['unicoreEndPointURL'];
       }
-      if (isset($vals['authenticationMode'])) {
-        $this->authenticationMode = $vals['authenticationMode'];
-      }
-      if (isset($vals['userDN'])) {
-        $this->userDN = $vals['userDN'];
-      }
     }
   }
 
@@ -1477,20 +1452,6 @@ class UnicoreJobSubmission {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 4:
-          if ($ftype == TType::I32) {
-            $xfer += $input->readI32($this->authenticationMode);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 5:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userDN);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -1519,16 +1480,6 @@ class UnicoreJobSubmission {
       $xfer += $output->writeString($this->unicoreEndPointURL);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->authenticationMode !== null) {
-      $xfer += $output->writeFieldBegin('authenticationMode', TType::I32, 4);
-      $xfer += $output->writeI32($this->authenticationMode);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->userDN !== null) {
-      $xfer += $output->writeFieldBegin('userDN', TType::STRING, 5);
-      $xfer += $output->writeString($this->userDN);
-      $xfer += $output->writeFieldEnd();
-    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
index ea7aa19..6ad1be0 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
@@ -1387,6 +1387,8 @@ class UserConfigurationData {
   public $advanceOutputDataHandling = null;
   public $qosParams = null;
   public $throttleResources = false;
+  public $userDN = null;
+  public $generateCert = false;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -1427,6 +1429,14 @@ class UserConfigurationData {
           'var' => 'throttleResources',
           'type' => TType::BOOL,
           ),
+        9 => array(
+          'var' => 'userDN',
+          'type' => TType::STRING,
+          ),
+        10 => array(
+          'var' => 'generateCert',
+          'type' => TType::BOOL,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -1454,6 +1464,12 @@ class UserConfigurationData {
       if (isset($vals['throttleResources'])) {
         $this->throttleResources = $vals['throttleResources'];
       }
+      if (isset($vals['userDN'])) {
+        $this->userDN = $vals['userDN'];
+      }
+      if (isset($vals['generateCert'])) {
+        $this->generateCert = $vals['generateCert'];
+      }
     }
   }
 
@@ -1536,6 +1552,20 @@ class UserConfigurationData {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 9:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->userDN);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 10:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->generateCert);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -1601,6 +1631,16 @@ class UserConfigurationData {
       $xfer += $output->writeBool($this->throttleResources);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->userDN !== null) {
+      $xfer += $output->writeFieldBegin('userDN', TType::STRING, 9);
+      $xfer += $output->writeString($this->userDN);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->generateCert !== null) {
+      $xfer += $output->writeFieldBegin('generateCert', TType::BOOL, 10);
+      $xfer += $output->writeBool($this->generateCert);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
index d65ec86..e1dc2d5 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/UnicoreJobSubmission.java
@@ -56,9 +56,6 @@ import org.slf4j.LoggerFactory;
  *  unicoreGateway End Point. The provider will query this service to fetch required service end points.
  * authenticationMode
  *  The authenticationMode defines the way certificate is fetched.
- * userDN
- *  This attribute captures the userDN used for launching jobs and create temporary storages. The attribute should be
- *  provided if the authentication mode is set as SERVER_ISSUED.
  */
 @SuppressWarnings("all") public class UnicoreJobSubmission implements org.apache.thrift.TBase<UnicoreJobSubmission, UnicoreJobSubmission._Fields>, java.io.Serializable, Cloneable, Comparable<UnicoreJobSubmission> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnicoreJobSubmission");
@@ -66,8 +63,6 @@ import org.slf4j.LoggerFactory;
   private static final org.apache.thrift.protocol.TField JOB_SUBMISSION_INTERFACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("jobSubmissionInterfaceId", org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField SECURITY_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("securityProtocol", org.apache.thrift.protocol.TType.I32, (short)2);
   private static final org.apache.thrift.protocol.TField UNICORE_END_POINT_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("unicoreEndPointURL", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField AUTHENTICATION_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("authenticationMode", org.apache.thrift.protocol.TType.I32, (short)4);
-  private static final org.apache.thrift.protocol.TField USER_DN_FIELD_DESC = new org.apache.thrift.protocol.TField("userDN", org.apache.thrift.protocol.TType.STRING, (short)5);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -78,8 +73,6 @@ import org.slf4j.LoggerFactory;
   private String jobSubmissionInterfaceId; // required
   private SecurityProtocol securityProtocol; // required
   private String unicoreEndPointURL; // required
-  private AuthenticationMode authenticationMode; // required
-  private String userDN; // optional
 
   /** 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 {
@@ -89,13 +82,7 @@ import org.slf4j.LoggerFactory;
      * @see SecurityProtocol
      */
     SECURITY_PROTOCOL((short)2, "securityProtocol"),
-    UNICORE_END_POINT_URL((short)3, "unicoreEndPointURL"),
-    /**
-     * 
-     * @see AuthenticationMode
-     */
-    AUTHENTICATION_MODE((short)4, "authenticationMode"),
-    USER_DN((short)5, "userDN");
+    UNICORE_END_POINT_URL((short)3, "unicoreEndPointURL");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -116,10 +103,6 @@ import org.slf4j.LoggerFactory;
           return SECURITY_PROTOCOL;
         case 3: // UNICORE_END_POINT_URL
           return UNICORE_END_POINT_URL;
-        case 4: // AUTHENTICATION_MODE
-          return AUTHENTICATION_MODE;
-        case 5: // USER_DN
-          return USER_DN;
         default:
           return null;
       }
@@ -160,7 +143,6 @@ import org.slf4j.LoggerFactory;
   }
 
   // isset id assignments
-  private _Fields optionals[] = {_Fields.USER_DN};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -170,10 +152,6 @@ import org.slf4j.LoggerFactory;
         new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SecurityProtocol.class)));
     tmpMap.put(_Fields.UNICORE_END_POINT_URL, new org.apache.thrift.meta_data.FieldMetaData("unicoreEndPointURL", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.AUTHENTICATION_MODE, new org.apache.thrift.meta_data.FieldMetaData("authenticationMode", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AuthenticationMode.class)));
-    tmpMap.put(_Fields.USER_DN, new org.apache.thrift.meta_data.FieldMetaData("userDN", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UnicoreJobSubmission.class, metaDataMap);
   }
@@ -186,14 +164,12 @@ import org.slf4j.LoggerFactory;
   public UnicoreJobSubmission(
     String jobSubmissionInterfaceId,
     SecurityProtocol securityProtocol,
-    String unicoreEndPointURL,
-    AuthenticationMode authenticationMode)
+    String unicoreEndPointURL)
   {
     this();
     this.jobSubmissionInterfaceId = jobSubmissionInterfaceId;
     this.securityProtocol = securityProtocol;
     this.unicoreEndPointURL = unicoreEndPointURL;
-    this.authenticationMode = authenticationMode;
   }
 
   /**
@@ -209,12 +185,6 @@ import org.slf4j.LoggerFactory;
     if (other.isSetUnicoreEndPointURL()) {
       this.unicoreEndPointURL = other.unicoreEndPointURL;
     }
-    if (other.isSetAuthenticationMode()) {
-      this.authenticationMode = other.authenticationMode;
-    }
-    if (other.isSetUserDN()) {
-      this.userDN = other.userDN;
-    }
   }
 
   public UnicoreJobSubmission deepCopy() {
@@ -227,8 +197,6 @@ import org.slf4j.LoggerFactory;
 
     this.securityProtocol = null;
     this.unicoreEndPointURL = null;
-    this.authenticationMode = null;
-    this.userDN = null;
   }
 
   public String getJobSubmissionInterfaceId() {
@@ -308,60 +276,6 @@ import org.slf4j.LoggerFactory;
     }
   }
 
-  /**
-   * 
-   * @see AuthenticationMode
-   */
-  public AuthenticationMode getAuthenticationMode() {
-    return this.authenticationMode;
-  }
-
-  /**
-   * 
-   * @see AuthenticationMode
-   */
-  public void setAuthenticationMode(AuthenticationMode authenticationMode) {
-    this.authenticationMode = authenticationMode;
-  }
-
-  public void unsetAuthenticationMode() {
-    this.authenticationMode = null;
-  }
-
-  /** Returns true if field authenticationMode is set (has been assigned a value) and false otherwise */
-  public boolean isSetAuthenticationMode() {
-    return this.authenticationMode != null;
-  }
-
-  public void setAuthenticationModeIsSet(boolean value) {
-    if (!value) {
-      this.authenticationMode = null;
-    }
-  }
-
-  public String getUserDN() {
-    return this.userDN;
-  }
-
-  public void setUserDN(String userDN) {
-    this.userDN = userDN;
-  }
-
-  public void unsetUserDN() {
-    this.userDN = null;
-  }
-
-  /** Returns true if field userDN is set (has been assigned a value) and false otherwise */
-  public boolean isSetUserDN() {
-    return this.userDN != null;
-  }
-
-  public void setUserDNIsSet(boolean value) {
-    if (!value) {
-      this.userDN = null;
-    }
-  }
-
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case JOB_SUBMISSION_INTERFACE_ID:
@@ -388,22 +302,6 @@ import org.slf4j.LoggerFactory;
       }
       break;
 
-    case AUTHENTICATION_MODE:
-      if (value == null) {
-        unsetAuthenticationMode();
-      } else {
-        setAuthenticationMode((AuthenticationMode)value);
-      }
-      break;
-
-    case USER_DN:
-      if (value == null) {
-        unsetUserDN();
-      } else {
-        setUserDN((String)value);
-      }
-      break;
-
     }
   }
 
@@ -418,12 +316,6 @@ import org.slf4j.LoggerFactory;
     case UNICORE_END_POINT_URL:
       return getUnicoreEndPointURL();
 
-    case AUTHENTICATION_MODE:
-      return getAuthenticationMode();
-
-    case USER_DN:
-      return getUserDN();
-
     }
     throw new IllegalStateException();
   }
@@ -441,10 +333,6 @@ import org.slf4j.LoggerFactory;
       return isSetSecurityProtocol();
     case UNICORE_END_POINT_URL:
       return isSetUnicoreEndPointURL();
-    case AUTHENTICATION_MODE:
-      return isSetAuthenticationMode();
-    case USER_DN:
-      return isSetUserDN();
     }
     throw new IllegalStateException();
   }
@@ -489,24 +377,6 @@ import org.slf4j.LoggerFactory;
         return false;
     }
 
-    boolean this_present_authenticationMode = true && this.isSetAuthenticationMode();
-    boolean that_present_authenticationMode = true && that.isSetAuthenticationMode();
-    if (this_present_authenticationMode || that_present_authenticationMode) {
-      if (!(this_present_authenticationMode && that_present_authenticationMode))
-        return false;
-      if (!this.authenticationMode.equals(that.authenticationMode))
-        return false;
-    }
-
-    boolean this_present_userDN = true && this.isSetUserDN();
-    boolean that_present_userDN = true && that.isSetUserDN();
-    if (this_present_userDN || that_present_userDN) {
-      if (!(this_present_userDN && that_present_userDN))
-        return false;
-      if (!this.userDN.equals(that.userDN))
-        return false;
-    }
-
     return true;
   }
 
@@ -553,26 +423,6 @@ import org.slf4j.LoggerFactory;
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetAuthenticationMode()).compareTo(other.isSetAuthenticationMode());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetAuthenticationMode()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authenticationMode, other.authenticationMode);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUserDN()).compareTo(other.isSetUserDN());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUserDN()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userDN, other.userDN);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
     return 0;
   }
 
@@ -616,24 +466,6 @@ import org.slf4j.LoggerFactory;
       sb.append(this.unicoreEndPointURL);
     }
     first = false;
-    if (!first) sb.append(", ");
-    sb.append("authenticationMode:");
-    if (this.authenticationMode == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.authenticationMode);
-    }
-    first = false;
-    if (isSetUserDN()) {
-      if (!first) sb.append(", ");
-      sb.append("userDN:");
-      if (this.userDN == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.userDN);
-      }
-      first = false;
-    }
     sb.append(")");
     return sb.toString();
   }
@@ -652,10 +484,6 @@ import org.slf4j.LoggerFactory;
       throw new org.apache.thrift.protocol.TProtocolException("Required field 'unicoreEndPointURL' is unset! Struct:" + toString());
     }
 
-    if (!isSetAuthenticationMode()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'authenticationMode' is unset! Struct:" + toString());
-    }
-
     // check for sub-struct validity
   }
 
@@ -717,22 +545,6 @@ import org.slf4j.LoggerFactory;
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 4: // AUTHENTICATION_MODE
-            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.authenticationMode = AuthenticationMode.findByValue(iprot.readI32());
-              struct.setAuthenticationModeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // USER_DN
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.userDN = iprot.readString();
-              struct.setUserDNIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -761,18 +573,6 @@ import org.slf4j.LoggerFactory;
         oprot.writeString(struct.unicoreEndPointURL);
         oprot.writeFieldEnd();
       }
-      if (struct.authenticationMode != null) {
-        oprot.writeFieldBegin(AUTHENTICATION_MODE_FIELD_DESC);
-        oprot.writeI32(struct.authenticationMode.getValue());
-        oprot.writeFieldEnd();
-      }
-      if (struct.userDN != null) {
-        if (struct.isSetUserDN()) {
-          oprot.writeFieldBegin(USER_DN_FIELD_DESC);
-          oprot.writeString(struct.userDN);
-          oprot.writeFieldEnd();
-        }
-      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -793,15 +593,6 @@ import org.slf4j.LoggerFactory;
       oprot.writeString(struct.jobSubmissionInterfaceId);
       oprot.writeI32(struct.securityProtocol.getValue());
       oprot.writeString(struct.unicoreEndPointURL);
-      oprot.writeI32(struct.authenticationMode.getValue());
-      BitSet optionals = new BitSet();
-      if (struct.isSetUserDN()) {
-        optionals.set(0);
-      }
-      oprot.writeBitSet(optionals, 1);
-      if (struct.isSetUserDN()) {
-        oprot.writeString(struct.userDN);
-      }
     }
 
     @Override
@@ -813,13 +604,6 @@ import org.slf4j.LoggerFactory;
       struct.setSecurityProtocolIsSet(true);
       struct.unicoreEndPointURL = iprot.readString();
       struct.setUnicoreEndPointURLIsSet(true);
-      struct.authenticationMode = AuthenticationMode.findByValue(iprot.readI32());
-      struct.setAuthenticationModeIsSet(true);
-      BitSet incoming = iprot.readBitSet(1);
-      if (incoming.get(0)) {
-        struct.userDN = iprot.readString();
-        struct.setUserDNIsSet(true);
-      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/UserConfigurationData.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/UserConfigurationData.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/UserConfigurationData.java
index fecb4e8..c9531ea 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/UserConfigurationData.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/UserConfigurationData.java
@@ -65,6 +65,8 @@ import org.slf4j.LoggerFactory;
   private static final org.apache.thrift.protocol.TField ADVANCE_OUTPUT_DATA_HANDLING_FIELD_DESC = new org.apache.thrift.protocol.TField("advanceOutputDataHandling", org.apache.thrift.protocol.TType.STRUCT, (short)6);
   private static final org.apache.thrift.protocol.TField QOS_PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("qosParams", org.apache.thrift.protocol.TType.STRUCT, (short)7);
   private static final org.apache.thrift.protocol.TField THROTTLE_RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("throttleResources", org.apache.thrift.protocol.TType.BOOL, (short)8);
+  private static final org.apache.thrift.protocol.TField USER_DN_FIELD_DESC = new org.apache.thrift.protocol.TField("userDN", org.apache.thrift.protocol.TType.STRING, (short)9);
+  private static final org.apache.thrift.protocol.TField GENERATE_CERT_FIELD_DESC = new org.apache.thrift.protocol.TField("generateCert", org.apache.thrift.protocol.TType.BOOL, (short)10);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -80,6 +82,8 @@ import org.slf4j.LoggerFactory;
   private AdvancedOutputDataHandling advanceOutputDataHandling; // optional
   private QualityOfServiceParams qosParams; // optional
   private boolean throttleResources; // optional
+  private String userDN; // optional
+  private boolean generateCert; // optional
 
   /** 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 {
@@ -90,7 +94,9 @@ import org.slf4j.LoggerFactory;
     ADVANCE_INPUT_DATA_HANDLING((short)5, "advanceInputDataHandling"),
     ADVANCE_OUTPUT_DATA_HANDLING((short)6, "advanceOutputDataHandling"),
     QOS_PARAMS((short)7, "qosParams"),
-    THROTTLE_RESOURCES((short)8, "throttleResources");
+    THROTTLE_RESOURCES((short)8, "throttleResources"),
+    USER_DN((short)9, "userDN"),
+    GENERATE_CERT((short)10, "generateCert");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -121,6 +127,10 @@ import org.slf4j.LoggerFactory;
           return QOS_PARAMS;
         case 8: // THROTTLE_RESOURCES
           return THROTTLE_RESOURCES;
+        case 9: // USER_DN
+          return USER_DN;
+        case 10: // GENERATE_CERT
+          return GENERATE_CERT;
         default:
           return null;
       }
@@ -165,8 +175,9 @@ import org.slf4j.LoggerFactory;
   private static final int __OVERRIDEMANUALSCHEDULEDPARAMS_ISSET_ID = 1;
   private static final int __SHAREEXPERIMENTPUBLICLY_ISSET_ID = 2;
   private static final int __THROTTLERESOURCES_ISSET_ID = 3;
+  private static final int __GENERATECERT_ISSET_ID = 4;
   private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.SHARE_EXPERIMENT_PUBLICLY,_Fields.COMPUTATIONAL_RESOURCE_SCHEDULING,_Fields.ADVANCE_INPUT_DATA_HANDLING,_Fields.ADVANCE_OUTPUT_DATA_HANDLING,_Fields.QOS_PARAMS,_Fields.THROTTLE_RESOURCES};
+  private _Fields optionals[] = {_Fields.SHARE_EXPERIMENT_PUBLICLY,_Fields.COMPUTATIONAL_RESOURCE_SCHEDULING,_Fields.ADVANCE_INPUT_DATA_HANDLING,_Fields.ADVANCE_OUTPUT_DATA_HANDLING,_Fields.QOS_PARAMS,_Fields.THROTTLE_RESOURCES,_Fields.USER_DN,_Fields.GENERATE_CERT};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -186,6 +197,10 @@ import org.slf4j.LoggerFactory;
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, QualityOfServiceParams.class)));
     tmpMap.put(_Fields.THROTTLE_RESOURCES, new org.apache.thrift.meta_data.FieldMetaData("throttleResources", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+    tmpMap.put(_Fields.USER_DN, new org.apache.thrift.meta_data.FieldMetaData("userDN", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.GENERATE_CERT, new org.apache.thrift.meta_data.FieldMetaData("generateCert", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserConfigurationData.class, metaDataMap);
   }
@@ -199,6 +214,8 @@ import org.slf4j.LoggerFactory;
 
     this.throttleResources = false;
 
+    this.generateCert = false;
+
   }
 
   public UserConfigurationData(
@@ -233,6 +250,10 @@ import org.slf4j.LoggerFactory;
       this.qosParams = new QualityOfServiceParams(other.qosParams);
     }
     this.throttleResources = other.throttleResources;
+    if (other.isSetUserDN()) {
+      this.userDN = other.userDN;
+    }
+    this.generateCert = other.generateCert;
   }
 
   public UserConfigurationData deepCopy() {
@@ -253,6 +274,9 @@ import org.slf4j.LoggerFactory;
     this.qosParams = null;
     this.throttleResources = false;
 
+    this.userDN = null;
+    this.generateCert = false;
+
   }
 
   public boolean isAiravataAutoSchedule() {
@@ -435,6 +459,51 @@ import org.slf4j.LoggerFactory;
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __THROTTLERESOURCES_ISSET_ID, value);
   }
 
+  public String getUserDN() {
+    return this.userDN;
+  }
+
+  public void setUserDN(String userDN) {
+    this.userDN = userDN;
+  }
+
+  public void unsetUserDN() {
+    this.userDN = null;
+  }
+
+  /** Returns true if field userDN is set (has been assigned a value) and false otherwise */
+  public boolean isSetUserDN() {
+    return this.userDN != null;
+  }
+
+  public void setUserDNIsSet(boolean value) {
+    if (!value) {
+      this.userDN = null;
+    }
+  }
+
+  public boolean isGenerateCert() {
+    return this.generateCert;
+  }
+
+  public void setGenerateCert(boolean generateCert) {
+    this.generateCert = generateCert;
+    setGenerateCertIsSet(true);
+  }
+
+  public void unsetGenerateCert() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GENERATECERT_ISSET_ID);
+  }
+
+  /** Returns true if field generateCert is set (has been assigned a value) and false otherwise */
+  public boolean isSetGenerateCert() {
+    return EncodingUtils.testBit(__isset_bitfield, __GENERATECERT_ISSET_ID);
+  }
+
+  public void setGenerateCertIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GENERATECERT_ISSET_ID, value);
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case AIRAVATA_AUTO_SCHEDULE:
@@ -501,6 +570,22 @@ import org.slf4j.LoggerFactory;
       }
       break;
 
+    case USER_DN:
+      if (value == null) {
+        unsetUserDN();
+      } else {
+        setUserDN((String)value);
+      }
+      break;
+
+    case GENERATE_CERT:
+      if (value == null) {
+        unsetGenerateCert();
+      } else {
+        setGenerateCert((Boolean)value);
+      }
+      break;
+
     }
   }
 
@@ -530,6 +615,12 @@ import org.slf4j.LoggerFactory;
     case THROTTLE_RESOURCES:
       return Boolean.valueOf(isThrottleResources());
 
+    case USER_DN:
+      return getUserDN();
+
+    case GENERATE_CERT:
+      return Boolean.valueOf(isGenerateCert());
+
     }
     throw new IllegalStateException();
   }
@@ -557,6 +648,10 @@ import org.slf4j.LoggerFactory;
       return isSetQosParams();
     case THROTTLE_RESOURCES:
       return isSetThrottleResources();
+    case USER_DN:
+      return isSetUserDN();
+    case GENERATE_CERT:
+      return isSetGenerateCert();
     }
     throw new IllegalStateException();
   }
@@ -646,6 +741,24 @@ import org.slf4j.LoggerFactory;
         return false;
     }
 
+    boolean this_present_userDN = true && this.isSetUserDN();
+    boolean that_present_userDN = true && that.isSetUserDN();
+    if (this_present_userDN || that_present_userDN) {
+      if (!(this_present_userDN && that_present_userDN))
+        return false;
+      if (!this.userDN.equals(that.userDN))
+        return false;
+    }
+
+    boolean this_present_generateCert = true && this.isSetGenerateCert();
+    boolean that_present_generateCert = true && that.isSetGenerateCert();
+    if (this_present_generateCert || that_present_generateCert) {
+      if (!(this_present_generateCert && that_present_generateCert))
+        return false;
+      if (this.generateCert != that.generateCert)
+        return false;
+    }
+
     return true;
   }
 
@@ -742,6 +855,26 @@ import org.slf4j.LoggerFactory;
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetUserDN()).compareTo(other.isSetUserDN());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUserDN()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userDN, other.userDN);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetGenerateCert()).compareTo(other.isSetGenerateCert());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGenerateCert()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.generateCert, other.generateCert);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -821,6 +954,22 @@ import org.slf4j.LoggerFactory;
       sb.append(this.throttleResources);
       first = false;
     }
+    if (isSetUserDN()) {
+      if (!first) sb.append(", ");
+      sb.append("userDN:");
+      if (this.userDN == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.userDN);
+      }
+      first = false;
+    }
+    if (isSetGenerateCert()) {
+      if (!first) sb.append(", ");
+      sb.append("generateCert:");
+      sb.append(this.generateCert);
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }
@@ -954,6 +1103,22 @@ import org.slf4j.LoggerFactory;
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 9: // USER_DN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.userDN = iprot.readString();
+              struct.setUserDNIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 10: // GENERATE_CERT
+            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+              struct.generateCert = iprot.readBool();
+              struct.setGenerateCertIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1011,6 +1176,18 @@ import org.slf4j.LoggerFactory;
         oprot.writeBool(struct.throttleResources);
         oprot.writeFieldEnd();
       }
+      if (struct.userDN != null) {
+        if (struct.isSetUserDN()) {
+          oprot.writeFieldBegin(USER_DN_FIELD_DESC);
+          oprot.writeString(struct.userDN);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetGenerateCert()) {
+        oprot.writeFieldBegin(GENERATE_CERT_FIELD_DESC);
+        oprot.writeBool(struct.generateCert);
+        oprot.writeFieldEnd();
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1049,7 +1226,13 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetThrottleResources()) {
         optionals.set(5);
       }
-      oprot.writeBitSet(optionals, 6);
+      if (struct.isSetUserDN()) {
+        optionals.set(6);
+      }
+      if (struct.isSetGenerateCert()) {
+        optionals.set(7);
+      }
+      oprot.writeBitSet(optionals, 8);
       if (struct.isSetShareExperimentPublicly()) {
         oprot.writeBool(struct.shareExperimentPublicly);
       }
@@ -1068,6 +1251,12 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetThrottleResources()) {
         oprot.writeBool(struct.throttleResources);
       }
+      if (struct.isSetUserDN()) {
+        oprot.writeString(struct.userDN);
+      }
+      if (struct.isSetGenerateCert()) {
+        oprot.writeBool(struct.generateCert);
+      }
     }
 
     @Override
@@ -1077,7 +1266,7 @@ import org.slf4j.LoggerFactory;
       struct.setAiravataAutoScheduleIsSet(true);
       struct.overrideManualScheduledParams = iprot.readBool();
       struct.setOverrideManualScheduledParamsIsSet(true);
-      BitSet incoming = iprot.readBitSet(6);
+      BitSet incoming = iprot.readBitSet(8);
       if (incoming.get(0)) {
         struct.shareExperimentPublicly = iprot.readBool();
         struct.setShareExperimentPubliclyIsSet(true);
@@ -1106,6 +1295,14 @@ import org.slf4j.LoggerFactory;
         struct.throttleResources = iprot.readBool();
         struct.setThrottleResourcesIsSet(true);
       }
+      if (incoming.get(6)) {
+        struct.userDN = iprot.readString();
+        struct.setUserDNIsSet(true);
+      }
+      if (incoming.get(7)) {
+        struct.generateCert = iprot.readBool();
+        struct.setGenerateCertIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift b/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
index 9bf1b72..d91210c 100644
--- a/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/computeResourceModel.thrift
@@ -329,36 +329,17 @@ struct GlobusJobSubmission {
 }
 
 /**
- * AuthenticationMode
- *
- * SERVER_ISSUED: use CA credentials to generate a certificate based on user name. 
- * server properties. 
- * MYPROXY_ISSUED: rely on GSI method implementation already provided 
- * by Airavata security libs. 
-*/
-enum AuthenticationMode {
-    SERVER_ISSUED,
-    MYPROXY_ISSUED
-}
-
-
-/**
  * Unicore Job Submission
  *
  * unicoreEndPointURL:
  *  unicoreGateway End Point. The provider will query this service to fetch required service end points.
  * authenticationMode
  *  The authenticationMode defines the way certificate is fetched. 
- * userDN
- *  This attribute captures the userDN used for launching jobs and create temporary storages. The attribute should be 
- *  provided if the authentication mode is set as SERVER_ISSUED.
 */
 struct UnicoreJobSubmission {
     1: required string jobSubmissionInterfaceId = DEFAULT_ID,
     2: required SecurityProtocol securityProtocol,
     3: required string unicoreEndPointURL,
-    4: required AuthenticationMode authenticationMode,
-    5: optional string userDN
 }
 
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/airavata-api/thrift-interface-descriptions/experimentModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/experimentModel.thrift b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
index 0801695..7f76f90 100644
--- a/airavata-api/thrift-interface-descriptions/experimentModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
@@ -232,6 +232,8 @@ struct QualityOfServiceParams {
     3: optional i32 numberofRetries
 }
 
+
+
 /**
  * A structure holding the experiment configuration.
  *
@@ -244,8 +246,10 @@ struct UserConfigurationData {
     4: optional ComputationalResourceScheduling computationalResourceScheduling,
     5: optional AdvancedInputDataHandling advanceInputDataHandling,
     6: optional AdvancedOutputDataHandling advanceOutputDataHandling,
-    7: optional QualityOfServiceParams qosParams
-    8: optional bool throttleResources = 0
+    7: optional QualityOfServiceParams qosParams,
+    8: optional bool throttleResources = 0,
+    9: optional string userDN,
+    10: optional bool generateCert = 0 
 }
 
 struct ErrorDetails {

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
index 4e6b7ae..75b0987 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
@@ -209,7 +209,6 @@ public class ComputeResourceImpl implements ComputeResource {
              unicoreJobSubmission.setJobSubmissionInterfaceId(AppCatalogUtils.getID("UNICORE"));
              UnicoreJobSubmissionResource resource = AppCatalogThriftConversion.getUnicoreJobSubmission(unicoreJobSubmission);
              resource.setUnicoreEndpointUrl(unicoreJobSubmission.getUnicoreEndPointURL());
-             resource.setAuthenticationMode(unicoreJobSubmission.getAuthenticationMode().toString());
              if (unicoreJobSubmission.getSecurityProtocol() !=  null){
                  resource.setSecurityProtocol(unicoreJobSubmission.getSecurityProtocol().toString());
              }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
index 626fee4..3655620 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
@@ -38,19 +38,6 @@ public class UnicoreJobSubmission {
     @Column(name = "UNICORE_ENDPOINT_URL")
     private String unicoreEndpointUrl;
     
-    @Column(name = "AUTHENTICATION_MODE")
-    private String authenticationMode;
-
-
-    public String getAuthenticationMode() {
-		return authenticationMode;
-	}
-
-    public void setAuthenticationMode(String authenticationMode) {
-		this.authenticationMode = authenticationMode;
-	}
-
-    
     public String getUnicoreEndpointUrl() {
 		return unicoreEndpointUrl;
 	}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
index 5b8695a..6887f8a 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
@@ -125,7 +125,7 @@ public abstract class AbstractResource implements Resource {
         public static final String SUBMISSION_ID = "submissionID";
         public static final String SECURITY_PROTOCAL = "securityProtocol";
         public static final String UNICORE_ENDPOINT_URL = "unicoreEndpointUrl";
-        public static final String AUTHENTICATION_MODE = "authenticationMode";
+        
     }
 
     public final class UnicoreDataMovementConstants {

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
index df401ad..4c772e1 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
@@ -45,7 +45,6 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
 	private String jobSubmissionInterfaceId;
 	private String securityProtocol;
 	private String unicoreEndpointUrl;
-	private String authenticationMode;
 
 	public void remove(Object identifier) throws AppCatalogException {
 	        EntityManager em = null;
@@ -137,19 +136,6 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
 	                        unicoreSubmissionResourceList.add(unicoreJobSubmissionResource);
 	                    }
 	                }
-	            } else if (fieldName.equals(UnicoreJobSubmissionConstants.AUTHENTICATION_MODE)) {
-	                generator.setParameter(UnicoreJobSubmissionConstants.AUTHENTICATION_MODE, value);
-	                q = generator.selectQuery(em);
-	                results = q.getResultList();
-	                if (results.size() != 0) {
-	                    for (Object result : results) {
-	                        UnicoreJobSubmission unicoreJobSubmission = (UnicoreJobSubmission) result;
-	                        UnicoreJobSubmissionResource unicoreJobSubmissionResource =
-	                                (UnicoreJobSubmissionResource) AppCatalogJPAUtils.getResource(
-	                                        AppCatalogResourceType.UNICORE_JOB_SUBMISSION, unicoreJobSubmission);
-	                        unicoreSubmissionResourceList.add(unicoreJobSubmissionResource);
-	                    }
-	                }
 	            }        
 	            else {
 	                em.getTransaction().commit();
@@ -270,14 +256,13 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
                 existingUnicoreSubmission.setSubmissionID(jobSubmissionInterfaceId);;
                 existingUnicoreSubmission.setUnicoreEndpointUrl(unicoreEndpointUrl);
                 existingUnicoreSubmission.setSecurityProtocol(securityProtocol);
-                existingUnicoreSubmission.setAuthenticationMode(authenticationMode);
+
                 em.merge(existingUnicoreSubmission);
             } else {
             	UnicoreJobSubmission unicoreJobSubmission = new UnicoreJobSubmission();
                 unicoreJobSubmission.setSubmissionID(jobSubmissionInterfaceId);
                 unicoreJobSubmission.setUnicoreEndpointUrl(unicoreEndpointUrl);
                 unicoreJobSubmission.setSecurityProtocol(securityProtocol);
-                unicoreJobSubmission.setAuthenticationMode(authenticationMode);
                 em.persist(unicoreJobSubmission);
             }
             em.getTransaction().commit();
@@ -339,15 +324,5 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
 	public void setUnicoreEndpointUrl(String unicoreEndpointUrl) {
 		this.unicoreEndpointUrl = unicoreEndpointUrl;
 	}
-
-	
-     public String getAuthenticationMode() {
-		return authenticationMode;
-	}
-
-	public void setAuthenticationMode(String authenticationMode) {
-		this.authenticationMode = authenticationMode;
-	}
-
 	
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
index 0ee1ad0..3a9b6ed 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
@@ -533,7 +533,6 @@ public class AppCatalogJPAUtils {
             submissionResource.setjobSubmissionInterfaceId(o.getSubmissionID());
             submissionResource.setUnicoreEndpointUrl(o.getUnicoreEndpointUrl());
             submissionResource.setSecurityProtocol(o.getSecurityProtocol());
-            submissionResource.setAuthenticationMode(o.getAuthenticationMode());
         }
         return submissionResource;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
index 941b844..cad9c95 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
@@ -237,7 +237,6 @@ public class AppCatalogThriftConversion {
             resource.setSecurityProtocol(submission.getSecurityProtocol().toString());
         }
         resource.setUnicoreEndpointUrl(submission.getUnicoreEndPointURL());
-        resource.setAuthenticationMode(submission.getAuthenticationMode().toString());
         return resource;
     }
 
@@ -338,7 +337,6 @@ public class AppCatalogThriftConversion {
     	UnicoreJobSubmission unicoreJobSubmission = new UnicoreJobSubmission();
     	unicoreJobSubmission.setUnicoreEndPointURL(submission.getUnicoreEndpointUrl());
     	unicoreJobSubmission.setJobSubmissionInterfaceId(submission.getjobSubmissionInterfaceId());
-    	unicoreJobSubmission.setAuthenticationMode(AuthenticationMode.valueOf(submission.getAuthenticationMode()));
         if (submission.getSecurityProtocol() != null){
             unicoreJobSubmission.setSecurityProtocol(SecurityProtocol.valueOf(submission.getSecurityProtocol()));
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
index 5396541..4e28e04 100644
--- a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
+++ b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
@@ -79,7 +79,6 @@ CREATE TABLE UNICORE_SUBMISSION
          SUBMISSION_ID VARCHAR(255),
          SECURITY_PROTOCAL VARCHAR(255),
          UNICORE_ENDPOINT_URL VARCHAR(255),
-         AUTHENTICATION_MODE VARCHAR(255),
          PRIMARY KEY(SUBMISSION_ID)
 );
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
index 98f27db..cfb8022 100644
--- a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
+++ b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
@@ -91,7 +91,6 @@ CREATE TABLE UNICORE_SUBMISSION
          SUBMISSION_ID VARCHAR(255),
          SECURITY_PROTOCAL VARCHAR(255),
          UNICORE_ENDPOINT_URL VARCHAR(255),
-         AUTHENTICATION_MODE VARCHAR(255),
          PRIMARY KEY(SUBMISSION_ID)
 );
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4fb4891/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
index d490269..c75ea55 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
@@ -190,10 +190,17 @@ public class BESProvider extends AbstractProvider implements GFacProvider,
                         + activityStatus.getFault().getFaultstring()
                         + "\n EXITCODE: " + activityStatus.getExitCode();
                 log.info(error);
-                
+  
+                JobState applicationJobStatus = JobState.FAILED;
+                String jobStatusMessage = "Status of job " + jobId + "is "
+                        + applicationJobStatus;
+                jobExecutionContext.getNotifier().publish(
+                        new StatusChangeEvent(jobStatusMessage));
+                GFacUtils.updateJobStatus(jobExecutionContext, jobDetails, applicationJobStatus);
                 try {Thread.sleep(5000);} catch (InterruptedException e) {}
                 
                 //What if job is failed before execution and there are not stdouts generated yet?
+                log.debug("Downloading any standard output and error files, if they were produced.");
                 dt.downloadStdOuts();
                 
             } else if (activityStatus.getState() == ActivityStateEnumeration.CANCELLED) {
@@ -236,6 +243,7 @@ public class BESProvider extends AbstractProvider implements GFacProvider,
         }
 
     }
+	
 
 	private JobState getApplicationJobStatus(ActivityStatusType activityStatus) {
 		if (activityStatus == null) {


[20/62] [abbrv] airavata git commit: Reorganizing duplicate generated classed and instead using the stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
deleted file mode 100644
index 5d9c05c..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
+++ /dev/null
@@ -1,6888 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CredentialStoreService {
-
-  public interface Iface {
-
-    /**
-     * Query CS server to fetch the CPI version
-     */
-    public String getCSServiceVersion() throws org.apache.thrift.TException;
-
-    /**
-     * This method is to add SSHCredential which will return the token Id in success
-     * 
-     * 
-     * @param sshCredential
-     */
-    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
-
-  }
-
-  public interface AsyncIface {
-
-    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-  }
-
-  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
-    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
-      public Factory() {}
-      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
-        return new Client(prot);
-      }
-      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
-        return new Client(iprot, oprot);
-      }
-    }
-
-    public Client(org.apache.thrift.protocol.TProtocol prot)
-    {
-      super(prot, prot);
-    }
-
-    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
-      super(iprot, oprot);
-    }
-
-    public String getCSServiceVersion() throws org.apache.thrift.TException
-    {
-      send_getCSServiceVersion();
-      return recv_getCSServiceVersion();
-    }
-
-    public void send_getCSServiceVersion() throws org.apache.thrift.TException
-    {
-      getCSServiceVersion_args args = new getCSServiceVersion_args();
-      sendBase("getCSServiceVersion", args);
-    }
-
-    public String recv_getCSServiceVersion() throws org.apache.thrift.TException
-    {
-      getCSServiceVersion_result result = new getCSServiceVersion_result();
-      receiveBase(result, "getCSServiceVersion");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCSServiceVersion failed: unknown result");
-    }
-
-    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_addSSHCredential(sshCredential);
-      return recv_addSSHCredential();
-    }
-
-    public void send_addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.thrift.TException
-    {
-      addSSHCredential_args args = new addSSHCredential_args();
-      args.setSshCredential(sshCredential);
-      sendBase("addSSHCredential", args);
-    }
-
-    public String recv_addSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      addSSHCredential_result result = new addSSHCredential_result();
-      receiveBase(result, "addSSHCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addSSHCredential failed: unknown result");
-    }
-
-    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_addCertificateCredential(certificateCredential);
-      return recv_addCertificateCredential();
-    }
-
-    public void send_addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.thrift.TException
-    {
-      addCertificateCredential_args args = new addCertificateCredential_args();
-      args.setCertificateCredential(certificateCredential);
-      sendBase("addCertificateCredential", args);
-    }
-
-    public String recv_addCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      addCertificateCredential_result result = new addCertificateCredential_result();
-      receiveBase(result, "addCertificateCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addCertificateCredential failed: unknown result");
-    }
-
-    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_addPasswordCredential(passwordCredential);
-      return recv_addPasswordCredential();
-    }
-
-    public void send_addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.thrift.TException
-    {
-      addPasswordCredential_args args = new addPasswordCredential_args();
-      args.setPasswordCredential(passwordCredential);
-      sendBase("addPasswordCredential", args);
-    }
-
-    public String recv_addPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      addPasswordCredential_result result = new addPasswordCredential_result();
-      receiveBase(result, "addPasswordCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addPasswordCredential failed: unknown result");
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_getSSHCredential(tokenId, gatewayId);
-      return recv_getSSHCredential();
-    }
-
-    public void send_getSSHCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
-    {
-      getSSHCredential_args args = new getSSHCredential_args();
-      args.setTokenId(tokenId);
-      args.setGatewayId(gatewayId);
-      sendBase("getSSHCredential", args);
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential recv_getSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      getSSHCredential_result result = new getSSHCredential_result();
-      receiveBase(result, "getSSHCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSSHCredential failed: unknown result");
-    }
-
-    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_getCertificateCredential(tokenId, gatewayId);
-      return recv_getCertificateCredential();
-    }
-
-    public void send_getCertificateCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
-    {
-      getCertificateCredential_args args = new getCertificateCredential_args();
-      args.setTokenId(tokenId);
-      args.setGatewayId(gatewayId);
-      sendBase("getCertificateCredential", args);
-    }
-
-    public org.apache.airavata.credential.store.datamodel.CertificateCredential recv_getCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      getCertificateCredential_result result = new getCertificateCredential_result();
-      receiveBase(result, "getCertificateCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCertificateCredential failed: unknown result");
-    }
-
-    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      send_getPasswordCredential(tokenId, gatewayId);
-      return recv_getPasswordCredential();
-    }
-
-    public void send_getPasswordCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
-    {
-      getPasswordCredential_args args = new getPasswordCredential_args();
-      args.setTokenId(tokenId);
-      args.setGatewayId(gatewayId);
-      sendBase("getPasswordCredential", args);
-    }
-
-    public org.apache.airavata.credential.store.datamodel.PasswordCredential recv_getPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
-    {
-      getPasswordCredential_result result = new getPasswordCredential_result();
-      receiveBase(result, "getPasswordCredential");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.csException != null) {
-        throw result.csException;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPasswordCredential failed: unknown result");
-    }
-
-  }
-  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
-    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
-      private org.apache.thrift.async.TAsyncClientManager clientManager;
-      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
-      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
-        this.clientManager = clientManager;
-        this.protocolFactory = protocolFactory;
-      }
-      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
-        return new AsyncClient(protocolFactory, clientManager, transport);
-      }
-    }
-
-    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
-      super(protocolFactory, clientManager, transport);
-    }
-
-    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getCSServiceVersion_call method_call = new getCSServiceVersion_call(resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getCSServiceVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
-      public getCSServiceVersion_call(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);
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCSServiceVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getCSServiceVersion_args args = new getCSServiceVersion_args();
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getCSServiceVersion();
-      }
-    }
-
-    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      addSSHCredential_call method_call = new addSSHCredential_call(sshCredential, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class addSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential;
-      public addSSHCredential_call(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, 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.sshCredential = sshCredential;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        addSSHCredential_args args = new addSSHCredential_args();
-        args.setSshCredential(sshCredential);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_addSSHCredential();
-      }
-    }
-
-    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      addCertificateCredential_call method_call = new addCertificateCredential_call(certificateCredential, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class addCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential;
-      public addCertificateCredential_call(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, 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.certificateCredential = certificateCredential;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        addCertificateCredential_args args = new addCertificateCredential_args();
-        args.setCertificateCredential(certificateCredential);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_addCertificateCredential();
-      }
-    }
-
-    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      addPasswordCredential_call method_call = new addPasswordCredential_call(passwordCredential, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class addPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential;
-      public addPasswordCredential_call(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, 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.passwordCredential = passwordCredential;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        addPasswordCredential_args args = new addPasswordCredential_args();
-        args.setPasswordCredential(passwordCredential);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_addPasswordCredential();
-      }
-    }
-
-    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getSSHCredential_call method_call = new getSSHCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String tokenId;
-      private String gatewayId;
-      public getSSHCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
-        this.gatewayId = gatewayId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getSSHCredential_args args = new getSSHCredential_args();
-        args.setTokenId(tokenId);
-        args.setGatewayId(gatewayId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.credential.store.datamodel.SSHCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getSSHCredential();
-      }
-    }
-
-    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getCertificateCredential_call method_call = new getCertificateCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String tokenId;
-      private String gatewayId;
-      public getCertificateCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
-        this.gatewayId = gatewayId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getCertificateCredential_args args = new getCertificateCredential_args();
-        args.setTokenId(tokenId);
-        args.setGatewayId(gatewayId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.credential.store.datamodel.CertificateCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getCertificateCredential();
-      }
-    }
-
-    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getPasswordCredential_call method_call = new getPasswordCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String tokenId;
-      private String gatewayId;
-      public getPasswordCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
-        this.gatewayId = gatewayId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getPasswordCredential_args args = new getPasswordCredential_args();
-        args.setTokenId(tokenId);
-        args.setGatewayId(gatewayId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.credential.store.datamodel.PasswordCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_getPasswordCredential();
-      }
-    }
-
-  }
-
-  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
-    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
-    public Processor(I iface) {
-      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
-    }
-
-    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
-      super(iface, getProcessMap(processMap));
-    }
-
-    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
-      processMap.put("getCSServiceVersion", new getCSServiceVersion());
-      processMap.put("addSSHCredential", new addSSHCredential());
-      processMap.put("addCertificateCredential", new addCertificateCredential());
-      processMap.put("addPasswordCredential", new addPasswordCredential());
-      processMap.put("getSSHCredential", new getSSHCredential());
-      processMap.put("getCertificateCredential", new getCertificateCredential());
-      processMap.put("getPasswordCredential", new getPasswordCredential());
-      return processMap;
-    }
-
-    public static class getCSServiceVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCSServiceVersion_args> {
-      public getCSServiceVersion() {
-        super("getCSServiceVersion");
-      }
-
-      public getCSServiceVersion_args getEmptyArgsInstance() {
-        return new getCSServiceVersion_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getCSServiceVersion_result getResult(I iface, getCSServiceVersion_args args) throws org.apache.thrift.TException {
-        getCSServiceVersion_result result = new getCSServiceVersion_result();
-        result.success = iface.getCSServiceVersion();
-        return result;
-      }
-    }
-
-    public static class addSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addSSHCredential_args> {
-      public addSSHCredential() {
-        super("addSSHCredential");
-      }
-
-      public addSSHCredential_args getEmptyArgsInstance() {
-        return new addSSHCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public addSSHCredential_result getResult(I iface, addSSHCredential_args args) throws org.apache.thrift.TException {
-        addSSHCredential_result result = new addSSHCredential_result();
-        try {
-          result.success = iface.addSSHCredential(args.sshCredential);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class addCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addCertificateCredential_args> {
-      public addCertificateCredential() {
-        super("addCertificateCredential");
-      }
-
-      public addCertificateCredential_args getEmptyArgsInstance() {
-        return new addCertificateCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public addCertificateCredential_result getResult(I iface, addCertificateCredential_args args) throws org.apache.thrift.TException {
-        addCertificateCredential_result result = new addCertificateCredential_result();
-        try {
-          result.success = iface.addCertificateCredential(args.certificateCredential);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class addPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addPasswordCredential_args> {
-      public addPasswordCredential() {
-        super("addPasswordCredential");
-      }
-
-      public addPasswordCredential_args getEmptyArgsInstance() {
-        return new addPasswordCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public addPasswordCredential_result getResult(I iface, addPasswordCredential_args args) throws org.apache.thrift.TException {
-        addPasswordCredential_result result = new addPasswordCredential_result();
-        try {
-          result.success = iface.addPasswordCredential(args.passwordCredential);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class getSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSSHCredential_args> {
-      public getSSHCredential() {
-        super("getSSHCredential");
-      }
-
-      public getSSHCredential_args getEmptyArgsInstance() {
-        return new getSSHCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getSSHCredential_result getResult(I iface, getSSHCredential_args args) throws org.apache.thrift.TException {
-        getSSHCredential_result result = new getSSHCredential_result();
-        try {
-          result.success = iface.getSSHCredential(args.tokenId, args.gatewayId);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class getCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCertificateCredential_args> {
-      public getCertificateCredential() {
-        super("getCertificateCredential");
-      }
-
-      public getCertificateCredential_args getEmptyArgsInstance() {
-        return new getCertificateCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getCertificateCredential_result getResult(I iface, getCertificateCredential_args args) throws org.apache.thrift.TException {
-        getCertificateCredential_result result = new getCertificateCredential_result();
-        try {
-          result.success = iface.getCertificateCredential(args.tokenId, args.gatewayId);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-    public static class getPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPasswordCredential_args> {
-      public getPasswordCredential() {
-        super("getPasswordCredential");
-      }
-
-      public getPasswordCredential_args getEmptyArgsInstance() {
-        return new getPasswordCredential_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public getPasswordCredential_result getResult(I iface, getPasswordCredential_args args) throws org.apache.thrift.TException {
-        getPasswordCredential_result result = new getPasswordCredential_result();
-        try {
-          result.success = iface.getPasswordCredential(args.tokenId, args.gatewayId);
-        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
-          result.csException = csException;
-        }
-        return result;
-      }
-    }
-
-  }
-
-  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
-    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
-    public AsyncProcessor(I iface) {
-      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
-    }
-
-    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
-      super(iface, getProcessMap(processMap));
-    }
-
-    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
-      processMap.put("getCSServiceVersion", new getCSServiceVersion());
-      processMap.put("addSSHCredential", new addSSHCredential());
-      processMap.put("addCertificateCredential", new addCertificateCredential());
-      processMap.put("addPasswordCredential", new addPasswordCredential());
-      processMap.put("getSSHCredential", new getSSHCredential());
-      processMap.put("getCertificateCredential", new getCertificateCredential());
-      processMap.put("getPasswordCredential", new getPasswordCredential());
-      return processMap;
-    }
-
-    public static class getCSServiceVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCSServiceVersion_args, String> {
-      public getCSServiceVersion() {
-        super("getCSServiceVersion");
-      }
-
-      public getCSServiceVersion_args getEmptyArgsInstance() {
-        return new getCSServiceVersion_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            getCSServiceVersion_result result = new getCSServiceVersion_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getCSServiceVersion_result result = new getCSServiceVersion_result();
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getCSServiceVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.getCSServiceVersion(resultHandler);
-      }
-    }
-
-    public static class addSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addSSHCredential_args, String> {
-      public addSSHCredential() {
-        super("addSSHCredential");
-      }
-
-      public addSSHCredential_args getEmptyArgsInstance() {
-        return new addSSHCredential_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            addSSHCredential_result result = new addSSHCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            addSSHCredential_result result = new addSSHCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, addSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.addSSHCredential(args.sshCredential,resultHandler);
-      }
-    }
-
-    public static class addCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addCertificateCredential_args, String> {
-      public addCertificateCredential() {
-        super("addCertificateCredential");
-      }
-
-      public addCertificateCredential_args getEmptyArgsInstance() {
-        return new addCertificateCredential_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            addCertificateCredential_result result = new addCertificateCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            addCertificateCredential_result result = new addCertificateCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, addCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.addCertificateCredential(args.certificateCredential,resultHandler);
-      }
-    }
-
-    public static class addPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addPasswordCredential_args, String> {
-      public addPasswordCredential() {
-        super("addPasswordCredential");
-      }
-
-      public addPasswordCredential_args getEmptyArgsInstance() {
-        return new addPasswordCredential_args();
-      }
-
-      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<String>() { 
-          public void onComplete(String o) {
-            addPasswordCredential_result result = new addPasswordCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            addPasswordCredential_result result = new addPasswordCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, addPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.addPasswordCredential(args.passwordCredential,resultHandler);
-      }
-    }
-
-    public static class getSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSSHCredential_args, org.apache.airavata.credential.store.datamodel.SSHCredential> {
-      public getSSHCredential() {
-        super("getSSHCredential");
-      }
-
-      public getSSHCredential_args getEmptyArgsInstance() {
-        return new getSSHCredential_args();
-      }
-
-      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential>() { 
-          public void onComplete(org.apache.airavata.credential.store.datamodel.SSHCredential o) {
-            getSSHCredential_result result = new getSSHCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getSSHCredential_result result = new getSSHCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> resultHandler) throws TException {
-        iface.getSSHCredential(args.tokenId, args.gatewayId,resultHandler);
-      }
-    }
-
-    public static class getCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCertificateCredential_args, org.apache.airavata.credential.store.datamodel.CertificateCredential> {
-      public getCertificateCredential() {
-        super("getCertificateCredential");
-      }
-
-      public getCertificateCredential_args getEmptyArgsInstance() {
-        return new getCertificateCredential_args();
-      }
-
-      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential>() { 
-          public void onComplete(org.apache.airavata.credential.store.datamodel.CertificateCredential o) {
-            getCertificateCredential_result result = new getCertificateCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getCertificateCredential_result result = new getCertificateCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> resultHandler) throws TException {
-        iface.getCertificateCredential(args.tokenId, args.gatewayId,resultHandler);
-      }
-    }
-
-    public static class getPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPasswordCredential_args, org.apache.airavata.credential.store.datamodel.PasswordCredential> {
-      public getPasswordCredential() {
-        super("getPasswordCredential");
-      }
-
-      public getPasswordCredential_args getEmptyArgsInstance() {
-        return new getPasswordCredential_args();
-      }
-
-      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential>() { 
-          public void onComplete(org.apache.airavata.credential.store.datamodel.PasswordCredential o) {
-            getPasswordCredential_result result = new getPasswordCredential_result();
-            result.success = o;
-            try {
-              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
-              return;
-            } catch (Exception e) {
-              LOGGER.error("Exception writing to internal frame buffer", e);
-            }
-            fb.close();
-          }
-          public void onError(Exception e) {
-            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
-            org.apache.thrift.TBase msg;
-            getPasswordCredential_result result = new getPasswordCredential_result();
-            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
-                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
-                        result.setCsExceptionIsSet(true);
-                        msg = result;
-            }
-             else 
-            {
-              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
-              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
-            }
-            try {
-              fcall.sendResponse(fb,msg,msgType,seqid);
-              return;
-            } catch (Exception ex) {
-              LOGGER.error("Exception writing to internal frame buffer", ex);
-            }
-            fb.close();
-          }
-        };
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public void start(I iface, getPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> resultHandler) throws TException {
-        iface.getPasswordCredential(args.tokenId, args.gatewayId,resultHandler);
-      }
-    }
-
-  }
-
-  public static class getCSServiceVersion_args implements org.apache.thrift.TBase<getCSServiceVersion_args, getCSServiceVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_args");
-
-
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-    static {
-      schemes.put(StandardScheme.class, new getCSServiceVersion_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getCSServiceVersion_argsTupleSchemeFactory());
-    }
-
-
-    /** 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 {
-;
-
-      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-      static {
-        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-          byName.put(field.getFieldName(), field);
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, or null if its not found.
-       */
-      public static _Fields findByThriftId(int fieldId) {
-        switch(fieldId) {
-          default:
-            return null;
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, throwing an exception
-       * if it is not found.
-       */
-      public static _Fields findByThriftIdOrThrow(int fieldId) {
-        _Fields fields = findByThriftId(fieldId);
-        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-        return fields;
-      }
-
-      /**
-       * Find the _Fields constant that matches name, or null if its not found.
-       */
-      public static _Fields findByName(String name) {
-        return byName.get(name);
-      }
-
-      private final short _thriftId;
-      private final String _fieldName;
-
-      _Fields(short thriftId, String fieldName) {
-        _thriftId = thriftId;
-        _fieldName = fieldName;
-      }
-
-      public short getThriftFieldId() {
-        return _thriftId;
-      }
-
-      public String getFieldName() {
-        return _fieldName;
-      }
-    }
-    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-    static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_args.class, metaDataMap);
-    }
-
-    public getCSServiceVersion_args() {
-    }
-
-    /**
-     * Performs a deep copy on <i>other</i>.
-     */
-    public getCSServiceVersion_args(getCSServiceVersion_args other) {
-    }
-
-    public getCSServiceVersion_args deepCopy() {
-      return new getCSServiceVersion_args(this);
-    }
-
-    @Override
-    public void clear() {
-    }
-
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      }
-      throw new IllegalStateException();
-    }
-
-    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-    public boolean isSet(_Fields field) {
-      if (field == null) {
-        throw new IllegalArgumentException();
-      }
-
-      switch (field) {
-      }
-      throw new IllegalStateException();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof getCSServiceVersion_args)
-        return this.equals((getCSServiceVersion_args)that);
-      return false;
-    }
-
-    public boolean equals(getCSServiceVersion_args that) {
-      if (that == null)
-        return false;
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      return 0;
-    }
-
-    @Override
-    public int compareTo(getCSServiceVersion_args other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
-
-      int lastComparison = 0;
-
-      return 0;
-    }
-
-    public _Fields fieldForId(int fieldId) {
-      return _Fields.findByThriftId(fieldId);
-    }
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-    }
-
-    @Override
-    public String toString() {
-      StringBuilder sb = new StringBuilder("getCSServiceVersion_args(");
-      boolean first = true;
-
-      sb.append(")");
-      return sb.toString();
-    }
-
-    public void validate() throws org.apache.thrift.TException {
-      // check for required fields
-      // check for sub-struct validity
-    }
-
-    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-      try {
-        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-      try {
-        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private static class getCSServiceVersion_argsStandardSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_argsStandardScheme getScheme() {
-        return new getCSServiceVersion_argsStandardScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_argsStandardScheme extends StandardScheme<getCSServiceVersion_args> {
-
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        org.apache.thrift.protocol.TField schemeField;
-        iprot.readStructBegin();
-        while (true)
-        {
-          schemeField = iprot.readFieldBegin();
-          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-            break;
-          }
-          switch (schemeField.id) {
-            default:
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-          }
-          iprot.readFieldEnd();
-        }
-        iprot.readStructEnd();
-
-        // check for required fields of primitive type, which can't be checked in the validate method
-        struct.validate();
-      }
-
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        struct.validate();
-
-        oprot.writeStructBegin(STRUCT_DESC);
-        oprot.writeFieldStop();
-        oprot.writeStructEnd();
-      }
-
-    }
-
-    private static class getCSServiceVersion_argsTupleSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_argsTupleScheme getScheme() {
-        return new getCSServiceVersion_argsTupleScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_argsTupleScheme extends TupleScheme<getCSServiceVersion_args> {
-
-      @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        TTupleProtocol oprot = (TTupleProtocol) prot;
-      }
-
-      @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
-        TTupleProtocol iprot = (TTupleProtocol) prot;
-      }
-    }
-
-  }
-
-  public static class getCSServiceVersion_result implements org.apache.thrift.TBase<getCSServiceVersion_result, getCSServiceVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_result");
-
-    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
-
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-    static {
-      schemes.put(StandardScheme.class, new getCSServiceVersion_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getCSServiceVersion_resultTupleSchemeFactory());
-    }
-
-    public String success; // 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 {
-      SUCCESS((short)0, "success");
-
-      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-      static {
-        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-          byName.put(field.getFieldName(), field);
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, or null if its not found.
-       */
-      public static _Fields findByThriftId(int fieldId) {
-        switch(fieldId) {
-          case 0: // SUCCESS
-            return SUCCESS;
-          default:
-            return null;
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, throwing an exception
-       * if it is not found.
-       */
-      public static _Fields findByThriftIdOrThrow(int fieldId) {
-        _Fields fields = findByThriftId(fieldId);
-        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-        return fields;
-      }
-
-      /**
-       * Find the _Fields constant that matches name, or null if its not found.
-       */
-      public static _Fields findByName(String name) {
-        return byName.get(name);
-      }
-
-      private final short _thriftId;
-      private final String _fieldName;
-
-      _Fields(short thriftId, String fieldName) {
-        _thriftId = thriftId;
-        _fieldName = fieldName;
-      }
-
-      public short getThriftFieldId() {
-        return _thriftId;
-      }
-
-      public String getFieldName() {
-        return _fieldName;
-      }
-    }
-
-    // isset id assignments
-    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-    static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-      metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_result.class, metaDataMap);
-    }
-
-    public getCSServiceVersion_result() {
-    }
-
-    public getCSServiceVersion_result(
-      String success)
-    {
-      this();
-      this.success = success;
-    }
-
-    /**
-     * Performs a deep copy on <i>other</i>.
-     */
-    public getCSServiceVersion_result(getCSServiceVersion_result other) {
-      if (other.isSetSuccess()) {
-        this.success = other.success;
-      }
-    }
-
-    public getCSServiceVersion_result deepCopy() {
-      return new getCSServiceVersion_result(this);
-    }
-
-    @Override
-    public void clear() {
-      this.success = null;
-    }
-
-    public String getSuccess() {
-      return this.success;
-    }
-
-    public getCSServiceVersion_result setSuccess(String success) {
-      this.success = success;
-      return this;
-    }
-
-    public void unsetSuccess() {
-      this.success = null;
-    }
-
-    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-    public boolean isSetSuccess() {
-      return this.success != null;
-    }
-
-    public void setSuccessIsSet(boolean value) {
-      if (!value) {
-        this.success = null;
-      }
-    }
-
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      case SUCCESS:
-        if (value == null) {
-          unsetSuccess();
-        } else {
-          setSuccess((String)value);
-        }
-        break;
-
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      case SUCCESS:
-        return getSuccess();
-
-      }
-      throw new IllegalStateException();
-    }
-
-    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-    public boolean isSet(_Fields field) {
-      if (field == null) {
-        throw new IllegalArgumentException();
-      }
-
-      switch (field) {
-      case SUCCESS:
-        return isSetSuccess();
-      }
-      throw new IllegalStateException();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof getCSServiceVersion_result)
-        return this.equals((getCSServiceVersion_result)that);
-      return false;
-    }
-
-    public boolean equals(getCSServiceVersion_result that) {
-      if (that == null)
-        return false;
-
-      boolean this_present_success = true && this.isSetSuccess();
-      boolean that_present_success = true && that.isSetSuccess();
-      if (this_present_success || that_present_success) {
-        if (!(this_present_success && that_present_success))
-          return false;
-        if (!this.success.equals(that.success))
-          return false;
-      }
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      return 0;
-    }
-
-    @Override
-    public int compareTo(getCSServiceVersion_result other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
-
-      int lastComparison = 0;
-
-      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetSuccess()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
-      return 0;
-    }
-
-    public _Fields fieldForId(int fieldId) {
-      return _Fields.findByThriftId(fieldId);
-    }
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-      }
-
-    @Override
-    public String toString() {
-      StringBuilder sb = new StringBuilder("getCSServiceVersion_result(");
-      boolean first = true;
-
-      sb.append("success:");
-      if (this.success == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.success);
-      }
-      first = false;
-      sb.append(")");
-      return sb.toString();
-    }
-
-    public void validate() throws org.apache.thrift.TException {
-      // check for required fields
-      // check for sub-struct validity
-    }
-
-    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-      try {
-        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-      try {
-        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private static class getCSServiceVersion_resultStandardSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_resultStandardScheme getScheme() {
-        return new getCSServiceVersion_resultStandardScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_resultStandardScheme extends StandardScheme<getCSServiceVersion_result> {
-
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        org.apache.thrift.protocol.TField schemeField;
-        iprot.readStructBegin();
-        while (true)
-        {
-          schemeField = iprot.readFieldBegin();
-          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-            break;
-          }
-          switch (schemeField.id) {
-            case 0: // SUCCESS
-              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-                struct.success = iprot.readString();
-                struct.setSuccessIsSet(true);
-              } else { 
-                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-              }
-              break;
-            default:
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-          }
-          iprot.readFieldEnd();
-        }
-        iprot.readStructEnd();
-
-        // check for required fields of primitive type, which can't be checked in the validate method
-        struct.validate();
-      }
-
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        struct.validate();
-
-        oprot.writeStructBegin(STRUCT_DESC);
-        if (struct.success != null) {
-          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-          oprot.writeString(struct.success);
-          oprot.writeFieldEnd();
-        }
-        oprot.writeFieldStop();
-        oprot.writeStructEnd();
-      }
-
-    }
-
-    private static class getCSServiceVersion_resultTupleSchemeFactory implements SchemeFactory {
-      public getCSServiceVersion_resultTupleScheme getScheme() {
-        return new getCSServiceVersion_resultTupleScheme();
-      }
-    }
-
-    private static class getCSServiceVersion_resultTupleScheme extends TupleScheme<getCSServiceVersion_result> {
-
-      @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        TTupleProtocol oprot = (TTupleProtocol) prot;
-        BitSet optionals = new BitSet();
-        if (struct.isSetSuccess()) {
-          optionals.set(0);
-        }
-        oprot.writeBitSet(optionals, 1);
-        if (struct.isSetSuccess()) {
-          oprot.writeString(struct.success);
-        }
-      }
-
-      @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
-        TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(1);
-        if (incoming.get(0)) {
-          struct.success = iprot.readString();
-          struct.setSuccessIsSet(true);
-        }
-      }
-    }
-
-  }
-
-  public static class addSSHCredential_args implements org.apache.thrift.TBase<addSSHCredential_args, addSSHCredential_args._Fields>, java.io.Serializable, Cloneable, Comparable<addSSHCredential_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSSHCredential_args");
-
-    private static final org.apache.thrift.protocol.TField SSH_CREDENTIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("sshCredential", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-    static {
-      schemes.put(StandardScheme.class, new addSSHCredential_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new addSSHCredential_argsTupleSchemeFactory());
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential; // 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 {
-      SSH_CREDENTIAL((short)1, "sshCredential");
-
-      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-      static {
-        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-          byName.put(field.getFieldName(), field);
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, or null if its not found.
-       */
-      public static _Fields findByThriftId(int fieldId) {
-        switch(fieldId) {
-          case 1: // SSH_CREDENTIAL
-            return SSH_CREDENTIAL;
-          default:
-            return null;
-        }
-      }
-
-      /**
-       * Find the _Fields constant that matches fieldId, throwing an exception
-       * if it is not found.
-       */
-      public static _Fields findByThriftIdOrThrow(int fieldId) {
-        _Fields fields = findByThriftId(fieldId);
-        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-        return fields;
-      }
-
-      /**
-       * Find the _Fields constant that matches name, or null if its not found.
-       */
-      public static _Fields findByName(String name) {
-        return byName.get(name);
-      }
-
-      private final short _thriftId;
-      private final String _fieldName;
-
-      _Fields(short thriftId, String fieldName) {
-        _thriftId = thriftId;
-        _fieldName = fieldName;
-      }
-
-      public short getThriftFieldId() {
-        return _thriftId;
-      }
-
-      public String getFieldName() {
-        return _fieldName;
-      }
-    }
-
-    // isset id assignments
-    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-    static {
-      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-      tmpMap.put(_Fields.SSH_CREDENTIAL, new org.apache.thrift.meta_data.FieldMetaData("sshCredential", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.credential.store.datamodel.SSHCredential.class)));
-      metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addSSHCredential_args.class, metaDataMap);
-    }
-
-    public addSSHCredential_args() {
-    }
-
-    public addSSHCredential_args(
-      org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential)
-    {
-      this();
-      this.sshCredential = sshCredential;
-    }
-
-    /**
-     * Performs a deep copy on <i>other</i>.
-     */
-    public addSSHCredential_args(addSSHCredential_args other) {
-      if (other.isSetSshCredential()) {
-        this.sshCredential = new org.apache.airavata.credential.store.datamodel.SSHCredential(other.sshCredential);
-      }
-    }
-
-    public addSSHCredential_args deepCopy() {
-      return new addSSHCredential_args(this);
-    }
-
-    @Override
-    public void clear() {
-      this.sshCredential = null;
-    }
-
-    public org.apache.airavata.credential.store.datamodel.SSHCredential getSshCredential() {
-      return this.sshCredential;
-    }
-
-    public addSSHCredential_args setSshCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) {
-      this.sshCredential = sshCredential;
-      return this;
-    }
-
-    public void unsetSshCredential() {
-      this.sshCredential = null;
-    }
-
-    /** Returns true if field sshCredential is set (has been assigned a value) and false otherwise */
-    public boolean isSetSshCredential() {
-      return this.sshCredential != null;
-    }
-
-    public void setSshCredentialIsSet(boolean value) {
-      if (!value) {
-        this.sshCredential = null;
-      }
-    }
-
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      case SSH_CREDENTIAL:
-        if (value == null) {
-          unsetSshCredential();
-        } else {
-          setSshCredential((org.apache.airavata.credential.store.datamodel.SSHCredential)value);
-        }
-        break;
-
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      case SSH_CREDENTIAL:
-        return getSshCredential();
-
-      }
-      throw new IllegalStateException();
-    }
-
-    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-    public boolean isSet(_Fields field) {
-      if (field == null) {
-        throw new IllegalArgumentException();
-      }
-
-      switch (field) {
-      case SSH_CREDENTIAL:
-        return isSetSshCredential();
-      }
-      throw new IllegalStateException();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof addSSHCredential_args)
-        return this.equals((addSSHCredential_args)that);
-      return false;
-    }
-
-    public boolean equals(addSSHCredential_args that) {
-      if (that == null)
-        return false;
-
-      boolean this_present_sshCredential = true && this.isSetSshCredential();
-      boolean that_present_sshCredential = true && that.isSetSshCredential();
-      if (this_present_sshCredential || that_present_sshCredential) {
-        if (!(this_present_sshCredential && that_present_sshCredential))
-          return false;
-        if (!this.sshCredential.equals(that.sshCredential))
-          return false;
-      }
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      return 0;
-    }
-
-    @Override
-    public int compareTo(addSSHCredential_args other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
-
-      int lastComparison = 0;
-
-      lastComparison = Boolean.valueOf(isSetSshCredential()).compareTo(other.isSetSshCredential());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetSshCredential()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sshCredential, other.sshCredential);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
-      return 0;
-    }
-
-    public _Fields fieldForId(int fieldId) {
-      return _Fields.findByThriftId(fieldId);
-    }
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-    }
-
-    @Override
-    public String toString() {
-      StringBuilder sb = new StringBuilder("addSSHCredential_args(");
-      boolean first = true;
-
-      sb.append("sshCredential:");
-      if (this.sshCredential == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.sshCredential);
-      }
-      first = false;
-      sb.append(")");
-      return sb.toString();
-    }
-
-    public void validate() throws org.apache.thrift.TException {
-      // check for required fields
-      if (sshCredential == null) {
-        throw new org.apache.thrift.protocol.TProtocolException("Required field 'sshCredential' was not present! Struct: " + toString());
-      }
-      // check for sub-struct validity
-      if (sshCredential != null) {
-        sshCredential.validate();
-      }
-    }
-
-    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-      try {
-        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    p

<TRUNCATED>

[07/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
new file mode 100644
index 0000000..f6b6837
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
@@ -0,0 +1,698 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class PasswordCredential implements org.apache.thrift.TBase<PasswordCredential, PasswordCredential._Fields>, java.io.Serializable, Cloneable, Comparable<PasswordCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PasswordCredential");
+
+  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)3);
+  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new PasswordCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PasswordCredentialTupleSchemeFactory());
+  }
+
+  public String username; // required
+  public String password; // required
+  public long persistedTime; // optional
+  public String token; // optional
+
+  /** 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 {
+    USERNAME((short)1, "username"),
+    PASSWORD((short)2, "password"),
+    PERSISTED_TIME((short)3, "persistedTime"),
+    TOKEN((short)4, "token");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // USERNAME
+          return USERNAME;
+        case 2: // PASSWORD
+          return PASSWORD;
+        case 3: // PERSISTED_TIME
+          return PERSISTED_TIME;
+        case 4: // TOKEN
+          return TOKEN;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __PERSISTEDTIME_ISSET_ID = 0;
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.PERSISTED_TIME,_Fields.TOKEN};
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PasswordCredential.class, metaDataMap);
+  }
+
+  public PasswordCredential() {
+  }
+
+  public PasswordCredential(
+    String username,
+    String password)
+  {
+    this();
+    this.username = username;
+    this.password = password;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public PasswordCredential(PasswordCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetPassword()) {
+      this.password = other.password;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public PasswordCredential deepCopy() {
+    return new PasswordCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.username = null;
+    this.password = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public PasswordCredential setUsername(String username) {
+    this.username = username;
+    return this;
+  }
+
+  public void unsetUsername() {
+    this.username = null;
+  }
+
+  /** Returns true if field username is set (has been assigned a value) and false otherwise */
+  public boolean isSetUsername() {
+    return this.username != null;
+  }
+
+  public void setUsernameIsSet(boolean value) {
+    if (!value) {
+      this.username = null;
+    }
+  }
+
+  public String getPassword() {
+    return this.password;
+  }
+
+  public PasswordCredential setPassword(String password) {
+    this.password = password;
+    return this;
+  }
+
+  public void unsetPassword() {
+    this.password = null;
+  }
+
+  /** Returns true if field password is set (has been assigned a value) and false otherwise */
+  public boolean isSetPassword() {
+    return this.password != null;
+  }
+
+  public void setPasswordIsSet(boolean value) {
+    if (!value) {
+      this.password = null;
+    }
+  }
+
+  public long getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public PasswordCredential setPersistedTime(long persistedTime) {
+    this.persistedTime = persistedTime;
+    setPersistedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetPersistedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetPersistedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  public void setPersistedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
+  }
+
+  public String getToken() {
+    return this.token;
+  }
+
+  public PasswordCredential setToken(String token) {
+    this.token = token;
+    return this;
+  }
+
+  public void unsetToken() {
+    this.token = null;
+  }
+
+  /** Returns true if field token is set (has been assigned a value) and false otherwise */
+  public boolean isSetToken() {
+    return this.token != null;
+  }
+
+  public void setTokenIsSet(boolean value) {
+    if (!value) {
+      this.token = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case PASSWORD:
+      if (value == null) {
+        unsetPassword();
+      } else {
+        setPassword((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Long)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case USERNAME:
+      return getUsername();
+
+    case PASSWORD:
+      return getPassword();
+
+    case PERSISTED_TIME:
+      return Long.valueOf(getPersistedTime());
+
+    case TOKEN:
+      return getToken();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case USERNAME:
+      return isSetUsername();
+    case PASSWORD:
+      return isSetPassword();
+    case PERSISTED_TIME:
+      return isSetPersistedTime();
+    case TOKEN:
+      return isSetToken();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof PasswordCredential)
+      return this.equals((PasswordCredential)that);
+    return false;
+  }
+
+  public boolean equals(PasswordCredential that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_username = true && this.isSetUsername();
+    boolean that_present_username = true && that.isSetUsername();
+    if (this_present_username || that_present_username) {
+      if (!(this_present_username && that_present_username))
+        return false;
+      if (!this.username.equals(that.username))
+        return false;
+    }
+
+    boolean this_present_password = true && this.isSetPassword();
+    boolean that_present_password = true && that.isSetPassword();
+    if (this_present_password || that_present_password) {
+      if (!(this_present_password && that_present_password))
+        return false;
+      if (!this.password.equals(that.password))
+        return false;
+    }
+
+    boolean this_present_persistedTime = true && this.isSetPersistedTime();
+    boolean that_present_persistedTime = true && that.isSetPersistedTime();
+    if (this_present_persistedTime || that_present_persistedTime) {
+      if (!(this_present_persistedTime && that_present_persistedTime))
+        return false;
+      if (this.persistedTime != that.persistedTime)
+        return false;
+    }
+
+    boolean this_present_token = true && this.isSetToken();
+    boolean that_present_token = true && that.isSetToken();
+    if (this_present_token || that_present_token) {
+      if (!(this_present_token && that_present_token))
+        return false;
+      if (!this.token.equals(that.token))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(PasswordCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUsername()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPassword()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPersistedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetToken()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("PasswordCredential(");
+    boolean first = true;
+
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("password:");
+    if (this.password == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.password);
+    }
+    first = false;
+    if (isSetPersistedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("persistedTime:");
+      sb.append(this.persistedTime);
+      first = false;
+    }
+    if (isSetToken()) {
+      if (!first) sb.append(", ");
+      sb.append("token:");
+      if (this.token == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.token);
+      }
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+    }
+    if (password == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'password' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class PasswordCredentialStandardSchemeFactory implements SchemeFactory {
+    public PasswordCredentialStandardScheme getScheme() {
+      return new PasswordCredentialStandardScheme();
+    }
+  }
+
+  private static class PasswordCredentialStandardScheme extends StandardScheme<PasswordCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PasswordCredential struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // USERNAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.username = iprot.readString();
+              struct.setUsernameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // PASSWORD
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.password = iprot.readString();
+              struct.setPasswordIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.persistedTime = iprot.readI64();
+              struct.setPersistedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // TOKEN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.token = iprot.readString();
+              struct.setTokenIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, PasswordCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.password != null) {
+        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
+        oprot.writeString(struct.password);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.persistedTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.token != null) {
+        if (struct.isSetToken()) {
+          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
+          oprot.writeString(struct.token);
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class PasswordCredentialTupleSchemeFactory implements SchemeFactory {
+    public PasswordCredentialTupleScheme getScheme() {
+      return new PasswordCredentialTupleScheme();
+    }
+  }
+
+  private static class PasswordCredentialTupleScheme extends TupleScheme<PasswordCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.username);
+      oprot.writeString(struct.password);
+      BitSet optionals = new BitSet();
+      if (struct.isSetPersistedTime()) {
+        optionals.set(0);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(1);
+      }
+      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI64(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      struct.password = iprot.readString();
+      struct.setPasswordIsSet(true);
+      BitSet incoming = iprot.readBitSet(2);
+      if (incoming.get(0)) {
+        struct.persistedTime = iprot.readI64();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
new file mode 100644
index 0000000..9fc373a
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
@@ -0,0 +1,998 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class SSHCredential implements org.apache.thrift.TBase<SSHCredential, SSHCredential._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredential");
+
+  private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField PASSPHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("passphrase", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField PUBLIC_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("publicKey", org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)5);
+  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)6);
+  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)7);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new SSHCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new SSHCredentialTupleSchemeFactory());
+  }
+
+  public String gatewayId; // required
+  public String username; // required
+  public String passphrase; // required
+  public String publicKey; // optional
+  public String privateKey; // optional
+  public long persistedTime; // optional
+  public String token; // optional
+
+  /** 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 {
+    GATEWAY_ID((short)1, "gatewayId"),
+    USERNAME((short)2, "username"),
+    PASSPHRASE((short)3, "passphrase"),
+    PUBLIC_KEY((short)4, "publicKey"),
+    PRIVATE_KEY((short)5, "privateKey"),
+    PERSISTED_TIME((short)6, "persistedTime"),
+    TOKEN((short)7, "token");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // GATEWAY_ID
+          return GATEWAY_ID;
+        case 2: // USERNAME
+          return USERNAME;
+        case 3: // PASSPHRASE
+          return PASSPHRASE;
+        case 4: // PUBLIC_KEY
+          return PUBLIC_KEY;
+        case 5: // PRIVATE_KEY
+          return PRIVATE_KEY;
+        case 6: // PERSISTED_TIME
+          return PERSISTED_TIME;
+        case 7: // TOKEN
+          return TOKEN;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __PERSISTEDTIME_ISSET_ID = 0;
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.PUBLIC_KEY,_Fields.PRIVATE_KEY,_Fields.PERSISTED_TIME,_Fields.TOKEN};
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PASSPHRASE, new org.apache.thrift.meta_data.FieldMetaData("passphrase", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PUBLIC_KEY, new org.apache.thrift.meta_data.FieldMetaData("publicKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SSHCredential.class, metaDataMap);
+  }
+
+  public SSHCredential() {
+  }
+
+  public SSHCredential(
+    String gatewayId,
+    String username,
+    String passphrase)
+  {
+    this();
+    this.gatewayId = gatewayId;
+    this.username = username;
+    this.passphrase = passphrase;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public SSHCredential(SSHCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetGatewayId()) {
+      this.gatewayId = other.gatewayId;
+    }
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetPassphrase()) {
+      this.passphrase = other.passphrase;
+    }
+    if (other.isSetPublicKey()) {
+      this.publicKey = other.publicKey;
+    }
+    if (other.isSetPrivateKey()) {
+      this.privateKey = other.privateKey;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public SSHCredential deepCopy() {
+    return new SSHCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.gatewayId = null;
+    this.username = null;
+    this.passphrase = null;
+    this.publicKey = null;
+    this.privateKey = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public String getGatewayId() {
+    return this.gatewayId;
+  }
+
+  public SSHCredential setGatewayId(String gatewayId) {
+    this.gatewayId = gatewayId;
+    return this;
+  }
+
+  public void unsetGatewayId() {
+    this.gatewayId = null;
+  }
+
+  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+  public boolean isSetGatewayId() {
+    return this.gatewayId != null;
+  }
+
+  public void setGatewayIdIsSet(boolean value) {
+    if (!value) {
+      this.gatewayId = null;
+    }
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public SSHCredential setUsername(String username) {
+    this.username = username;
+    return this;
+  }
+
+  public void unsetUsername() {
+    this.username = null;
+  }
+
+  /** Returns true if field username is set (has been assigned a value) and false otherwise */
+  public boolean isSetUsername() {
+    return this.username != null;
+  }
+
+  public void setUsernameIsSet(boolean value) {
+    if (!value) {
+      this.username = null;
+    }
+  }
+
+  public String getPassphrase() {
+    return this.passphrase;
+  }
+
+  public SSHCredential setPassphrase(String passphrase) {
+    this.passphrase = passphrase;
+    return this;
+  }
+
+  public void unsetPassphrase() {
+    this.passphrase = null;
+  }
+
+  /** Returns true if field passphrase is set (has been assigned a value) and false otherwise */
+  public boolean isSetPassphrase() {
+    return this.passphrase != null;
+  }
+
+  public void setPassphraseIsSet(boolean value) {
+    if (!value) {
+      this.passphrase = null;
+    }
+  }
+
+  public String getPublicKey() {
+    return this.publicKey;
+  }
+
+  public SSHCredential setPublicKey(String publicKey) {
+    this.publicKey = publicKey;
+    return this;
+  }
+
+  public void unsetPublicKey() {
+    this.publicKey = null;
+  }
+
+  /** Returns true if field publicKey is set (has been assigned a value) and false otherwise */
+  public boolean isSetPublicKey() {
+    return this.publicKey != null;
+  }
+
+  public void setPublicKeyIsSet(boolean value) {
+    if (!value) {
+      this.publicKey = null;
+    }
+  }
+
+  public String getPrivateKey() {
+    return this.privateKey;
+  }
+
+  public SSHCredential setPrivateKey(String privateKey) {
+    this.privateKey = privateKey;
+    return this;
+  }
+
+  public void unsetPrivateKey() {
+    this.privateKey = null;
+  }
+
+  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
+  public boolean isSetPrivateKey() {
+    return this.privateKey != null;
+  }
+
+  public void setPrivateKeyIsSet(boolean value) {
+    if (!value) {
+      this.privateKey = null;
+    }
+  }
+
+  public long getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public SSHCredential setPersistedTime(long persistedTime) {
+    this.persistedTime = persistedTime;
+    setPersistedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetPersistedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetPersistedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  public void setPersistedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
+  }
+
+  public String getToken() {
+    return this.token;
+  }
+
+  public SSHCredential setToken(String token) {
+    this.token = token;
+    return this;
+  }
+
+  public void unsetToken() {
+    this.token = null;
+  }
+
+  /** Returns true if field token is set (has been assigned a value) and false otherwise */
+  public boolean isSetToken() {
+    return this.token != null;
+  }
+
+  public void setTokenIsSet(boolean value) {
+    if (!value) {
+      this.token = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case GATEWAY_ID:
+      if (value == null) {
+        unsetGatewayId();
+      } else {
+        setGatewayId((String)value);
+      }
+      break;
+
+    case USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case PASSPHRASE:
+      if (value == null) {
+        unsetPassphrase();
+      } else {
+        setPassphrase((String)value);
+      }
+      break;
+
+    case PUBLIC_KEY:
+      if (value == null) {
+        unsetPublicKey();
+      } else {
+        setPublicKey((String)value);
+      }
+      break;
+
+    case PRIVATE_KEY:
+      if (value == null) {
+        unsetPrivateKey();
+      } else {
+        setPrivateKey((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Long)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case GATEWAY_ID:
+      return getGatewayId();
+
+    case USERNAME:
+      return getUsername();
+
+    case PASSPHRASE:
+      return getPassphrase();
+
+    case PUBLIC_KEY:
+      return getPublicKey();
+
+    case PRIVATE_KEY:
+      return getPrivateKey();
+
+    case PERSISTED_TIME:
+      return Long.valueOf(getPersistedTime());
+
+    case TOKEN:
+      return getToken();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case GATEWAY_ID:
+      return isSetGatewayId();
+    case USERNAME:
+      return isSetUsername();
+    case PASSPHRASE:
+      return isSetPassphrase();
+    case PUBLIC_KEY:
+      return isSetPublicKey();
+    case PRIVATE_KEY:
+      return isSetPrivateKey();
+    case PERSISTED_TIME:
+      return isSetPersistedTime();
+    case TOKEN:
+      return isSetToken();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof SSHCredential)
+      return this.equals((SSHCredential)that);
+    return false;
+  }
+
+  public boolean equals(SSHCredential that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_gatewayId = true && this.isSetGatewayId();
+    boolean that_present_gatewayId = true && that.isSetGatewayId();
+    if (this_present_gatewayId || that_present_gatewayId) {
+      if (!(this_present_gatewayId && that_present_gatewayId))
+        return false;
+      if (!this.gatewayId.equals(that.gatewayId))
+        return false;
+    }
+
+    boolean this_present_username = true && this.isSetUsername();
+    boolean that_present_username = true && that.isSetUsername();
+    if (this_present_username || that_present_username) {
+      if (!(this_present_username && that_present_username))
+        return false;
+      if (!this.username.equals(that.username))
+        return false;
+    }
+
+    boolean this_present_passphrase = true && this.isSetPassphrase();
+    boolean that_present_passphrase = true && that.isSetPassphrase();
+    if (this_present_passphrase || that_present_passphrase) {
+      if (!(this_present_passphrase && that_present_passphrase))
+        return false;
+      if (!this.passphrase.equals(that.passphrase))
+        return false;
+    }
+
+    boolean this_present_publicKey = true && this.isSetPublicKey();
+    boolean that_present_publicKey = true && that.isSetPublicKey();
+    if (this_present_publicKey || that_present_publicKey) {
+      if (!(this_present_publicKey && that_present_publicKey))
+        return false;
+      if (!this.publicKey.equals(that.publicKey))
+        return false;
+    }
+
+    boolean this_present_privateKey = true && this.isSetPrivateKey();
+    boolean that_present_privateKey = true && that.isSetPrivateKey();
+    if (this_present_privateKey || that_present_privateKey) {
+      if (!(this_present_privateKey && that_present_privateKey))
+        return false;
+      if (!this.privateKey.equals(that.privateKey))
+        return false;
+    }
+
+    boolean this_present_persistedTime = true && this.isSetPersistedTime();
+    boolean that_present_persistedTime = true && that.isSetPersistedTime();
+    if (this_present_persistedTime || that_present_persistedTime) {
+      if (!(this_present_persistedTime && that_present_persistedTime))
+        return false;
+      if (this.persistedTime != that.persistedTime)
+        return false;
+    }
+
+    boolean this_present_token = true && this.isSetToken();
+    boolean that_present_token = true && that.isSetToken();
+    if (this_present_token || that_present_token) {
+      if (!(this_present_token && that_present_token))
+        return false;
+      if (!this.token.equals(that.token))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(SSHCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGatewayId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUsername()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPassphrase()).compareTo(other.isSetPassphrase());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPassphrase()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passphrase, other.passphrase);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPublicKey()).compareTo(other.isSetPublicKey());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPublicKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.publicKey, other.publicKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPrivateKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPersistedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetToken()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("SSHCredential(");
+    boolean first = true;
+
+    sb.append("gatewayId:");
+    if (this.gatewayId == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.gatewayId);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("passphrase:");
+    if (this.passphrase == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.passphrase);
+    }
+    first = false;
+    if (isSetPublicKey()) {
+      if (!first) sb.append(", ");
+      sb.append("publicKey:");
+      if (this.publicKey == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.publicKey);
+      }
+      first = false;
+    }
+    if (isSetPrivateKey()) {
+      if (!first) sb.append(", ");
+      sb.append("privateKey:");
+      if (this.privateKey == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.privateKey);
+      }
+      first = false;
+    }
+    if (isSetPersistedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("persistedTime:");
+      sb.append(this.persistedTime);
+      first = false;
+    }
+    if (isSetToken()) {
+      if (!first) sb.append(", ");
+      sb.append("token:");
+      if (this.token == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.token);
+      }
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (gatewayId == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
+    }
+    if (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+    }
+    if (passphrase == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'passphrase' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class SSHCredentialStandardSchemeFactory implements SchemeFactory {
+    public SSHCredentialStandardScheme getScheme() {
+      return new SSHCredentialStandardScheme();
+    }
+  }
+
+  private static class SSHCredentialStandardScheme extends StandardScheme<SSHCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, SSHCredential struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // GATEWAY_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.gatewayId = iprot.readString();
+              struct.setGatewayIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // USERNAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.username = iprot.readString();
+              struct.setUsernameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // PASSPHRASE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.passphrase = iprot.readString();
+              struct.setPassphraseIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // PUBLIC_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.publicKey = iprot.readString();
+              struct.setPublicKeyIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // PRIVATE_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.privateKey = iprot.readString();
+              struct.setPrivateKeyIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.persistedTime = iprot.readI64();
+              struct.setPersistedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // TOKEN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.token = iprot.readString();
+              struct.setTokenIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, SSHCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.gatewayId != null) {
+        oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+        oprot.writeString(struct.gatewayId);
+        oprot.writeFieldEnd();
+      }
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.passphrase != null) {
+        oprot.writeFieldBegin(PASSPHRASE_FIELD_DESC);
+        oprot.writeString(struct.passphrase);
+        oprot.writeFieldEnd();
+      }
+      if (struct.publicKey != null) {
+        if (struct.isSetPublicKey()) {
+          oprot.writeFieldBegin(PUBLIC_KEY_FIELD_DESC);
+          oprot.writeString(struct.publicKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.privateKey != null) {
+        if (struct.isSetPrivateKey()) {
+          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
+          oprot.writeString(struct.privateKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.persistedTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.token != null) {
+        if (struct.isSetToken()) {
+          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
+          oprot.writeString(struct.token);
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class SSHCredentialTupleSchemeFactory implements SchemeFactory {
+    public SSHCredentialTupleScheme getScheme() {
+      return new SSHCredentialTupleScheme();
+    }
+  }
+
+  private static class SSHCredentialTupleScheme extends TupleScheme<SSHCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.gatewayId);
+      oprot.writeString(struct.username);
+      oprot.writeString(struct.passphrase);
+      BitSet optionals = new BitSet();
+      if (struct.isSetPublicKey()) {
+        optionals.set(0);
+      }
+      if (struct.isSetPrivateKey()) {
+        optionals.set(1);
+      }
+      if (struct.isSetPersistedTime()) {
+        optionals.set(2);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(3);
+      }
+      oprot.writeBitSet(optionals, 4);
+      if (struct.isSetPublicKey()) {
+        oprot.writeString(struct.publicKey);
+      }
+      if (struct.isSetPrivateKey()) {
+        oprot.writeString(struct.privateKey);
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI64(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.gatewayId = iprot.readString();
+      struct.setGatewayIdIsSet(true);
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      struct.passphrase = iprot.readString();
+      struct.setPassphraseIsSet(true);
+      BitSet incoming = iprot.readBitSet(4);
+      if (incoming.get(0)) {
+        struct.publicKey = iprot.readString();
+        struct.setPublicKeyIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.privateKey = iprot.readString();
+        struct.setPrivateKeyIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.persistedTime = iprot.readI64();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
new file mode 100644
index 0000000..b17513a
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
@@ -0,0 +1,55 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class csDataModelConstants {
+
+  public static final String DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS";
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
new file mode 100644
index 0000000..7be01da
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
@@ -0,0 +1,397 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.exception;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CredentialStoreException extends TException implements org.apache.thrift.TBase<CredentialStoreException, CredentialStoreException._Fields>, java.io.Serializable, Cloneable, Comparable<CredentialStoreException> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CredentialStoreException");
+
+  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new CredentialStoreExceptionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new CredentialStoreExceptionTupleSchemeFactory());
+  }
+
+  public String message; // 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 {
+    MESSAGE((short)1, "message");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // MESSAGE
+          return MESSAGE;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(CredentialStoreException.class, metaDataMap);
+  }
+
+  public CredentialStoreException() {
+  }
+
+  public CredentialStoreException(
+    String message)
+  {
+    this();
+    this.message = message;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CredentialStoreException(CredentialStoreException other) {
+    if (other.isSetMessage()) {
+      this.message = other.message;
+    }
+  }
+
+  public CredentialStoreException deepCopy() {
+    return new CredentialStoreException(this);
+  }
+
+  @Override
+  public void clear() {
+    this.message = null;
+  }
+
+  public String getMessage() {
+    return this.message;
+  }
+
+  public CredentialStoreException setMessage(String message) {
+    this.message = message;
+    return this;
+  }
+
+  public void unsetMessage() {
+    this.message = null;
+  }
+
+  /** Returns true if field message is set (has been assigned a value) and false otherwise */
+  public boolean isSetMessage() {
+    return this.message != null;
+  }
+
+  public void setMessageIsSet(boolean value) {
+    if (!value) {
+      this.message = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case MESSAGE:
+      if (value == null) {
+        unsetMessage();
+      } else {
+        setMessage((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case MESSAGE:
+      return getMessage();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case MESSAGE:
+      return isSetMessage();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof CredentialStoreException)
+      return this.equals((CredentialStoreException)that);
+    return false;
+  }
+
+  public boolean equals(CredentialStoreException that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_message = true && this.isSetMessage();
+    boolean that_present_message = true && that.isSetMessage();
+    if (this_present_message || that_present_message) {
+      if (!(this_present_message && that_present_message))
+        return false;
+      if (!this.message.equals(that.message))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CredentialStoreException other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMessage()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("CredentialStoreException(");
+    boolean first = true;
+
+    sb.append("message:");
+    if (this.message == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.message);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (message == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class CredentialStoreExceptionStandardSchemeFactory implements SchemeFactory {
+    public CredentialStoreExceptionStandardScheme getScheme() {
+      return new CredentialStoreExceptionStandardScheme();
+    }
+  }
+
+  private static class CredentialStoreExceptionStandardScheme extends StandardScheme<CredentialStoreException> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // MESSAGE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.message = iprot.readString();
+              struct.setMessageIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.message != null) {
+        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+        oprot.writeString(struct.message);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class CredentialStoreExceptionTupleSchemeFactory implements SchemeFactory {
+    public CredentialStoreExceptionTupleScheme getScheme() {
+      return new CredentialStoreExceptionTupleScheme();
+    }
+  }
+
+  private static class CredentialStoreExceptionTupleScheme extends TupleScheme<CredentialStoreException> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.message);
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.message = iprot.readString();
+      struct.setMessageIsSet(true);
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java
new file mode 100644
index 0000000..62b6e27
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java
@@ -0,0 +1,42 @@
+package org.apache.airavata.credential.store.notifier;/*
+ *
+ * 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.
+ *
+ */
+
+
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+
+/**
+ * This class is used to notify particular entity with expiring credentials.
+ * The default implementation uses email messages.
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 12/3/13
+ * Time: 4:17 PM
+ */
+public interface CredentialStoreNotifier {
+
+    /**
+     * The specific notifier implementation needs to implement following method.
+     * This method should actually deliver message to desired entity.
+     * @param message The actual message encapsulated
+     * @throws CredentialStoreException
+     */
+    void notifyMessage(NotificationMessage message) throws CredentialStoreException;
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java
new file mode 100644
index 0000000..96f0bd9
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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.credential.store.notifier;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 12/3/13
+ * Time: 4:21 PM
+ */
+
+/**
+ * Encapsulates the notification message.
+ * Usually says particular credential is expiring and need to renew.
+ */
+public class NotificationMessage {
+
+    protected String message;
+
+    public NotificationMessage(String msg) {
+        this.message = msg;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java
new file mode 100644
index 0000000..de84ae2
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java
@@ -0,0 +1,144 @@
+/*
+ *
+ * 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.credential.store.notifier;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 12/27/13
+ * Time: 2:22 PM
+ */
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+import org.apache.airavata.credential.store.credential.Credential;
+import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
+import org.apache.airavata.credential.store.notifier.impl.EmailNotificationMessage;
+import org.apache.airavata.credential.store.notifier.impl.EmailNotifier;
+import org.apache.airavata.credential.store.notifier.impl.EmailNotifierConfiguration;
+import org.apache.airavata.credential.store.store.CredentialReader;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
+import org.apache.airavata.credential.store.util.Utility;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * This class runs a timer. Periodically it checks for expiring credentials.
+ * Then if there are expiring credentials this will send an email.
+ */
+public class NotifierBootstrap extends TimerTask {
+
+    private static boolean enabled = false;
+
+    private static String MESSAGE = "Credentials for community user {0} expires at {1}";
+    private static String SUBJECT = "Expiring credentials for user {0}";
+
+    private DBUtil dbUtil;
+
+    private long period;
+
+    protected static Logger log = LoggerFactory.getLogger(NotifierBootstrap.class);
+
+
+    private CredentialStoreNotifier credentialStoreNotifier;
+
+    public NotifierBootstrap(long period, DBUtil db, EmailNotifierConfiguration configuration) {
+        this.period = period;
+
+        // bootstrap
+        if (enabled) {
+            Timer timer = new Timer();
+            timer.scheduleAtFixedRate(this, 0, period);
+        }
+
+        this.dbUtil = db;
+
+        this.credentialStoreNotifier = new EmailNotifier(configuration);
+    }
+
+
+
+    public long getPeriod() {
+        return period;
+    }
+
+    public void setPeriod(long period) {
+        this.period = period;
+    }
+
+    public static boolean isEnabled() {
+        return enabled;
+    }
+
+    public static void setEnabled(boolean enabled) {
+        NotifierBootstrap.enabled = enabled;
+    }
+
+    @Override
+    public void run() {
+
+        if (!enabled)
+            return;
+
+        // retrieve OA4MP credentials
+        try {
+            CredentialReader credentialReader = new CredentialReaderImpl(this.dbUtil);
+            List<Credential> credentials = credentialReader.getAllCredentials();
+
+            for(Credential credential : credentials) {
+                if (credential instanceof CertificateCredential) {
+                    CertificateCredential certificateCredential = (CertificateCredential)credential;
+
+                    Date date = Utility.convertStringToDate(certificateCredential.getNotAfter());
+                    date.setDate(date.getDate() + 1);    // gap is 1 days
+
+                    Date currentDate = new Date();
+                    if (currentDate.after(date)) {
+                        // Send an email
+                        CommunityUser communityUser = certificateCredential.getCommunityUser();
+                        String body =
+                                String.format(MESSAGE, communityUser.getUserName(), certificateCredential.getNotAfter());
+                        String subject = String.format(SUBJECT, communityUser.getUserName());
+                        NotificationMessage notificationMessage
+                                = new EmailNotificationMessage(subject, communityUser.getUserEmail(), body);
+
+                        this.credentialStoreNotifier.notifyMessage(notificationMessage);
+
+                    }
+                }
+            }
+
+        } catch (ApplicationSettingsException e) {
+            log.error("Error configuring email senders.", e);
+        } catch (CredentialStoreException e) {
+            log.error("Error sending emails about credential expiring.", e);
+        } catch (ParseException e) {
+            log.error("Error parsing date time when sending emails", e);
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java
new file mode 100644
index 0000000..ffd84c8
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java
@@ -0,0 +1,58 @@
+/*
+ *
+ * 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.credential.store.notifier.impl;
+
+import org.apache.airavata.credential.store.notifier.NotificationMessage;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 12/3/13
+ * Time: 5:01 PM
+ */
+
+public class EmailNotificationMessage extends NotificationMessage {
+
+    public EmailNotificationMessage(String subject, String senderEmail, String msg) {
+        super(msg);
+        this.subject = subject;
+        this.senderEmail = senderEmail;
+    }
+
+    private String subject;
+    private String senderEmail;
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public String getSenderEmail() {
+        return senderEmail;
+    }
+
+    public void setSenderEmail(String senderEmail) {
+        this.senderEmail = senderEmail;
+    }
+}


[35/62] [abbrv] airavata git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata

Posted by la...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/34b06cc9
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/34b06cc9
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/34b06cc9

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 34b06cc9999d747cd21eee356049f5dbc47dc45e
Parents: fcbda21 fd557d8
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Mon Mar 9 17:03:46 2015 -0400
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Mon Mar 9 17:03:46 2015 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 43 ++++++++++++++++++++
 .../data/impl/GwyResourceProfileImpl.java       |  2 +-
 .../integration/tools/DocumentCreatorNew.java   |  7 +++-
 3 files changed, 49 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[26/62] [abbrv] airavata git commit: Moving credential store client to stubs module.

Posted by la...@apache.org.
Moving credential store client to stubs module.


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/52f1e758
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/52f1e758
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/52f1e758

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 52f1e758ee7c8a0ac757d45a8b67f7d6e9ab4c70
Parents: e9468ca
Author: Suresh Marru <sm...@apache.org>
Authored: Fri Mar 6 14:15:26 2015 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Fri Mar 6 14:15:26 2015 -0500

----------------------------------------------------------------------
 .../credential/store/client/TestSSLClient.java  | 140 -------------------
 .../credential/store/client/TestSSLClient.java  | 140 +++++++++++++++++++
 2 files changed, 140 insertions(+), 140 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/52f1e758/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
deleted file mode 100644
index cc5ebb6..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
+++ /dev/null
@@ -1,140 +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.credential.store.client;
-
-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.ServerSettings;
-import org.apache.airavata.credential.store.cpi.CredentialStoreService;
-import org.apache.airavata.credential.store.datamodel.CertificateCredential;
-import org.apache.airavata.credential.store.datamodel.CommunityUser;
-import org.apache.airavata.credential.store.datamodel.SSHCredential;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TSSLTransportFactory;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import org.apache.commons.codec.binary.Base64;
-
-public class TestSSLClient {
-    private void invoke() {
-        TTransport transport;
-        try {
-            AiravataUtils.setExecutionAsServer();
-            TSSLTransportFactory.TSSLTransportParameters params =
-                    new TSSLTransportFactory.TSSLTransportParameters();
-            String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
-            String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
-            params.setTrustStore(keystorePath, keystorePWD);
-            final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_PORT, "8960"));
-            final String serverHost = ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_HOST, null);
-
-            transport = TSSLTransportFactory.getClientSocket(serverHost, serverPort, 10000, params);
-            TProtocol protocol = new TBinaryProtocol(transport);
-
-            CredentialStoreService.Client client = new CredentialStoreService.Client(protocol);
-//            testSSHCredential(client);
-            testCertificateCredential(client);
-            transport.close();
-        } catch (TTransportException e) {
-            e.printStackTrace();
-        }catch (ApplicationSettingsException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void testSSHCredential (CredentialStoreService.Client client){
-        try {
-            SSHCredential sshCredential = new SSHCredential();
-            sshCredential.setUsername("test");
-            sshCredential.setGatewayId("testGateway");
-            sshCredential.setPassphrase("mypassphrase");
-            String token = client.addSSHCredential(sshCredential);
-            System.out.println("SSH Token :" + token);
-            SSHCredential credential = client.getSSHCredential(token, "testGateway");
-            System.out.println("private key : " + credential.getPrivateKey());
-            System.out.println("public key : " + credential.getPublicKey());
-        }catch (TTransportException e) {
-            e.printStackTrace();
-        } catch (TException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void testCertificateCredential (CredentialStoreService.Client client){
-        try {
-            CertificateCredential certificateCredential = new CertificateCredential();
-            CommunityUser communityUser = new CommunityUser("testGateway", "test", "test@ddsd");
-            certificateCredential.setCommunityUser(communityUser);
-            X509Certificate[] x509Certificates = new X509Certificate[1];
-            KeyStore ks = KeyStore.getInstance("JKS");
-            File keyStoreFile = new File("/Users/smarru/code/airavata-master/modules/configuration/server/src/main/resources/airavata.jks");
-            FileInputStream fis = new FileInputStream(keyStoreFile);
-            char[] password = "airavata".toCharArray();
-            ks.load(fis,password);
-            x509Certificates[0] = (X509Certificate) ks.getCertificate("airavata");
-            Base64 encoder = new Base64(64);
-            String cert_begin = "-----BEGIN CERTIFICATE-----\n";
-            String end_cert = "-----END CERTIFICATE-----";
-            byte[] derCert = x509Certificates[0].getEncoded();
-            String pemCertPre = new String(encoder.encode(derCert));
-            String pemCert = cert_begin + pemCertPre + end_cert;
-            certificateCredential.setX509Cert(pemCert);
-            String token = client.addCertificateCredential(certificateCredential);
-            System.out.println("Certificate Token :" + token);
-            CertificateCredential credential = client.getCertificateCredential(token, "testGateway");
-            System.out.println("certificate : " + credential.getX509Cert());
-            System.out.println("gateway name  : " + credential.getCommunityUser().getGatewayName());
-        }catch (TTransportException e) {
-            e.printStackTrace();
-        } catch (TException e) {
-            e.printStackTrace();
-        } catch (KeyStoreException e) {
-            e.printStackTrace();
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-        } catch (CertificateException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void main(String[] args) {
-        TestSSLClient c = new TestSSLClient();
-        c.invoke();
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/52f1e758/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
new file mode 100644
index 0000000..cc5ebb6
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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.credential.store.client;
+
+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.ServerSettings;
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import org.apache.airavata.credential.store.datamodel.CertificateCredential;
+import org.apache.airavata.credential.store.datamodel.CommunityUser;
+import org.apache.airavata.credential.store.datamodel.SSHCredential;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSSLTransportFactory;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import org.apache.commons.codec.binary.Base64;
+
+public class TestSSLClient {
+    private void invoke() {
+        TTransport transport;
+        try {
+            AiravataUtils.setExecutionAsServer();
+            TSSLTransportFactory.TSSLTransportParameters params =
+                    new TSSLTransportFactory.TSSLTransportParameters();
+            String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
+            String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
+            params.setTrustStore(keystorePath, keystorePWD);
+            final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_PORT, "8960"));
+            final String serverHost = ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_HOST, null);
+
+            transport = TSSLTransportFactory.getClientSocket(serverHost, serverPort, 10000, params);
+            TProtocol protocol = new TBinaryProtocol(transport);
+
+            CredentialStoreService.Client client = new CredentialStoreService.Client(protocol);
+//            testSSHCredential(client);
+            testCertificateCredential(client);
+            transport.close();
+        } catch (TTransportException e) {
+            e.printStackTrace();
+        }catch (ApplicationSettingsException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void testSSHCredential (CredentialStoreService.Client client){
+        try {
+            SSHCredential sshCredential = new SSHCredential();
+            sshCredential.setUsername("test");
+            sshCredential.setGatewayId("testGateway");
+            sshCredential.setPassphrase("mypassphrase");
+            String token = client.addSSHCredential(sshCredential);
+            System.out.println("SSH Token :" + token);
+            SSHCredential credential = client.getSSHCredential(token, "testGateway");
+            System.out.println("private key : " + credential.getPrivateKey());
+            System.out.println("public key : " + credential.getPublicKey());
+        }catch (TTransportException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void testCertificateCredential (CredentialStoreService.Client client){
+        try {
+            CertificateCredential certificateCredential = new CertificateCredential();
+            CommunityUser communityUser = new CommunityUser("testGateway", "test", "test@ddsd");
+            certificateCredential.setCommunityUser(communityUser);
+            X509Certificate[] x509Certificates = new X509Certificate[1];
+            KeyStore ks = KeyStore.getInstance("JKS");
+            File keyStoreFile = new File("/Users/smarru/code/airavata-master/modules/configuration/server/src/main/resources/airavata.jks");
+            FileInputStream fis = new FileInputStream(keyStoreFile);
+            char[] password = "airavata".toCharArray();
+            ks.load(fis,password);
+            x509Certificates[0] = (X509Certificate) ks.getCertificate("airavata");
+            Base64 encoder = new Base64(64);
+            String cert_begin = "-----BEGIN CERTIFICATE-----\n";
+            String end_cert = "-----END CERTIFICATE-----";
+            byte[] derCert = x509Certificates[0].getEncoded();
+            String pemCertPre = new String(encoder.encode(derCert));
+            String pemCert = cert_begin + pemCertPre + end_cert;
+            certificateCredential.setX509Cert(pemCert);
+            String token = client.addCertificateCredential(certificateCredential);
+            System.out.println("Certificate Token :" + token);
+            CertificateCredential credential = client.getCertificateCredential(token, "testGateway");
+            System.out.println("certificate : " + credential.getX509Cert());
+            System.out.println("gateway name  : " + credential.getCommunityUser().getGatewayName());
+        }catch (TTransportException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        } catch (KeyStoreException e) {
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (CertificateException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) {
+        TestSSLClient c = new TestSSLClient();
+        c.invoke();
+
+    }
+}


[17/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/58c58cf2
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/58c58cf2
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/58c58cf2

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 58c58cf209fbfdd6873aaf718ff6927f07f764e2
Parents: 66de372
Author: Suresh Marru <sm...@apache.org>
Authored: Thu Mar 5 14:36:16 2015 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Thu Mar 5 14:36:17 2015 -0500

----------------------------------------------------------------------
 .../credential-store-webapp/pom.xml             |  158 -
 .../basic/BasicAccessAuthenticator.java         |  226 -
 .../credentialstore/local/LocalUserStore.java   |  339 -
 .../session/HttpAuthenticatorFilter.java        |  191 -
 .../session/ServletRequestHelper.java           |  129 -
 .../main/resources/airavata-server.properties   |  234 -
 .../main/resources/credential-store/client.xml  |   36 -
 .../credential-store/oauth-privkey.pk8          |   28 -
 .../resources/credential-store/oauth-pubkey.pem |    9 -
 .../src/main/webapp/WEB-INF/web.xml             |  130 -
 .../src/main/webapp/acs/index.jsp               |   44 -
 .../src/main/webapp/credential-store/error.jsp  |   53 -
 .../credential-store/password-credentials.jsp   |   33 -
 .../webapp/credential-store/show-redirect.jsp   |   44 -
 .../main/webapp/credential-store/success.jsp    |   25 -
 .../src/main/webapp/gateway/acs.jsp             |   62 -
 .../src/main/webapp/gateway/callback.jsp        |   78 -
 .../src/main/webapp/gateway/list_users.jsp      |   78 -
 .../src/main/webapp/gateway/logout.jsp          |   35 -
 .../src/main/webapp/gateway/user.jsp            |  102 -
 .../src/main/webapp/images/airavata-logo-2.png  |  Bin 4314 -> 0 bytes
 .../src/main/webapp/index.jsp                   |   26 -
 .../src/main/webapp/user-store/add.jsp          |  142 -
 .../src/main/webapp/user-store/index.jsp        |  138 -
 .../src/main/webapp/user-store/password.jsp     |  157 -
 .../credential-store/pom.xml                    |  154 -
 .../scripts/credential-store-h2.sql             |   42 -
 .../scripts/credential-store-mysql.sql          |   42 -
 .../credential/store/client/TestSSLClient.java  |  140 -
 .../store/cpi/CredentialStoreService.java       | 6888 ------------------
 .../store/cpi/cs_cpi_serviceConstants.java      |   55 -
 .../credential/store/credential/AuditInfo.java  |   53 -
 .../store/credential/CommunityUser.java         |   71 -
 .../credential/store/credential/Credential.java |   62 -
 .../impl/certificate/CertificateAuditInfo.java  |  101 -
 .../impl/certificate/CertificateCredential.java |  102 -
 .../impl/password/PasswordCredential.java       |   53 -
 .../credential/impl/ssh/SSHCredential.java      |   88 -
 .../impl/ssh/SSHCredentialGenerator.java        |  103 -
 .../store/datamodel/CertificateCredential.java  | 1104 ---
 .../store/datamodel/CommunityUser.java          |  589 --
 .../store/datamodel/PasswordCredential.java     |  698 --
 .../store/datamodel/SSHCredential.java          |  998 ---
 .../store/datamodel/csDataModelConstants.java   |   55 -
 .../exception/CredentialStoreException.java     |  397 -
 .../store/notifier/CredentialStoreNotifier.java |   42 -
 .../store/notifier/NotificationMessage.java     |   46 -
 .../store/notifier/NotifierBootstrap.java       |  144 -
 .../notifier/impl/EmailNotificationMessage.java |   58 -
 .../store/notifier/impl/EmailNotifier.java      |   71 -
 .../impl/EmailNotifierConfiguration.java        |   84 -
 .../store/server/CredentialStoreServer.java     |  158 -
 .../server/CredentialStoreServerHandler.java    |  202 -
 .../store/servlet/CredentialBootstrapper.java   |   49 -
 .../servlet/CredentialStoreCallbackServlet.java |  272 -
 .../servlet/CredentialStoreStartServlet.java    |  183 -
 .../store/store/CredentialReader.java           |  112 -
 .../store/store/CredentialReaderFactory.java    |   54 -
 .../store/store/CredentialStoreException.java   |   40 -
 .../store/store/CredentialWriter.java           |   39 -
 .../store/impl/CertificateCredentialWriter.java |  121 -
 .../store/store/impl/CredentialReaderImpl.java  |  162 -
 .../store/store/impl/SSHCredentialWriter.java   |   87 -
 .../store/store/impl/db/CommunityUserDAO.java   |  257 -
 .../store/store/impl/db/CredentialsDAO.java     |  458 --
 .../store/store/impl/db/ParentDAO.java          |   37 -
 .../store/util/ConfigurationReader.java         |  121 -
 .../store/util/CredentialStoreConstants.java    |   37 -
 .../credential/store/util/PrivateKeyStore.java  |   70 -
 .../credential/store/util/TokenGenerator.java   |   57 -
 .../airavata/credential/store/util/Utility.java |  110 -
 .../store/notifier/impl/EmailNotifierTest.java  |   56 -
 .../store/impl/db/CommunityUserDAOTest.java     |  207 -
 .../store/store/impl/db/CredentialsDAOTest.java |  421 --
 .../store/util/ConfigurationReaderTest.java     |   58 -
 .../store/util/TokenGeneratorTest.java          |   42 -
 .../test/resources/credential-store/client.xml  |   35 -
 .../src/test/resources/keystore.jks             |  Bin 2230 -> 0 bytes
 .../src/test/resources/mykeystore.jks           |  Bin 498 -> 0 bytes
 .../credentialStoreErrors.thrift                |   32 -
 .../cs-thrift-description/cs.cpi.service.thrift |   61 -
 .../cs-thrift-description/csDataModel.thrift    |   61 -
 .../cs-thrift-description/generate-cs-stubs.sh  |  134 -
 modules/credential-store-service/pom.xml        |   42 -
 .../credential-store-service/pom.xml            |  154 +
 .../scripts/credential-store-h2.sql             |   42 +
 .../scripts/credential-store-mysql.sql          |   42 +
 .../credential/store/client/TestSSLClient.java  |  140 +
 .../store/cpi/CredentialStoreService.java       | 6888 ++++++++++++++++++
 .../store/cpi/cs_cpi_serviceConstants.java      |   55 +
 .../credential/store/credential/AuditInfo.java  |   53 +
 .../store/credential/CommunityUser.java         |   71 +
 .../credential/store/credential/Credential.java |   62 +
 .../impl/certificate/CertificateAuditInfo.java  |  101 +
 .../impl/certificate/CertificateCredential.java |  102 +
 .../impl/password/PasswordCredential.java       |   53 +
 .../credential/impl/ssh/SSHCredential.java      |   88 +
 .../impl/ssh/SSHCredentialGenerator.java        |  103 +
 .../store/datamodel/CertificateCredential.java  | 1104 +++
 .../store/datamodel/CommunityUser.java          |  589 ++
 .../store/datamodel/PasswordCredential.java     |  698 ++
 .../store/datamodel/SSHCredential.java          |  998 +++
 .../store/datamodel/csDataModelConstants.java   |   55 +
 .../exception/CredentialStoreException.java     |  397 +
 .../store/notifier/CredentialStoreNotifier.java |   42 +
 .../store/notifier/NotificationMessage.java     |   46 +
 .../store/notifier/NotifierBootstrap.java       |  144 +
 .../notifier/impl/EmailNotificationMessage.java |   58 +
 .../store/notifier/impl/EmailNotifier.java      |   71 +
 .../impl/EmailNotifierConfiguration.java        |   84 +
 .../store/server/CredentialStoreServer.java     |  158 +
 .../server/CredentialStoreServerHandler.java    |  202 +
 .../store/servlet/CredentialBootstrapper.java   |   49 +
 .../servlet/CredentialStoreCallbackServlet.java |  272 +
 .../servlet/CredentialStoreStartServlet.java    |  183 +
 .../store/store/CredentialReader.java           |  112 +
 .../store/store/CredentialReaderFactory.java    |   54 +
 .../store/store/CredentialStoreException.java   |   40 +
 .../store/store/CredentialWriter.java           |   39 +
 .../store/impl/CertificateCredentialWriter.java |  121 +
 .../store/store/impl/CredentialReaderImpl.java  |  162 +
 .../store/store/impl/SSHCredentialWriter.java   |   87 +
 .../store/store/impl/db/CommunityUserDAO.java   |  257 +
 .../store/store/impl/db/CredentialsDAO.java     |  458 ++
 .../store/store/impl/db/ParentDAO.java          |   37 +
 .../store/util/ConfigurationReader.java         |  121 +
 .../store/util/CredentialStoreConstants.java    |   37 +
 .../credential/store/util/PrivateKeyStore.java  |   70 +
 .../credential/store/util/TokenGenerator.java   |   57 +
 .../airavata/credential/store/util/Utility.java |  110 +
 .../store/notifier/impl/EmailNotifierTest.java  |   56 +
 .../store/impl/db/CommunityUserDAOTest.java     |  207 +
 .../store/store/impl/db/CredentialsDAOTest.java |  421 ++
 .../store/util/ConfigurationReaderTest.java     |   58 +
 .../store/util/TokenGeneratorTest.java          |   42 +
 .../test/resources/credential-store/client.xml  |   35 +
 .../src/test/resources/keystore.jks             |  Bin 0 -> 2230 bytes
 .../src/test/resources/mykeystore.jks           |  Bin 0 -> 498 bytes
 .../credential-store-stubs/pom.xml              |   45 +
 .../store/cpi/CredentialStoreService.java       | 6888 ++++++++++++++++++
 .../store/cpi/credentialStoreCPIConstants.java  |   55 +
 .../store/datamodel/CertificateCredential.java  | 1104 +++
 .../store/datamodel/CommunityUser.java          |  589 ++
 .../store/datamodel/PasswordCredential.java     |  698 ++
 .../store/datamodel/SSHCredential.java          |  998 +++
 .../credentialStoreDataModelConstants.java      |   55 +
 .../exception/CredentialStoreException.java     |  397 +
 .../credential-store-webapp/pom.xml             |  158 +
 .../basic/BasicAccessAuthenticator.java         |  226 +
 .../credentialstore/local/LocalUserStore.java   |  339 +
 .../session/HttpAuthenticatorFilter.java        |  191 +
 .../session/ServletRequestHelper.java           |  129 +
 .../main/resources/airavata-server.properties   |  234 +
 .../main/resources/credential-store/client.xml  |   36 +
 .../credential-store/oauth-privkey.pk8          |   28 +
 .../resources/credential-store/oauth-pubkey.pem |    9 +
 .../src/main/webapp/WEB-INF/web.xml             |  130 +
 .../src/main/webapp/acs/index.jsp               |   44 +
 .../src/main/webapp/credential-store/error.jsp  |   53 +
 .../credential-store/password-credentials.jsp   |   33 +
 .../webapp/credential-store/show-redirect.jsp   |   44 +
 .../main/webapp/credential-store/success.jsp    |   25 +
 .../src/main/webapp/gateway/acs.jsp             |   62 +
 .../src/main/webapp/gateway/callback.jsp        |   78 +
 .../src/main/webapp/gateway/list_users.jsp      |   78 +
 .../src/main/webapp/gateway/logout.jsp          |   35 +
 .../src/main/webapp/gateway/user.jsp            |  102 +
 .../src/main/webapp/images/airavata-logo-2.png  |  Bin 0 -> 4314 bytes
 .../src/main/webapp/index.jsp                   |   26 +
 .../src/main/webapp/user-store/add.jsp          |  142 +
 .../src/main/webapp/user-store/index.jsp        |  138 +
 .../src/main/webapp/user-store/password.jsp     |  157 +
 .../credentialStoreCPI.thrift                   |   61 +
 .../credentialStoreDataModel.thrift             |   61 +
 .../credentialStoreErrors.thrift                |   32 +
 .../cs-thrift-descriptions/generate-cs-stubs.sh |  134 +
 modules/credential-store/pom.xml                |   43 +
 pom.xml                                         |    4 +-
 178 files changed, 29344 insertions(+), 18514 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/pom.xml b/modules/credential-store-service/credential-store-webapp/pom.xml
deleted file mode 100644
index 8122f9e..0000000
--- a/modules/credential-store-service/credential-store-webapp/pom.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--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. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata-credential-store-service</artifactId>
-        <version>0.15-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-credential-store-webapp</artifactId>
-    <packaging>war</packaging>
-    <name>airavata-credential-store-webapp</name>
-    <build>
-        <finalName>credential-store</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.cargo</groupId>
-                <artifactId>cargo-maven2-plugin</artifactId>
-                <version>${cargo.version}</version>
-                <configuration>
-                    <wait>true</wait>
-                    <configuration>
-                        <properties>
-                            <cargo.servlet.port>8443</cargo.servlet.port>
-                            <cargo.protocol>https</cargo.protocol>
-                            <cargo.tomcat.connector.clientAuth>false</cargo.tomcat.connector.clientAuth>
-                            <cargo.tomcat.connector.sslProtocol>TLS</cargo.tomcat.connector.sslProtocol>
-                            <cargo.tomcat.connector.keystoreFile>/Users/chathuri/dev/airavata/credential-store/oa4mp/airavata_sym.jks</cargo.tomcat.connector.keystoreFile>
-                            <cargo.tomcat.connector.keystorePass>airavata</cargo.tomcat.connector.keystorePass>
-                            <cargo.tomcat.ajp.port>9009</cargo.tomcat.ajp.port>
-                            <cargo.rmi.port>9099</cargo.rmi.port>
-                            <cargo.jvmargs>
-                                <![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend} -noverify ${javaagent}]]>
-                            </cargo.jvmargs>
-                            <cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable>
-                        </properties>
-                        <home>${project.build.directory}/tomcat6x</home>
-                        <deployables>
-                            <deployable>
-                                <groupId>org.apache.airavata</groupId>
-                                <artifactId>airavata-credential-store-webapp</artifactId>
-                                <type>war</type>
-                                <properties>
-                                    <context>/acs</context>
-                                </properties>
-                            </deployable>
-                        </deployables>
-                    </configuration>
-                    <container>
-                        <containerId>tomcat6x</containerId>
-                        <timeout>180000</timeout>
-                        <zipUrlInstaller>
-                            <url>
-                                http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
-                            </url>
-                        </zipUrlInstaller>
-                        <systemProperties>
-
-                        </systemProperties>
-                    </container>
-                </configuration>
-            </plugin>
-        </plugins>
-
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbyclient</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-credential-store</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>net.oauth.core</groupId>
-            <artifactId>oauth-httpclient4</artifactId>
-            <version>20090617</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-security</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-            <version>1.6</version>
-        </dependency>
-        <!-- <dependency>
-            <groupId>edu.uiuc.ncsa.myproxy</groupId>
-            <artifactId>oa4mp-client-oauth1</artifactId>
-            <version>${oa4mp.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>mysql</groupId>
-                    <artifactId>mysql-connector-java</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>postgresql</groupId>
-                    <artifactId>postgresql</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency> -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <version>${org.slf4j.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <version>${org.slf4j.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <version>${org.slf4j.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>${org.slf4j.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ebaysf.web</groupId>
-            <artifactId>cors-filter</artifactId>
-            <version>${ebay.cors.filter}</version>
-        </dependency>
-    </dependencies>
-    <properties>
-        <cargo.version>1.2.1</cargo.version>
-        <cargo.debug.address>8000</cargo.debug.address>
-        <cargo.debug.suspend>y</cargo.debug.suspend>
-        <javaagent />
-    </properties>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java b/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java
deleted file mode 100644
index c34cb1b..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java
+++ /dev/null
@@ -1,226 +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.credentialstore.basic;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.credentialstore.session.ServletRequestHelper;
-import org.apache.airavata.security.AbstractAuthenticator;
-import org.apache.airavata.security.AuthenticationException;
-import org.apache.airavata.security.UserStoreException;
-import org.w3c.dom.Node;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * This authenticator handles basic access authentication requests. In basic access authentication
- * we get user name and password as HTTP headers. The password is encoded with base64.
- * More information @link{http://en.wikipedia.org/wiki/Basic_access_authentication}
- */
-public class BasicAccessAuthenticator extends AbstractAuthenticator {
-
-
-    private static final String AUTHENTICATOR_NAME = "BasicAccessAuthenticator";
-
-    private ServletRequestHelper servletRequestHelper = new ServletRequestHelper();
-
-    public BasicAccessAuthenticator() {
-        super(AUTHENTICATOR_NAME);
-    }
-
-
-    /**
-     * Returns user name and password as an array. The first element is user name and second is password.
-     *
-     * @param httpServletRequest The servlet request.
-     * @return User name password pair as an array.
-     * @throws AuthenticationException If an error occurred while extracting user name and password.
-     */
-    private String[] getUserNamePassword(HttpServletRequest httpServletRequest) throws AuthenticationException {
-
-        String basicHeader = httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME);
-
-        if (basicHeader == null) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String[] userNamePasswordArray = basicHeader.split(" ");
-
-        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String decodedString = servletRequestHelper.decode(userNamePasswordArray[1]);
-
-        String[] array = decodedString.split(":");
-
-        if (array == null || array.length != 2) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        return array;
-
-    }
-
-    @Override
-    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
-        if (this.getUserStore() == null) {
-            throw new AuthenticationException("Authenticator is not initialized. Error processing request.");
-        }
-
-        if (credentials == null)
-            return false;
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
-
-        String[] array = getUserNamePassword(httpServletRequest);
-
-        String userName = array[0];
-        String password = array[1];
-
-        try {
-            return this.getUserStore().authenticate(userName, password);
-
-        } catch (UserStoreException e) {
-            throw new AuthenticationException("Error querying database for session information.", e);
-        }
-    }
-
-
-
-    @Override
-    public void onSuccessfulAuthentication(Object authenticationInfo) {
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) authenticationInfo;
-
-        try {
-            String[] array = getUserNamePassword(httpServletRequest);
-
-            StringBuilder stringBuilder = new StringBuilder("User : ");
-
-            if (array != null) {
-
-                servletRequestHelper.addUserToSession(array[0], httpServletRequest);
-
-                stringBuilder.append(array[0]).append(" successfully logged into system at ").append(getCurrentTime());
-                log.debug(stringBuilder.toString());
-
-            } else {
-                log.error("System error occurred while extracting user name after authentication. " +
-                        "Couldn't extract user name from the request.");
-            }
-        } catch (AuthenticationException e) {
-            log.error("System error occurred while extracting user name after authentication.", e);
-        }
-
-    }
-
-    @Override
-    public void onFailedAuthentication(Object authenticationInfo) {
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) authenticationInfo;
-
-        try {
-            String[] array = getUserNamePassword(httpServletRequest);
-
-            StringBuilder stringBuilder = new StringBuilder("User : ");
-
-            if (array != null) {
-
-                stringBuilder.append(array[0]).append(" Failed login attempt to system at ").append(getCurrentTime());
-                log.warn(stringBuilder.toString());
-
-            } else {
-                stringBuilder.append("Failed login attempt to system at ").append(getCurrentTime()).append( ". User unknown.");
-                log.warn(stringBuilder.toString());
-            }
-        } catch (AuthenticationException e) {
-            log.error("System error occurred while extracting user name after authentication.", e);
-        }
-    }
-
-    @Override
-    public boolean isAuthenticated(Object credentials) {
-        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
-
-        HttpSession httpSession = httpServletRequest.getSession();
-
-        boolean seenInSession = false;
-
-        if (httpSession != null) {
-        	 String user = null;
-        	 String gateway = null;
-        	try{
-             user = (String)httpSession.getAttribute(Constants.USER_IN_SESSION);
-             gateway = (String)httpSession.getAttribute(ServerSettings.getDefaultUserGateway());
-             }
-            catch (ApplicationSettingsException e1) {
-    			// TODO Auto-generated catch block
-    			e1.printStackTrace();
-    		}
-            if (user != null && gateway != null) {
-                servletRequestHelper.addToContext(user, gateway);
-                seenInSession = true;
-            }
-        }
-
-        return seenInSession;
-
-    }
-
-    @Override
-    public boolean canProcess(Object credentials) {
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
-
-        return (httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME) != null);
-    }
-
-
-
-    @Override
-    public void configure(Node node) throws RuntimeException {
-
-        /**
-         <specificConfigurations>
-         <database>
-         <jdbcUrl></jdbcUrl>
-         <databaseDriver></databaseDriver>
-         <userName></userName>
-         <password></password>
-         <userTableName></userTableName>
-         <userNameColumnName></userNameColumnName>
-         <passwordColumnName></passwordColumnName>
-         </database>
-         </specificConfigurations>
-         */
-
-        try {
-            this.getUserStore().configure(node);
-        } catch (UserStoreException e) {
-            throw new RuntimeException("Error while configuring authenticator user store", e);
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java b/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java
deleted file mode 100644
index 0a2ca83..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java
+++ /dev/null
@@ -1,339 +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.credentialstore.local;
-
-import java.security.NoSuchAlgorithmException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.SecurityUtil;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * User store to maintain internal DB database.
- */
-public class LocalUserStore {
-
-    protected static Logger log = LoggerFactory.getLogger(LocalUserStore.class);
-
-    private DBUtil dbUtil;
-
-    private String hashMethod;
-
-    public LocalUserStore(ServletContext servletContext) throws Exception {
-        // Properties properties = WebAppUtil.getAiravataProperties(servletContext);
-
-        hashMethod = ServerSettings.getSetting("default.registry.password.hash.method");
-
-        dbUtil = new DBUtil(ServerSettings.getSetting("registry.jdbc.url"),
-                ServerSettings.getSetting("registry.jdbc.user"),
-                ServerSettings.getSetting("registry.jdbc.password"),
-                ServerSettings.getSetting("registry.jdbc.driver"));
-
-    }
-
-    public LocalUserStore(DBUtil db) {
-        dbUtil = db;
-    }
-
-    public void addUser(String userName, String password) {
-
-        String sql = "insert into Users values (?, ?)";
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, userName);
-            preparedStatement.setString(2, SecurityUtil.digestString(password, hashMethod));
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("User " + userName + " successfully added.");
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error persisting user information.");
-            stringBuilder.append(" user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } catch (NoSuchAlgorithmException e) {
-            String stringBuilder = "Error creating hash value for password.";
-            log.error(stringBuilder, e);
-
-            throw new RuntimeException(stringBuilder, e);
-        } finally {
-
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    protected String getPassword(String userName, Connection connection) {
-
-        String sql = "select password from Users where user_name = ?";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, userName);
-
-            resultSet = preparedStatement.executeQuery();
-
-            if (resultSet.next()) {
-                return resultSet.getString("password");
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving credentials for user.");
-            stringBuilder.append("name - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } finally {
-
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    log.error("Error closing result set", e);
-                }
-            }
-
-            if (preparedStatement != null) {
-                try {
-                    preparedStatement.close();
-                } catch (SQLException e) {
-                    log.error("Error closing prepared statement", e);
-                }
-            }
-        }
-
-        return null;
-    }
-
-    public void changePassword(String userName, String oldPassword, String newPassword) {
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-
-            String storedPassword = getPassword(userName, connection);
-
-            String oldDigestedPassword = SecurityUtil.digestString(oldPassword, hashMethod);
-
-            if (storedPassword != null) {
-                if (!storedPassword.equals(oldDigestedPassword)) {
-                    throw new RuntimeException("Previous password did not match correctly. Please specify old password"
-                            + " correctly.");
-                }
-            }
-
-            String sql = "update Users set password = ? where user_name = ?";
-
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, SecurityUtil.digestString(newPassword, hashMethod));
-            preparedStatement.setString(2, userName);
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("Password changed for user " + userName);
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
-            stringBuilder.append(" user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } catch (NoSuchAlgorithmException e) {
-            String stringBuilder = "Error creating hash value for password.";
-            log.error(stringBuilder, e);
-
-            throw new RuntimeException(stringBuilder, e);
-        } finally {
-
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    public void changePasswordByAdmin(String userName, String newPassword) {
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-
-            String sql = "update Users set password = ? where user_name = ?";
-
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, SecurityUtil.digestString(newPassword, hashMethod));
-            preparedStatement.setString(2, userName);
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("Admin changed password of user " + userName);
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
-            stringBuilder.append(" user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } catch (NoSuchAlgorithmException e) {
-            String stringBuilder = "Error creating hash value for password.";
-            log.error(stringBuilder, e);
-
-            throw new RuntimeException(stringBuilder, e);
-        } finally {
-
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    public void deleteUser(String userName) {
-
-        String sql = "delete from Users where user_name=?";
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, userName);
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("User " + userName + " deleted.");
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error deleting user.");
-            stringBuilder.append("user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } finally {
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    public List<String> getUsers() {
-
-        List<String> userList = new ArrayList<String>();
-
-        String sql = "select user_name from Users";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-        Connection connection = null;
-
-        try {
-
-            connection = dbUtil.getConnection();
-            preparedStatement = connection.prepareStatement(sql);
-
-            resultSet = preparedStatement.executeQuery();
-
-            while (resultSet.next()) {
-                userList.add(resultSet.getString("user_name"));
-            }
-
-        } catch (SQLException e) {
-            String errorString = "Error retrieving Users.";
-            log.error(errorString, e);
-
-            throw new RuntimeException(errorString, e);
-        } finally {
-
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    log.error("Error closing result set", e);
-                }
-            }
-
-            if (preparedStatement != null) {
-                try {
-                    preparedStatement.close();
-                } catch (SQLException e) {
-                    log.error("Error closing prepared statement", e);
-                }
-            }
-
-            if (connection != null) {
-                try {
-                    connection.close();
-                } catch (SQLException e) {
-                    log.error("Error closing connection", e);
-                }
-            }
-        }
-
-        Collections.sort(userList);
-
-        return userList;
-
-    }
-
-    public static String getPasswordRegularExpression() {
-        return "'^[a-zA-Z0-9_-]{6,15}$'";
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java b/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java
deleted file mode 100644
index 0847d54..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java
+++ /dev/null
@@ -1,191 +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.credentialstore.session;
-
-import org.apache.airavata.security.AuthenticationException;
-import org.apache.airavata.security.Authenticator;
-import org.apache.airavata.security.configurations.AuthenticatorConfigurationReader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xml.sax.SAXException;
-
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Calendar;
-import java.util.List;
-
-/**
- * A servlet filter class which intercepts the request and do authentication.
- */
-public class HttpAuthenticatorFilter implements Filter {
-
-    private List<Authenticator> authenticatorList;
-
-    private static Logger log = LoggerFactory.getLogger(HttpAuthenticatorFilter.class);
-
-    private ServletRequestHelper servletRequestHelper = new ServletRequestHelper();
-
-    @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
-        String authenticatorConfiguration = filterConfig.getInitParameter("authenticatorConfigurations");
-
-        //TODO make this able to read from a file as well
-
-
-        InputStream configurationFileStream = HttpAuthenticatorFilter.class.getClassLoader().
-                getResourceAsStream(authenticatorConfiguration);
-
-        if (configurationFileStream == null) {
-            String msg = "Invalid authenticator configuration. Cannot read file - ".concat(authenticatorConfiguration);
-            log.error(msg);
-            throw new ServletException(msg);
-        }
-
-        AuthenticatorConfigurationReader authenticatorConfigurationReader
-                = new AuthenticatorConfigurationReader();
-        try {
-            authenticatorConfigurationReader.init(configurationFileStream);
-        } catch (IOException e) {
-            String msg = "Error reading authenticator configurations.";
-
-            log.error(msg, e);
-            throw new ServletException(msg, e);
-        } catch (ParserConfigurationException e) {
-            String msg = "Error parsing authenticator configurations.";
-
-            log.error(msg, e);
-            throw new ServletException(msg, e);
-        } catch (SAXException e) {
-            String msg = "Error parsing authenticator configurations.";
-
-            log.error(msg, e);
-            throw new ServletException(msg, e);
-        } finally {
-            try {
-                configurationFileStream.close();
-            } catch (IOException e) {
-                log.error("Error closing authenticator file stream.", e);
-            }
-        }
-
-        this.authenticatorList = authenticatorConfigurationReader.getAuthenticatorList();
-
-        if (this.authenticatorList.isEmpty()) {
-            String msg = "No authenticators registered in the system. System cannot function without authenticators";
-            log.error(msg);
-            throw new ServletException(msg);
-        }
-
-    }
-
-    @Override
-    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
-
-        // Firs check whether authenticators are disabled
-        if (! AuthenticatorConfigurationReader.isAuthenticationEnabled()) {
-
-            // Extract user id and gateway id
-            try {
-                servletRequestHelper.addIdentityInformationToSession((HttpServletRequest) servletRequest);
-            } catch (AuthenticationException e) {
-                log.warn("Error adding identity information to session.", e);
-                populateUnauthorisedData(servletResponse, "Error adding identity information to session.");
-
-            }
-
-            filterChain.doFilter(servletRequest, servletResponse);
-            return;
-        }
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
-
-        Authenticator authenticator = getAuthenticator(httpServletRequest);
-
-        if (authenticator == null) {
-            //sendUnauthorisedError(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-            populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-        } else {
-            if (authenticator.isAuthenticated(httpServletRequest)) {
-                // Allow request to flow
-                filterChain.doFilter(servletRequest, servletResponse);
-            } else {
-                try {
-                    if (!authenticator.authenticate(httpServletRequest)) {
-                        //sendUnauthorisedError(servletResponse, "Unauthorised : Provided credentials are not valid.");
-                        populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-                    } else {
-                        // Allow request to flow
-                        filterChain.doFilter(servletRequest, servletResponse);
-                    }
-                } catch (AuthenticationException e) {
-                    String msg = "An error occurred while authenticating request.";
-                    log.error(msg, e);
-                    //sendUnauthorisedError(servletResponse, e.getMessage());
-                    populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-                }
-            }
-        }
-    }
-
-    public static void sendUnauthorisedError(ServletResponse servletResponse, String message) throws IOException {
-        HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
-        httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, message);
-    }
-
-    @Override
-    public void destroy() {
-
-        this.authenticatorList = null;
-    }
-
-    private Authenticator getAuthenticator(HttpServletRequest httpServletRequest) {
-
-        for (Authenticator authenticator : authenticatorList) {
-            if (authenticator.canProcess(httpServletRequest)) {
-                return authenticator;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * This method will create a 401 unauthorized response to be sent.
-     *
-     * @param servletResponse The HTTP response.
-     */
-    public static void populateUnauthorisedData(ServletResponse servletResponse, String message) {
-
-        HttpServletResponse httpServletResponse = (HttpServletResponse)servletResponse;
-
-        httpServletResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
-        httpServletResponse.addHeader("Server", "Airavata Server");
-        httpServletResponse.addHeader("Description", message);
-        httpServletResponse.addDateHeader("Date", Calendar.getInstance().getTimeInMillis());
-        httpServletResponse.addHeader("WWW-Authenticate", "Basic realm=Airavata");
-        httpServletResponse.setContentType("text/html");
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java b/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java
deleted file mode 100644
index c4a2c47..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/ServletRequestHelper.java
+++ /dev/null
@@ -1,129 +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.credentialstore.session;
-
-import org.apache.airavata.common.context.RequestContext;
-import org.apache.airavata.common.context.WorkflowContext;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.security.AuthenticationException;
-import org.apache.commons.codec.binary.Base64;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Helper class to extract request information.
- */
-public class ServletRequestHelper {
-
-    /**
-     * Header names
-     */
-    public static final String AUTHORISATION_HEADER_NAME = "Authorization";
-    private final static Logger logger = LoggerFactory.getLogger(ServletRequestHelper.class);
-    protected void addIdentityInformationToSession(HttpServletRequest servletRequest) throws AuthenticationException {
-
-        addUserToSession(null, servletRequest);
-    }
-
-    public void addUserToSession(String userName, HttpServletRequest servletRequest) throws AuthenticationException {
-
-        if (userName == null) {
-            userName = getUserName(servletRequest);
-        }
-
-        String gatewayId = getGatewayId(servletRequest);
-
-        if (servletRequest.getSession() != null) {
-			try {
-				servletRequest.getSession().setAttribute(Constants.USER_IN_SESSION, userName);
-				servletRequest.getSession().setAttribute(ServerSettings.getDefaultUserGateway(), gatewayId);
-			} catch (ApplicationSettingsException e) {
-                logger.error(e.getMessage(), e);
-			}
-        }
-
-        addToContext(userName, gatewayId);
-    }
-
-    String getUserName(HttpServletRequest httpServletRequest) throws AuthenticationException {
-
-        String basicHeader = httpServletRequest.getHeader(AUTHORISATION_HEADER_NAME);
-
-        if (basicHeader == null) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String[] userNamePasswordArray = basicHeader.split(" ");
-
-        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String decodedString = decode(userNamePasswordArray[1]);
-
-        String[] array = decodedString.split(":");
-
-        if (array == null || array.length != 1) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        return array[0];
-
-    }
-
-    public String decode(String encoded) {
-        return new String(Base64.decodeBase64(encoded.getBytes()));
-    }
-
-    String getGatewayId(HttpServletRequest request) throws AuthenticationException {
-        String gatewayId = null;
-		try {
-			gatewayId = request.getHeader(ServerSettings.getDefaultUserGateway());
-		} catch (ApplicationSettingsException e1) {
-            logger.error(e1.getMessage(), e1);
-		}
-
-        if (gatewayId == null) {
-            try {
-                gatewayId = ServerSettings.getDefaultUserGateway();
-            } catch (ApplicationSettingsException e) {
-                throw new AuthenticationException("Unable to retrieve default gateway", e);
-            }
-        }
-
-        return gatewayId;
-    }
-
-    public void addToContext(String userName, String gatewayId) {
-
-        RequestContext requestContext = new RequestContext();
-        requestContext.setUserIdentity(userName);
-        requestContext.setGatewayId(gatewayId);
-
-        WorkflowContext.set(requestContext);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/resources/airavata-server.properties b/modules/credential-store-service/credential-store-webapp/src/main/resources/airavata-server.properties
deleted file mode 100644
index fb02901..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/resources/airavata-server.properties
+++ /dev/null
@@ -1,234 +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.
-#
-
-###########################################################################
-#
-#  This properties file provides configuration for all Airavata Services:
-#  API Server, Registry, Workflow Interpreter, GFac, Orchestrator
-#
-###########################################################################
-
-###########################################################################
-#  API Server Registry Configuration
-###########################################################################
-
-#for derby [AiravataJPARegistry]
-registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
-# MySql database configuration
-#registry.jdbc.driver=com.mysql.jdbc.Driver
-#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
-registry.jdbc.user=airavata
-registry.jdbc.password=airavata
-start.derby.server.mode=true
-validationQuery=SELECT 1 from CONFIGURATION
-jpa.cache.size=5000
-#jpa.connection.properties=MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000,testWhileIdle=true,testOnBorrow=true
-
-# Properties for default user mode
-default.registry.user=admin
-default.registry.password=admin
-default.registry.password.hash.method=SHA
-default.registry.gateway=default
-
-#ip=127.0.0.1
-
-###########################################################################
-#  Application Catalog DB Configuration
-###########################################################################
-#for derby [AiravataJPARegistry]
-appcatalog.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-appcatalog.jdbc.url=jdbc:derby://localhost:1527/app_catalog;create=true;user=airavata;password=airavata
-# MySql database configuration
-#appcatalog.jdbc.driver=com.mysql.jdbc.Driver
-#appcatalog.jdbc.url=jdbc:mysql://localhost:3306/app_catalog
-appcatalog.jdbc.user=airavata
-appcatalog.jdbc.password=airavata
-appcatalog.validationQuery=SELECT 1 from CONFIGURATION
-
-###########################################################################
-#  Server module Configuration
-###########################################################################
-
-servers=apiserver,orchestrator,gfac,workflowserver
-#shutdown.trategy=NONE
-shutdown.trategy=SELF_TERMINATE
-
-
-apiserver.server.host=localhost
-apiserver.server.port=8930
-apiserver.server.min.threads=50
-workflow.server.host=localhost
-workflow.server.port=8931
-orchestrator.server.host=localhost
-orchestrator.server.port=8940
-gfac.server.host=localhost
-gfac.server.port=8950
-orchestrator.server.min.threads=50
-
-###########################################################################
-# Credential Store module Configuration
-###########################################################################
-credential.store.keystore.url=/Users/lahirugunathilake/Downloads/airavata_sym.jks
-credential.store.keystore.alias=airavata
-credential.store.keystore.password=airavata
-credential.store.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
-credential.store.jdbc.user=airavata
-credential.store.jdbc.password=airavata
-credential.store.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-
-notifier.enabled=false
-#period in milliseconds
-notifier.duration=5000
-
-email.server=smtp.googlemail.com
-email.server.port=465
-email.user=airavata
-email.password=xxx
-email.ssl=true
-email.from=airavata@apache.org
-
-###########################################################################
-# Airavata GFac MyProxy GSI credentials to access Grid Resources.
-###########################################################################
-#
-# Security Configuration used by Airavata Generic Factory Service
-#  to interact with Computational Resources.
-#
-gfac=org.apache.airavata.gfac.server.GfacServer
-myproxy.server=myproxy.teragrid.org
-myproxy.username=ogce
-myproxy.password=
-myproxy.life=3600
-# XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz
-trusted.cert.location=/Users/lahirugunathilake/Downloads/certificates
-# SSH PKI key pair or ssh password can be used SSH based authentication is used.
-# if user specify both password authentication gets the higher preference
-
-################# ---------- For ssh key pair authentication ------------------- ################
-#public.ssh.key=/path to public key for ssh
-#ssh.username=username for ssh connection
-#private.ssh.key=/path to private key file for ssh
-#ssh.keypass=passphrase for the private key
-
-
-################# ---------- For ssh key pair authentication ------------------- ################
-#ssh.username=username for ssh connection
-#ssh.password=Password for ssh connection
-
-
-
-###########################################################################
-# Airavata Workflow Interpreter Configurations
-###########################################################################
-
-#runInThread=true
-#provenance=true
-#provenanceWriterThreadPoolSize=20
-#gfac.embedded=true
-#workflowserver=org.apache.airavata.api.server.WorkflowServer
-
-
-###########################################################################
-# API Server module Configuration
-###########################################################################
-apiserver=org.apache.airavata.api.server.AiravataAPIServer
-
-###########################################################################
-# Workflow Server module Configuration
-###########################################################################
-
-workflowserver=org.apache.airavata.api.server.WorkflowServer
-
-###########################################################################
-# Advance configuration to change service implementations
-###########################################################################
-# If false, disables two phase commit when submitting jobs
-TwoPhase=true
-#
-# Class which implemented HostScheduler interface. It will determine the which host to submit the request
-#
-host.scheduler=org.apache.airavata.gfac.core.scheduler.impl.SimpleHostScheduler
-
-###########################################################################
-# Monitoring module Configuration
-###########################################################################
-
-#This will be the primary monitoring tool which runs in airavata, in future there will be multiple monitoring
-#mechanisms and one would be able to start a monitor
-monitors=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor,org.apache.airavata.gfac.monitor.impl.LocalJobMonitor
-
-
-###########################################################################
-# AMQP Notification Configuration
-###########################################################################
-
-
-amqp.notification.enable=1
-
-amqp.broker.host=localhost
-amqp.broker.port=5672
-amqp.broker.username=guest
-amqp.broker.password=guest
-
-amqp.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPSenderImpl
-amqp.topic.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPTopicSenderImpl
-amqp.broadcast.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPBroadcastSenderImpl
-
-#,org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor
-#This is the amqp related configuration and this lists down the Rabbitmq host, this is an xsede specific configuration
-amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
-proxy.file.path=/Users/lahirugunathilake/Downloads/x509up_u503876
-connection.name=xsede
-#publisher
-activity.listeners=org.apache.airavata.gfac.core.monitor.AiravataJobStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataTaskStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataWorkflowNodeStatusUpdator,org.apache.airavata.api.server.listener.AiravataExperimentStatusUpdator,org.apache.airavata.gfac.core.monitor.GfacInternalStatusUpdator,org.apache.airavata.workflow.engine.util.ProxyMonitorPublisher
-publish.rabbitmq=false
-activity.publisher=org.apache.airavata.messaging.core.impl.RabbitMQPublisher
-rabbitmq.broker.url=amqp://localhost:5672
-rabbitmq.exchange.name=airavata_rabbitmq_exchange
-
-###########################################################################
-# Orchestrator module Configuration
-###########################################################################
-
-#job.submitter=org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter
-job.submitter=org.apache.airavata.orchestrator.core.impl.GFACServiceJobSubmitter
-job.validators=org.apache.airavata.orchestrator.core.validator.impl.SimpleAppDataValidator,org.apache.airavata.orchestrator.core.validator.impl.ExperimentStatusValidator
-submitter.interval=10000
-threadpool.size=10
-start.submitter=true
-embedded.mode=true
-enable.validation=true
-orchestrator=org.apache.airavata.orchestrator.server.OrchestratorServer
-
-###########################################################################
-# Zookeeper Server Configuration
-###########################################################################
-
-embedded.zk=true
-zookeeper.server.host=localhost
-zookeeper.server.port=2181
-airavata-server=/api-server
-orchestrator-server=/orchestrator-server
-gfac-server=/gfac-server
-gfac-experiments=/gfac-experiments
-gfac-server-name=gfac-node0
-orchestrator-server-name=orch-node0
-airavata-server-name=api-node0

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/client.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/client.xml b/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/client.xml
deleted file mode 100644
index bc721ed..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/client.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--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. -->
-
-<config>
-    <client name="acs">
-        <logging
-                logFileName="../logs/oa4mp.log"
-                logName="oa4mp"
-                logSize="1000000"
-                logFileCount="2"
-                debug="true"/>
-        <id>myproxy:oa4mp,2012:/client/5a323fc6fcffcff7a95401046a303520</id>
-        <serviceUri>https://oa4mp.xsede.org/oauth</serviceUri>
-        <callbackUri>https://localhost:8443/credential-store/callback</callbackUri>
-        <!--callbackUri>http://149.165.228.118/PHP-Reference-Gateway/xsede_login.php</callbackUri-->
-        <lifetime>864000</lifetime>
-        <publicKeyFile>/Users/chathuri/dev/airavata/credential-store/oa4mp/oauth-pubkey.pem</publicKeyFile>
-        <privateKeyFile>/Users/chathuri/dev/airavata/credential-store/oa4mp/oauth-privkey.pk8</privateKeyFile>
-    </client>
-
-    <credential-store>
-        <successUri>http://gw120.iu.xsede.org/PHP-Reference-Gateway/</successUri>
-        <errorUri>/credential-store/error.jsp</errorUri>
-        <redirectUri>/credential-store/show-redirect.jsp</redirectUri>
-    </credential-store>
-
-</config>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8 b/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8
deleted file mode 100644
index 60f5b03..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-privkey.pk8
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCx/4hqCePa3scs
-oyGuwjnNdQCGfoPBlaCfl02Xq4L623EygIVo0faCX1ZZ/gA9ldw0TqZ6weCHfGck
-22TLeFQnJ4plAqJMMUbYwqmhnSsC9zTuc+c/yzcvdw2aCLPkMXnofFUasQEGhPI3
-/avTHOeUYBeu4ZU3u7G2Dp0jMDg1yh95v0FnGAjSPSBWQm1q4sxT90YB8jZyGvZ8
-kRs4S9Ik8Vz1VKNHJ16LZOuThfsRV4Af7vM8jXztjKUsrxQf1ZpKauAvXbJcDS2O
-pTjHWSvASk2pQxnDZDNcENE40MtG7V7qiDblMCuYumO8xnsJIGLreMKnSOQZKnDL
-uoBPNLB9AgMBAAECggEBAIJtcfHxaUr5rwygRJAftec88rOahMUW9Om8Hpkijglv
-PtT4o8kZAP6rCUVL/7Ug2IhjkU2mPvZIS/QP5x3JADDoolo9wdr+yKEQkuffmKLF
-rb2EpFB0ge1/2TGjat2s+11Frb6vMMcsJ6ircnpxVae9ed0lYwfBuwhiUPZ14NpY
-Figcq4mbM1fOmKIc035sR/fRVeuSEYPguw0sZkkx9LPGluvNXypwhfho60WCpxaB
-tgAadJRQgTEqz4kjHDD7xqY0w/KUJyqCOaJHnv2RmrdwrzDWFls6ETcc93PmINJU
-Mt2uLZZdd2nlZki91EhHA5XpPC1LoM2qXKaShfUMDWkCgYEA2oSVtz0ftT1njuX2
-OjsJi3ENOjmSuHaw81h72ZcIskCVrxZVeq0LGJdBQt361Q5ZhtnIgPA1bJXWtQ9s
-miFGkkPiPJb5GI45aLqpv+dJ/F/tXa0Q9LN++hfW8fKN8LejlM6tTiiYs3EqYEXO
-qqcLPoptxak8ZwDkOfj8yvJib6cCgYEA0IesCrCy8fpjVeDQdiAlIZqsecPJ2+Fz
-jLMik2hvAk6Yiyd8DmK8HMtSPfYMN4BhiphW49TXSyIoFEeCRQE8KMdSu3W4Z1wP
-AURZzQL78GRHc1n7EgCi2gzu38rSQDekmaQYr/hw+IlTpURjT68pDGKYXOybbjxu
-zUb67PHaAzsCgYADgs/ZAt1ojxUD4cQECYDMwcNBpT0rQ5TyRACxbVDRdGIzTvuO
-ngsomP2OcnyeQb3EgelL0RA6r2mkvRu0mkZFAVw4NwDHmTlo6l7h23h/2pa4w5gb
-Jmsq34kvmAMZ1AmH0Y5NTC+v6miQ5W49pbNzjMvYujBjQ0tndw2wwRY9zwKBgQDG
-FksgcI/b+z1Hg+Kig5CiJlr25DypibWJD1Wl74ucBmszrNNUmwgU1jOOtl8Ojf6a
-eHH5xOKq9YxbDz65LB4oood9masNTE7YpkQj0lTfG3MgKXatuDr6pVR49CLba8AJ
-Tu9AoeE2xsTVdmxccoiswi/3/a78fZ3HlEiism+lpwKBgCx7aX3MESqgxbf1kHgI
-Tu0nnvu06UwzAhBU6IpGKCqwu8zwfGN/PTTTz95hySUc1S4fSLuHVrdTAQTT3Zwr
-hwX85AxYdiyGhbeXFLue+eDWQ7PxAKXfRAwsKpdC72ixkXVqnVRh2yhRMPqKqnEu
-A5i3nuKHICZgD2fwQf+A8OL6
------END PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem b/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem
deleted file mode 100644
index f094a6d..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/resources/credential-store/oauth-pubkey.pem
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsf+Iagnj2t7HLKMhrsI5
-zXUAhn6DwZWgn5dNl6uC+ttxMoCFaNH2gl9WWf4APZXcNE6mesHgh3xnJNtky3hU
-JyeKZQKiTDFG2MKpoZ0rAvc07nPnP8s3L3cNmgiz5DF56HxVGrEBBoTyN/2r0xzn
-lGAXruGVN7uxtg6dIzA4Ncofeb9BZxgI0j0gVkJtauLMU/dGAfI2chr2fJEbOEvS
-JPFc9VSjRydei2Trk4X7EVeAH+7zPI187YylLK8UH9WaSmrgL12yXA0tjqU4x1kr
-wEpNqUMZw2QzXBDRONDLRu1e6og25TArmLpjvMZ7CSBi63jCp0jkGSpwy7qATzSw
-fQIDAQAB
------END PUBLIC KEY-----

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/WEB-INF/web.xml b/modules/credential-store-service/credential-store-webapp/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 252f889..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ 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. -->
-
-<!-- This web.xml file is not required when using Servlet 3.0 container,
-     see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html#d4e194 -->
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xmlns="http://java.sun.com/xml/ns/javaee"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-         id="WebApp_ID" version="2.5">
-
-    <listener>
-        <listener-class>org.apache.airavata.credential.store.servlet.CredentialBootstrapper</listener-class>
-    </listener>
-
-    <context-param>
-        <param-name>oa4mp:client.config.file</param-name>
-        <param-value>${catalina.home}/webapps/credential-store/WEB-INF/classes/credential-store/client.xml</param-value>
-    </context-param>
-
-    <!-- Credential store parameters -->
-    <context-param>
-        <param-name>credential-store-jdbc-url</param-name>
-        <param-value>jdbc:mysql://localhost/airavata</param-value>
-    </context-param>
-
-    <context-param>
-        <param-name>credential-store-db-user</param-name>
-        <param-value>root</param-value>
-    </context-param>
-
-    <context-param>
-        <param-name>credential-store-db-password</param-name>
-        <param-value>root123</param-value>
-    </context-param>
-
-    <context-param>
-        <param-name>credential-store-db-driver</param-name>
-        <param-value>com.mysql.jdbc.Driver</param-value>
-    </context-param>
-
-    <!-- ========================= Security Related Configurations go here ================================== -->
-
-    <filter>
-        <filter-name>CORS Filter</filter-name>
-        <filter-class>org.ebaysf.web.cors.CORSFilter</filter-class>
-        <init-param>
-            <description>A comma separated list of allowed origins. Note: An '*' cannot be used for an allowed origin when using credentials.</description>
-            <param-name>cors.allowed.origins</param-name>
-            <param-value>*</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.allowed.methods</param-name>
-            <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.allowed.headers</param-name>
-            <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.exposed.headers</param-name>
-            <param-value></param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.support.credentials</param-name>
-            <param-value>true</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.logging.enabled</param-name>
-            <param-value>false</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.preflight.maxage</param-name>
-            <param-value>1800</param-value>
-        </init-param>
-        <init-param>
-            <param-name>cors.request.decorate</param-name>
-            <param-value>true</param-value>
-        </init-param>
-    </filter>
-
-    <filter-mapping>
-        <filter-name>CORS Filter</filter-name>
-        <url-pattern>/user-store/*</url-pattern>
-    </filter-mapping>
-
-    <!-- ================================ End Security Related Configurations =============================== -->
-
-    <!-- Credential Store Configurations -->
-    <servlet>
-        <servlet-name>credential-store-start</servlet-name>
-        <!--internal name of the servlet-->
-        <servlet-class>org.apache.airavata.credential.store.servlet.CredentialStoreStartServlet</servlet-class>
-
-        <load-on-startup>1</load-on-startup>
-        <!--load as soon as tomcat starts?-->
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>credential-store-start</servlet-name>
-        <!--the servlet-name above-->
-        <url-pattern>/acs-start-servlet</url-pattern>
-        <!--what needs to be in the url, so http://foo.org/client/simple-->
-    </servlet-mapping>
-
-    <servlet>
-        <servlet-name>callback</servlet-name>
-        <!--internal name of the servlet-->
-        <servlet-class>org.apache.airavata.credential.store.servlet.CredentialStoreCallbackServlet</servlet-class>
-        <load-on-startup>1</load-on-startup>
-        <!--load as soon as tomcat starts?-->
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>callback</servlet-name>
-        <!--the servlet-name above-->
-        <url-pattern>/callback</url-pattern>
-        <!--what needs to be in the url, so http://foo.org/client/simple-->
-    </servlet-mapping>
-</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/acs/index.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/acs/index.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/acs/index.jsp
deleted file mode 100644
index e7626fa..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/acs/index.jsp
+++ /dev/null
@@ -1,44 +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.
-  --%>
-  
-<html>
-<body>
-<h2>Sample Portal</h2>
-<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
-<form name="input" action="../acs-start-servlet" method="post">
-
-    <table border="0">
-        <tr>
-            <td>Gateway Name</td>
-            <td><input type="text" name="gatewayName"></td>
-        </tr>
-        <tr>
-            <td>Portal Username</td>
-            <td><input type="text" name="portalUserName"></td>
-        </tr>
-        <tr>
-            <td>Contact Email</td>
-            <td><input type="text" name="email"></td>
-        </tr>
-    </table>
-
-    <input type="submit" value="Submit">
-</form>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/error.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/error.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/error.jsp
deleted file mode 100644
index adc430d..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/error.jsp
+++ /dev/null
@@ -1,53 +0,0 @@
-<%@ page import="org.apache.airavata.credential.store.util.CredentialStoreConstants" %>
-<%--
-  ~ 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.
-  --%>
-  
-
-<%
-    String gatewayName = request.getParameter(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER);
-    String portalUserName = request.getParameter(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER);
-    Throwable exception = (Throwable) request.getAttribute("exception");
-
-%>
-
-<html>
-<body>
-<h1>Credential Store</h1>
-<p>An error occurred while processing</p>
-<p>
-    Gateway Name - <%=gatewayName%>. Portal user name - <%=portalUserName%>.
-    Exception -
-
-</p>
-
-<p>
-    <%
-
-        out.println("Exception - " + exception.getMessage());
-        out.println();
-        StackTraceElement[] elements = exception.getStackTrace();
-        for (StackTraceElement element : elements) {
-            out.print("         ");
-            out.println(element.toString());
-        }
-
-    %>
-</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp
deleted file mode 100644
index 59a1e04..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/password-credentials.jsp
+++ /dev/null
@@ -1,33 +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.
-  --%>
-
-<html>
-<body>
-<h2>Store Passwords</h2>
-<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
-<form name="input" action="../airavata-registry-rest-services/credential-store" method="post">
-
-    Gateway Name   : <input type="text" name="gatewayName"><br>
-    Portal Username: <input type="text" name="portalUserName"><br>
-    Contact Email: <input type="text" name="email">
-
-    <input type="submit" value="Submit">
-</form>
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp
deleted file mode 100644
index 84b54cf..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/show-redirect.jsp
+++ /dev/null
@@ -1,44 +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.
-  --%>
-  
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
-<%
-    String redirectUrlInRequest = (String) request.getAttribute("redirectUrl");
-%>
-
-<html>
-<head>
-    <script type="text/javascript">
-        <!--
-        function redirect(){
-            window.location = "<%=redirectUrlInRequest%>"
-        }
-        //-->
-    </script>
-</head>
-<body onLoad="setTimeout('redirect()', 1000)">
-<h2>You will be now redirect to MyProxy portal !</h2>
-<p>
-    If your browser didn't redirect to MyProxy Portal within 1 minute click following link,
-    <br><br> <a href="<%=redirectUrlInRequest%>"><%=redirectUrlInRequest%></a>
-</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/success.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/success.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/success.jsp
deleted file mode 100644
index f2964d0..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/credential-store/success.jsp
+++ /dev/null
@@ -1,25 +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.
-  --%>
-  
-<html>
-<body>
-<h1>Credential Store</h1>
-<p>Certificate Successfully Stored !</p>
-</body>
-</html>
\ No newline at end of file


[12/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java
deleted file mode 100644
index e52b211..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifier.java
+++ /dev/null
@@ -1,71 +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.credential.store.notifier.impl;
-
-import org.apache.airavata.credential.store.notifier.CredentialStoreNotifier;
-import org.apache.airavata.credential.store.notifier.NotificationMessage;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-import org.apache.commons.mail.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 12/3/13
- * Time: 4:25 PM
- */
-
-public class EmailNotifier implements CredentialStoreNotifier {
-
-    protected static Logger log = LoggerFactory.getLogger(EmailNotifier.class);
-
-    private EmailNotifierConfiguration emailNotifierConfiguration;
-
-    public EmailNotifier(EmailNotifierConfiguration notifierConfiguration) {
-        this.emailNotifierConfiguration = notifierConfiguration;
-    }
-
-    public void notifyMessage(NotificationMessage message) throws CredentialStoreException {
-        try {
-            Email email = new SimpleEmail();
-            email.setHostName(this.emailNotifierConfiguration.getEmailServer());
-            email.setSmtpPort(this.emailNotifierConfiguration.getEmailServerPort());
-            email.setAuthenticator(new DefaultAuthenticator(this.emailNotifierConfiguration.getEmailUserName(),
-                    this.emailNotifierConfiguration.getEmailPassword()));
-            email.setSSLOnConnect(this.emailNotifierConfiguration.isSslConnect());
-            email.setFrom(this.emailNotifierConfiguration.getFromAddress());
-
-            EmailNotificationMessage emailMessage = (EmailNotificationMessage)message;
-
-            email.setSubject(emailMessage.getSubject());
-            email.setMsg(emailMessage.getMessage());
-            email.addTo(emailMessage.getSenderEmail());
-            email.send();
-
-        } catch (EmailException e) {
-            log.error("[CredentialStore]Error sending email notification message.");
-            throw new CredentialStoreException("Error sending email notification message", e);
-        }
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java
deleted file mode 100644
index b1a204f..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierConfiguration.java
+++ /dev/null
@@ -1,84 +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.credential.store.notifier.impl;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ApplicationSettings;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 12/3/13
- * Time: 5:06 PM
- */
-
-public class EmailNotifierConfiguration {
-    private String emailServer;
-    private int emailServerPort;
-    private String emailUserName;
-    private String emailPassword;
-    private boolean sslConnect;
-    private String fromAddress;
-
-    public EmailNotifierConfiguration(String emailServer, int emailServerPort, String emailUserName,
-                                      String emailPassword, boolean sslConnect, String fromAddress) {
-        this.emailServer = emailServer;
-        this.emailServerPort = emailServerPort;
-        this.emailUserName = emailUserName;
-        this.emailPassword = emailPassword;
-        this.sslConnect = sslConnect;
-        this.fromAddress = fromAddress;
-    }
-
-    public String getEmailServer() {
-        return emailServer;
-    }
-
-    public int getEmailServerPort() {
-        return emailServerPort;
-    }
-
-    public String getEmailUserName() {
-        return emailUserName;
-    }
-
-    public String getEmailPassword() {
-        return emailPassword;
-    }
-
-    public boolean isSslConnect() {
-        return sslConnect;
-    }
-
-    public String getFromAddress() {
-        return fromAddress;
-    }
-
-    public static EmailNotifierConfiguration getEmailNotifierConfigurations() throws ApplicationSettingsException {
-        return new EmailNotifierConfiguration(ApplicationSettings.getCredentialStoreEmailServer(),
-                Integer.parseInt(ApplicationSettings.getCredentialStoreEmailServerPort()),
-                ApplicationSettings.getCredentialStoreEmailUser(),
-                ApplicationSettings.getCredentialStoreEmailPassword(),
-                Boolean.parseBoolean(ApplicationSettings.getCredentialStoreEmailSSLConnect()),
-                ApplicationSettings.getCredentialStoreEmailFromEmail());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
deleted file mode 100644
index f0e14d5..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
+++ /dev/null
@@ -1,158 +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.credential.store.server;
-
-
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.IServer;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.credential.store.cpi.CredentialStoreService;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.server.TThreadPoolServer;
-import org.apache.thrift.transport.TSSLTransportFactory;
-import org.apache.thrift.transport.TServerSocket;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-
-public class CredentialStoreServer  implements IServer {
-    private final static Logger logger = LoggerFactory.getLogger(CredentialStoreServer.class);
-    private static final String SERVER_NAME = "Credential Store Server";
-    private static final String SERVER_VERSION = "1.0";
-
-    private IServer.ServerStatus status;
-    private TServer server;
-
-    public CredentialStoreServer() {
-        setStatus(IServer.ServerStatus.STOPPED);
-    }
-
-    @Override
-    public String getName() {
-        return SERVER_NAME;
-    }
-
-    @Override
-    public String getVersion() {
-        return SERVER_VERSION;
-    }
-
-    @Override
-    public void start() throws Exception {
-        if(ServerSettings.isCredentialStoreStartEnabled()) {
-            try {
-                setStatus(ServerStatus.STARTING);
-                TSSLTransportFactory.TSSLTransportParameters params =
-                        new TSSLTransportFactory.TSSLTransportParameters();
-                String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
-                String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
-                final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_PORT, "8960"));
-                final String serverHost = ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_HOST, null);
-                params.setKeyStore(keystorePath, keystorePWD);
-
-                TServerSocket serverTransport = TSSLTransportFactory.getServerSocket(serverPort, 100, InetAddress.getByName(serverHost), params);
-
-
-                CredentialStoreService.Processor processor = new CredentialStoreService.Processor(new CredentialStoreServerHandler());
-
-                server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).
-                        processor(processor));
-                new Thread() {
-                    public void run() {
-                        server.serve();
-                        setStatus(ServerStatus.STOPPED);
-                        logger.info("Credential Store Server Stopped.");
-                    }
-                }.start();
-                new Thread() {
-                    public void run() {
-                        while (!server.isServing()) {
-                            try {
-                                Thread.sleep(500);
-                            } catch (InterruptedException e) {
-                                break;
-                            }
-                        }
-                        if (server.isServing()) {
-                            setStatus(ServerStatus.STARTED);
-                            logger.info("Starting Credential Store Server on Port " + serverPort);
-                            logger.info("Listening to Credential Store Clients ....");
-                        }
-                    }
-                }.start();
-            } catch (TTransportException e) {
-                setStatus(ServerStatus.FAILED);
-                logger.error("Error while starting the credential store service", e);
-                throw new Exception("Error while starting the credential store service", e);
-            }
-        }
-    }
-
-    public static void main(String[] args) {
-        try {
-            new CredentialStoreServer().start();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-
-    @Override
-    public void stop() throws Exception {
-        if (server!=null && server.isServing()){
-            setStatus(ServerStatus.STOPING);
-            server.stop();
-        }
-    }
-
-    @Override
-    public void restart() throws Exception {
-        stop();
-        start();
-    }
-
-    @Override
-    public void configure() throws Exception {
-
-    }
-
-    @Override
-    public ServerStatus getStatus() throws Exception {
-        return null;
-    }
-
-    private void setStatus(IServer.ServerStatus stat){
-        status=stat;
-        status.updateTime();
-    }
-
-    public TServer getServer() {
-        return server;
-    }
-
-    public void setServer(TServer server) {
-        this.server = server;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
deleted file mode 100644
index b5b1ac0..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
+++ /dev/null
@@ -1,202 +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.credential.store.server;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.credential.store.cpi.CredentialStoreService;
-import org.apache.airavata.credential.store.cpi.cs_cpi_serviceConstants;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.datamodel.CertificateCredential;
-import org.apache.airavata.credential.store.datamodel.PasswordCredential;
-import org.apache.airavata.credential.store.datamodel.SSHCredential;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-import org.apache.airavata.credential.store.store.impl.CertificateCredentialWriter;
-import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
-import org.apache.airavata.credential.store.store.impl.SSHCredentialWriter;
-import org.apache.airavata.credential.store.util.TokenGenerator;
-import org.apache.airavata.credential.store.util.Utility;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.thrift.TException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import sun.security.provider.X509Factory;
-
-import java.io.ByteArrayInputStream;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.util.UUID;
-
-public class CredentialStoreServerHandler implements CredentialStoreService.Iface {
-    protected static Logger log = LoggerFactory.getLogger(CredentialStoreServerHandler.class);
-    private DBUtil dbUtil;
-    private SSHCredentialWriter sshCredentialWriter;
-    private CertificateCredentialWriter certificateCredentialWriter;
-    private CredentialReaderImpl credentialReader;
-
-    public CredentialStoreServerHandler() throws ApplicationSettingsException, IllegalAccessException, ClassNotFoundException, InstantiationException {
-        String jdbcUrl = ServerSettings.getCredentialStoreDBURL();
-        String userName = ServerSettings.getCredentialStoreDBUser();
-        String password = ServerSettings.getCredentialStoreDBPassword();
-        String driverName = ServerSettings.getCredentialStoreDBDriver();
-
-        log.debug("Starting credential store, connecting to database - " + jdbcUrl + " DB user - " + userName + " driver name - " + driverName);
-        dbUtil = new DBUtil(jdbcUrl, userName, password, driverName);
-        sshCredentialWriter = new SSHCredentialWriter(dbUtil);
-        certificateCredentialWriter = new CertificateCredentialWriter(dbUtil);
-        credentialReader = new CredentialReaderImpl(dbUtil);
-    }
-
-    @Override
-    public String getCSServiceVersion() throws TException {
-        return cs_cpi_serviceConstants.CS_CPI_VERSION;
-    }
-
-    @Override
-    public String addSSHCredential(SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
-        try {
-            org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential credential = new org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential();
-            credential.setGateway(sshCredential.getGatewayId());
-            credential.setPortalUserName(sshCredential.getUsername());
-            // only username and gateway id will be sent by client.
-            String token = TokenGenerator.generateToken(sshCredential.getGatewayId(), null);
-            credential.setToken(token);
-            credential.setPassphrase(String.valueOf(UUID.randomUUID()));
-            if (sshCredential.getPrivateKey() != null) {
-                credential.setPrivateKey(sshCredential.getPrivateKey().getBytes());
-            }
-            if (sshCredential.getPublicKey() != null) {
-                credential.setPublicKey(sshCredential.getPublicKey().getBytes());
-            }
-            if (sshCredential.getPublicKey() == null || sshCredential.getPrivateKey() == null) {
-                credential = Utility.generateKeyPair(credential);
-            }
-            sshCredentialWriter.writeCredentials(credential);
-            return token;
-        } catch (CredentialStoreException e) {
-            log.error("Error occurred while saving SSH Credentials.", e);
-            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while saving SSH Credentials.");
-        } catch (Exception e) {
-            log.error("Error occurred while generating key pair.", e);
-            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while generating key pair..");
-        }
-    }
-
-    @Override
-    public String addCertificateCredential(CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
-        try {
-            org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential credential = new org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential();
-            credential.setPortalUserName(certificateCredential.getCommunityUser().getUsername());
-            credential.setCommunityUser(new CommunityUser(certificateCredential.getCommunityUser().getGatewayNmae(),
-                    certificateCredential.getCommunityUser().getUsername(), certificateCredential.getCommunityUser().getUserEmail()));
-            String token = TokenGenerator.generateToken(certificateCredential.getCommunityUser().getGatewayNmae(), null);
-            credential.setToken(token);
-            Base64 encoder = new Base64(64);
-            byte [] decoded = encoder.decode(certificateCredential.getX509Cert().replaceAll(X509Factory.BEGIN_CERT, "").replaceAll(X509Factory.END_CERT, ""));
-            CertificateFactory cf = CertificateFactory.getInstance("X.509");
-            X509Certificate certificate = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(decoded));
-            X509Certificate[] certificates = new X509Certificate[1];
-            certificates[0] = certificate;
-            credential.setCertificates(certificates);
-            certificateCredentialWriter.writeCredentials(credential);
-            return token;
-        } catch (CredentialStoreException e) {
-            log.error("Error occurred while saving Certificate Credentials.", e);
-            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while saving Certificate Credentials.");
-        } catch (Exception e) {
-            log.error("Error occurred while converting to X509 certificate.", e);
-            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while converting to X509 certificate..");
-        }
-    }
-
-    @Override
-    public String addPasswordCredential(PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
-        return null;
-    }
-
-    @Override
-    public SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
-        try {
-            Credential credential = credentialReader.getCredential(gatewayId, tokenId);
-            if (credential instanceof org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) {
-                org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential credential1 = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential;
-                SSHCredential sshCredential = new SSHCredential();
-                sshCredential.setUsername(credential1.getPortalUserName());
-                sshCredential.setGatewayId(credential1.getGateway());
-                sshCredential.setPublicKey(new String(credential1.getPublicKey()));
-                sshCredential.setPrivateKey(new String(credential1.getPrivateKey()));
-                sshCredential.setPassphrase(credential1.getPassphrase());
-                sshCredential.setToken(credential1.getToken());
-                sshCredential.setPersistedTime(credential1.getCertificateRequestedTime().getTime());
-                return sshCredential;
-            } else {
-                log.info("Could not find SSH credentials for token - " + tokenId + " and "
-                        + "gateway id - " + gatewayId);
-                return null;
-            }
-        } catch (CredentialStoreException e) {
-            log.error("Error occurred while retrieving SSH credentialfor token - " +  tokenId + " and gateway id - " + gatewayId, e);
-            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while retrieving SSH credential for token - " +  tokenId + " and gateway id - " + gatewayId);
-        }
-    }
-
-    @Override
-    public CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
-        try {
-            Credential credential = credentialReader.getCredential(gatewayId, tokenId);
-            if (credential instanceof org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential) {
-                org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential credential1 = (org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential) credential;
-                CertificateCredential certificateCredential = new CertificateCredential();
-                org.apache.airavata.credential.store.datamodel.CommunityUser communityUser = new org.apache.airavata.credential.store.datamodel.CommunityUser();
-                communityUser.setGatewayNmae(credential1.getCommunityUser().getGatewayName());
-                communityUser.setUsername(credential1.getCommunityUser().getUserName());
-                communityUser.setUserEmail(credential1.getCommunityUser().getUserEmail());
-                certificateCredential.setCommunityUser(communityUser);
-                certificateCredential.setToken(credential1.getToken());
-                certificateCredential.setLifeTime(credential1.getLifeTime());
-                certificateCredential.setNotAfter(credential1.getNotAfter());
-                certificateCredential.setNotBefore(credential1.getNotBefore());
-                certificateCredential.setPersistedTime(credential1.getCertificateRequestedTime().getTime());
-                if (credential1.getPrivateKey() != null){
-                    certificateCredential.setPrivateKey(credential1.getPrivateKey().toString());
-                }
-                certificateCredential.setX509Cert(credential1.getCertificates()[0].toString());
-                return certificateCredential;
-            } else {
-                log.info("Could not find Certificate credentials for token - " + tokenId + " and "
-                        + "gateway id - " + gatewayId);
-                return null;
-            }
-        } catch (CredentialStoreException e) {
-            log.error("Error occurred while retrieving Certificate credential for token - " +  tokenId + " and gateway id - " + gatewayId, e);
-            throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while retrieving Certificate credential for token - " +  tokenId + " and gateway id - " + gatewayId);
-        }
-    }
-
-    @Override
-    public PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
-        return null;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java
deleted file mode 100644
index b2e8786..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialBootstrapper.java
+++ /dev/null
@@ -1,49 +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.credential.store.servlet;
-
-import edu.uiuc.ncsa.myproxy.oa4mp.client.loader.ClientBootstrapper;
-import edu.uiuc.ncsa.security.core.util.ConfigurationLoader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.ServletContext;
-import java.io.File;
-
-/**
- * Bootstrapper class for credential-store.
- */
-public class CredentialBootstrapper extends ClientBootstrapper {
-
-    protected static Logger log = LoggerFactory.getLogger(CredentialBootstrapper.class);
-
-    public ConfigurationLoader getConfigurationLoader(ServletContext servletContext) throws Exception {
-
-        File currentDirectory = new File(".");
-
-        log.info("Current directory is - " + currentDirectory.getAbsolutePath());
-
-        return super.getConfigurationLoader(servletContext);
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java
deleted file mode 100644
index 66d4be7..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreCallbackServlet.java
+++ /dev/null
@@ -1,272 +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.credential.store.servlet;
-
-import edu.uiuc.ncsa.myproxy.oa4mp.client.AssetResponse;
-import edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment;
-import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPService;
-import edu.uiuc.ncsa.myproxy.oa4mp.client.servlet.ClientServlet;
-import edu.uiuc.ncsa.security.core.exceptions.GeneralException;
-import edu.uiuc.ncsa.security.servlet.JSPUtil;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ApplicationSettings;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
-import org.apache.airavata.credential.store.notifier.NotifierBootstrap;
-import org.apache.airavata.credential.store.notifier.impl.EmailNotifierConfiguration;
-import org.apache.airavata.credential.store.store.impl.CertificateCredentialWriter;
-import org.apache.airavata.credential.store.util.ConfigurationReader;
-import org.apache.airavata.credential.store.util.CredentialStoreConstants;
-import org.apache.airavata.credential.store.util.PrivateKeyStore;
-import org.apache.airavata.credential.store.util.Utility;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.Map;
-
-import static edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment.CALLBACK_URI_KEY;
-
-/**
- * Callback from the portal will come here. In this class we will store incomming certificate to the database. Partly
- * taken from OA4MP code base.
- */
-public class CredentialStoreCallbackServlet extends ClientServlet {
-
-    private OA4MPService oa4mpService;
-
-    private CertificateCredentialWriter certificateCredentialWriter;
-
-    private static ConfigurationReader configurationReader;
-
-    private NotifierBootstrap notifierBootstrap;
-
-    public void init() throws ServletException {
-
-        DBUtil dbUtil;
-
-        try {
-            AiravataUtils.setExecutionAsServer();
-            dbUtil = DBUtil.getCredentialStoreDBUtil();
-        } catch (Exception e) {
-            throw new ServletException("Error initializing database operations.", e);
-        }
-
-        try {
-            configurationReader = new ConfigurationReader();
-            super.init();
-            certificateCredentialWriter = new CertificateCredentialWriter(dbUtil);
-        } catch (Exception e) {
-            throw new ServletException("Error initializing configuration reader.", e);
-        }
-
-
-        // initialize notifier
-        try {
-            boolean enabled = Boolean.parseBoolean(ApplicationSettings.getCredentialStoreNotifierEnabled());
-
-            if (enabled) {
-                EmailNotifierConfiguration notifierConfiguration
-                        = EmailNotifierConfiguration.getEmailNotifierConfigurations();
-                long duration = Long.parseLong(ApplicationSettings.getCredentialStoreNotifierDuration());
-
-                notifierBootstrap = new NotifierBootstrap(duration, dbUtil, notifierConfiguration);
-            }
-
-        } catch (ApplicationSettingsException e) {
-            throw new ServletException("Error initializing notifier.", e);
-        }
-
-
-        info("Credential store callback initialized successfully.");
-    }
-
-    @Override
-    public OA4MPService getOA4MPService() {
-        return oa4mpService;
-    }
-
-    @Override
-    public void loadEnvironment() throws IOException {
-        environment = getConfigurationLoader().load();
-        oa4mpService = new OA4MPService((ClientEnvironment) environment);
-    }
-
-    @Override
-    protected void doIt(HttpServletRequest request, HttpServletResponse response) throws Throwable {
-
-        String gatewayName = request.getParameter(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER);
-        String portalUserName = request.getParameter(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER);
-        String durationParameter = request.getParameter(CredentialStoreConstants.DURATION_QUERY_PARAMETER);
-        String contactEmail = request.getParameter(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER);
-        String portalTokenId = request.getParameter(CredentialStoreConstants.PORTAL_TOKEN_ID_ASSIGNED);
-
-        // TODO remove hard coded values, once passing query parameters is
-        // fixed in OA4MP client api
-        long duration = 864000;
-
-        if (durationParameter != null) {
-            duration = Long.parseLong(durationParameter);
-        }
-
-        if (portalTokenId == null) {
-            error("Token given by portal is invalid.");
-            GeneralException ge = new GeneralException("Error: The token presented by portal is null.");
-            request.setAttribute("exception", ge);
-            JSPUtil.fwd(request, response, configurationReader.getErrorUrl());
-            return;
-        }
-
-        info("Gateway name " + gatewayName);
-        info("Portal user name " + portalUserName);
-        info("Community user contact email " + contactEmail);
-        info("Token id presented " + portalTokenId);
-
-        info("2.a. Getting token and verifier.");
-        String token = request.getParameter(CONST(ClientEnvironment.TOKEN));
-        String verifier = request.getParameter(CONST(ClientEnvironment.VERIFIER));
-        if (token == null || verifier == null) {
-            warn("2.a. The token is " + (token == null ? "null" : token) + " and the verifier is "
-                    + (verifier == null ? "null" : verifier));
-            GeneralException ge = new GeneralException(
-                    "Error: This servlet requires parameters for the token and verifier. It cannot be called directly.");
-            request.setAttribute("exception", ge);
-            JSPUtil.fwd(request, response, configurationReader.getErrorUrl());
-            return;
-        }
-        info("2.a Token and verifier found.");
-        X509Certificate[] certificates;
-        AssetResponse assetResponse = null;
-
-        PrivateKey privateKey;
-
-        try {
-
-            PrivateKeyStore privateKeyStore = PrivateKeyStore.getPrivateKeyStore();
-            privateKey = privateKeyStore.getKey(portalTokenId);
-
-            if (privateKey != null) {
-                info("Found private key for token " + portalTokenId);
-            } else {
-                info("Could not find private key for token " + portalTokenId);
-            }
-
-            info("2.a. Getting the cert(s) from the service");
-            assetResponse = getOA4MPService().getCert(token, verifier);
-
-            certificates = assetResponse.getX509Certificates();
-
-        } catch (Throwable t) {
-            warn("2.a. Exception from the server: " + t.getCause().getMessage());
-            error("Exception while trying to get cert. message:" + t.getMessage());
-            request.setAttribute("exception", t);
-            JSPUtil.fwd(request, response, configurationReader.getErrorUrl());
-            return;
-        }
-
-        info("2.b. Done! Displaying success page.");
-
-        CertificateCredential certificateCredential = new CertificateCredential();
-
-        certificateCredential.setNotBefore(Utility.convertDateToString(certificates[0].getNotBefore())); //TODO check this is correct
-        certificateCredential.setNotAfter(Utility.convertDateToString(certificates[0].getNotAfter()));
-        certificateCredential.setCertificates(certificates);
-        certificateCredential.setPrivateKey(privateKey);
-        certificateCredential
-                .setCommunityUser(new CommunityUser(gatewayName, assetResponse.getUsername(), contactEmail));
-        certificateCredential.setPortalUserName(portalUserName);
-        certificateCredential.setLifeTime(duration);
-        certificateCredential.setToken(portalTokenId);
-
-
-        certificateCredentialWriter.writeCredentials(certificateCredential);
-
-        StringBuilder stringBuilder = new StringBuilder("Certificate for community user ");
-        stringBuilder.append(assetResponse.getUsername()).append(" successfully persisted.");
-        stringBuilder.append(" Certificate DN - ").append(certificates[0].getSubjectDN());
-
-        info(stringBuilder.toString());
-
-        if (isUrlInSameServer(configurationReader.getSuccessUrl())) {
-
-            String contextPath = request.getContextPath();
-            if (!contextPath.endsWith("/")) {
-                contextPath = contextPath + "/";
-            }
-            request.setAttribute("action", contextPath);
-            request.setAttribute("tokenId", portalTokenId);
-            JSPUtil.fwd(request, response, configurationReader.getSuccessUrl());
-        } else {
-
-            String urlToRedirect = decorateUrlWithToken(configurationReader.getSuccessUrl(), portalTokenId);
-
-            info("Redirecting to url - " + urlToRedirect);
-
-            response.sendRedirect(urlToRedirect);
-        }
-
-        info("2.a. Completely finished with delegation.");
-
-    }
-
-    private boolean isUrlInSameServer(String url) {
-
-        return !(url.toLowerCase().startsWith("http") || url.toLowerCase().startsWith("https"));
-
-    }
-
-    private String decorateUrlWithToken(String url, String tokenId) {
-
-        StringBuilder stringBuilder = new StringBuilder(url);
-        stringBuilder.append("?tokenId=").append(tokenId);
-        return stringBuilder.toString();
-    }
-
-    private Map<String, String> createQueryParameters(String gatewayName, String portalUserName, String portalEmail,
-            String tokenId) {
-
-        String callbackUriKey = getEnvironment().getConstants().get(CALLBACK_URI_KEY);
-        ClientEnvironment clientEnvironment = (ClientEnvironment) getEnvironment();
-
-        String callbackUri = clientEnvironment.getCallback().toString();
-
-        StringBuilder stringBuilder = new StringBuilder(callbackUri);
-
-        stringBuilder.append("?").append(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER).append("=").append(gatewayName).append("&")
-                .append(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER).append("=").append(portalUserName).append("&")
-                .append(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER).append("=").append(portalEmail).append("&")
-                .append(CredentialStoreConstants.PORTAL_TOKEN_ID_ASSIGNED).append("=").append(tokenId);
-
-        info("Callback URI is set to - " + stringBuilder.toString());
-
-        Map<String, String> parameters = new HashMap<String, String>();
-        parameters.put(callbackUriKey, stringBuilder.toString());
-
-        return parameters;
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
deleted file mode 100644
index 3b70242..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
+++ /dev/null
@@ -1,183 +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.credential.store.servlet;
-
-import edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment;
-import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPResponse;
-import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPService;
-import edu.uiuc.ncsa.myproxy.oa4mp.client.servlet.ClientServlet;
-import edu.uiuc.ncsa.security.servlet.JSPUtil;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-import org.apache.airavata.credential.store.util.ConfigurationReader;
-import org.apache.airavata.credential.store.util.CredentialStoreConstants;
-import org.apache.airavata.credential.store.util.PrivateKeyStore;
-import org.apache.airavata.credential.store.util.TokenGenerator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-
-import static edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment.CALLBACK_URI_KEY;
-
-/**
- * When portal initiate a request to get credentials it will hit this servlet.
- */
-public class CredentialStoreStartServlet extends ClientServlet {
-
-    private static ConfigurationReader configurationReader = null;
-
-    private static Logger log = LoggerFactory.getLogger(CredentialStoreStartServlet.class);
-    private OA4MPService oa4mpService;
-
-    protected String decorateURI(URI inputURI, Map<String, String> parameters) {
-
-        if (parameters.isEmpty()) {
-            return inputURI.toString();
-        }
-
-        String stringUri = inputURI.toString();
-        StringBuilder stringBuilder = new StringBuilder(stringUri);
-
-        boolean isFirst = true;
-
-        for (Map.Entry<String, String> entry : parameters.entrySet()) {
-            if (isFirst) {
-                stringBuilder.append("?");
-                isFirst = false;
-            } else {
-                stringBuilder.append("&");
-            }
-
-            stringBuilder.append(entry.getKey()).append("=").append(entry.getValue());
-        }
-
-        return stringBuilder.toString();
-
-    }
-
-    public void init() throws ServletException {
-
-        super.init();
-
-        try {
-            if (configurationReader == null) {
-                configurationReader = new ConfigurationReader();
-            }
-        } catch (CredentialStoreException e) {
-            throw new ServletException(e);
-        }
-
-    }
-
-    @Override
-    public OA4MPService getOA4MPService() {
-        return oa4mpService;
-    }
-
-    @Override
-    public void loadEnvironment() throws IOException {
-        environment = getConfigurationLoader().load();
-        oa4mpService = new OA4MPService((ClientEnvironment) environment);
-    }
-
-    @Override
-    protected void doIt(HttpServletRequest request, HttpServletResponse response) throws Throwable {
-
-        String gatewayName
-                = request.getParameter(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER);
-        String portalUserName
-                = request.getParameter(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER);
-        String contactEmail
-                = request.getParameter(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER);
-        String associatedToken = TokenGenerator.generateToken(gatewayName, portalUserName);
-
-        if (gatewayName == null) {
-            JSPUtil.handleException(new RuntimeException("Please specify a gateway name."), request, response,
-                    configurationReader.getErrorUrl());
-            return;
-        }
-
-        if (portalUserName == null) {
-            JSPUtil.handleException(new RuntimeException("Please specify a portal user name."), request, response,
-                    configurationReader.getErrorUrl());
-            return;
-        }
-
-        if (contactEmail == null) {
-            JSPUtil.handleException(new RuntimeException("Please specify a contact email address for community"
-                    + " user account."), request, response, configurationReader.getErrorUrl());
-            return;
-        }
-
-        log.info("1.a. Starting transaction");
-        OA4MPResponse gtwResp;
-
-        Map<String, String> queryParameters = new HashMap<String, String>();
-        queryParameters.put(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER, gatewayName);
-        queryParameters.put(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER, portalUserName);
-        queryParameters.put(CredentialStoreConstants.PORTAL_USER_EMAIL_QUERY_PARAMETER, contactEmail);
-        queryParameters.put(CredentialStoreConstants.PORTAL_TOKEN_ID_ASSIGNED, associatedToken);
-
-        Map<String, String> additionalParameters = new HashMap<String, String>();
-
-        if (getOA4MPService() == null) {
-            loadEnvironment();
-        }
-
-        String modifiedCallbackUri = decorateURI(getOA4MPService().getEnvironment().getCallback(), queryParameters);
-
-        info("The modified callback URI - " + modifiedCallbackUri);
-
-        additionalParameters.put(getEnvironment().getConstants().get(CALLBACK_URI_KEY), modifiedCallbackUri);
-
-        try {
-            gtwResp = getOA4MPService().requestCert(additionalParameters);
-
-            // Private key in store
-            PrivateKeyStore privateKeyStore = PrivateKeyStore.getPrivateKeyStore();
-            privateKeyStore.addKey(associatedToken, gtwResp.getPrivateKey());
-
-        } catch (Throwable t) {
-            JSPUtil.handleException(t, request, response, configurationReader.getErrorUrl());
-            return;
-        }
-        log.info("1.b. Got response. Creating page with redirect for " + gtwResp.getRedirect().getHost());
-        // Normally, we'd just do a redirect, but we will put up a page and show the redirect to the user.
-        // The client response contains the generated private key as well
-        // In a real application, the private key would be stored. This, however, exceeds the scope of this
-        // sample application -- all we need to do to complete the process is send along the redirect url.
-
-        request.setAttribute(REDIR, REDIR);
-        request.setAttribute("redirectUrl", gtwResp.getRedirect().toString());
-        request.setAttribute(ACTION_KEY, ACTION_KEY);
-        request.setAttribute("action", ACTION_REDIRECT_VALUE);
-        log.info("1.b. Showing redirect page.");
-        JSPUtil.fwd(request, response, configurationReader.getPortalRedirectUrl());
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java
deleted file mode 100644
index fe54b8e..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReader.java
+++ /dev/null
@@ -1,112 +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.credential.store.store;
-
-import org.apache.airavata.credential.store.credential.AuditInfo;
-import org.apache.airavata.credential.store.credential.Credential;
-
-import java.util.List;
-
-/**
- * This interface provides an API for Credential Store. Provides methods to manipulate credential store data.
- */
-public interface CredentialReader {
-
-    /**
-     * Retrieves the credential from the credential store.
-     * 
-     * @param gatewayId
-     *            The gateway id
-     * @param tokenId
-     *            The token id associated with the credential
-     * @return The Credential object associated with the token.
-     * @throws CredentialStoreException
-     *             If an error occurred while retrieving a credential.
-     */
-    Credential getCredential(String gatewayId, String tokenId) throws CredentialStoreException;
-
-    /**
-     * Gets the admin portal user name who retrieved given community user for given portal user name.
-     * 
-     * @param gatewayName
-     *            The gateway name
-     * @param tokenId
-     *            The issued token id.
-     * @return The portal user name who requested given community user credentials.
-     */
-    String getPortalUser(String gatewayName, String tokenId) throws CredentialStoreException;
-
-    /**
-     * Gets audit information related to given gateway name and community user name.
-     * 
-     * @param gatewayName
-     *            The gateway name.
-     * @param tokenId
-     *            The community user name.
-     * @return CertificateAuditInfo object.
-     */
-    AuditInfo getAuditInfo(String gatewayName, String tokenId) throws CredentialStoreException;
-
-    /**
-     * Gets all the credential records.
-     * @return All credential records as a list
-     * @throws CredentialStoreException If an error occurred while retrieving credentials.
-     */
-    public List<Credential> getAllCredentials() throws CredentialStoreException;
-
-    /**
-     * Updates the community user contact email address.
-     *
-     * @param gatewayName
-     *            The gateway name.
-     * @param communityUser
-     *            The community user name.
-     * @param email
-     *            The new email address.
-     */
-    void updateCommunityUserEmail(String gatewayName, String communityUser, String email)
-            throws CredentialStoreException;
-
-    /**
-     * Will remove credentials for the given gateway id and community user.
-     * 
-     * @param gatewayName
-     *            The gateway Id
-     * @param tokenId
-     *            The issued token id.
-     * @throws CredentialStoreException
-     *             If an error occurred while retrieving data.
-     */
-    void removeCredentials(String gatewayName, String tokenId) throws CredentialStoreException;
-    
-    /**
-     * Retrieves gatewayID from the credential store.
-     * 
-     * @param tokenId
-     *            The token id associated with the credential
-     * @return The Credential object associated with the token.
-     * @throws CredentialStoreException
-     *             If an error occurred while retrieving a credential.
-     */
-    String getGatewayID(String tokenId) throws CredentialStoreException;
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java
deleted file mode 100644
index f4b5e21..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialReaderFactory.java
+++ /dev/null
@@ -1,54 +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.credential.store.store;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
-
-/**
- * Factory class to create credential store readers.
- */
-public class CredentialReaderFactory {
-
-    /**
-     * Creates a credential reader using supplied database configurations.
-     * @param dbUti The database configurations.
-     * @return CredentialReader object.
-     */
-    public static CredentialReader createCredentialStoreReader(DBUtil dbUti) throws ApplicationSettingsException {
-        return new CredentialReaderImpl(dbUti);
-    }
-
-    /**
-     * Creates credential reader using default configurations for credential store database.
-     * @return The credential reader.
-     * @throws ClassNotFoundException If an error occurred while instantiating jdbc driver
-     * @throws ApplicationSettingsException If an error occurred while reading database configurations.
-     * @throws InstantiationException If an error occurred while instantiating jdbc driver
-     * @throws IllegalAccessException A security exception accessing jdbc driver.
-     */
-    public static CredentialReader createCredentialStoreReader() throws ClassNotFoundException,
-            ApplicationSettingsException, InstantiationException, IllegalAccessException {
-        return new CredentialReaderImpl(DBUtil.getCredentialStoreDBUtil());
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java
deleted file mode 100644
index 07bed10..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialStoreException.java
+++ /dev/null
@@ -1,40 +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.credential.store.store;
-
-/**
- * An exception class for credential store.
- */
-public class CredentialStoreException extends Exception {
-
-    public CredentialStoreException() {
-        super();
-    }
-
-    public CredentialStoreException(String s) {
-        super(s);
-    }
-
-    public CredentialStoreException(String s, Throwable throwable) {
-        super(s, throwable);
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java
deleted file mode 100644
index 05ae9fe..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/CredentialWriter.java
+++ /dev/null
@@ -1,39 +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.credential.store.store;
-
-import org.apache.airavata.credential.store.credential.Credential;
-
-/**
- * The entity who's writing credentials to DB will use this interface.
- */
-public interface CredentialWriter {
-
-    /**
-     * Writes given credentials to a persistent storage.
-     * 
-     * @param credential
-     *            The credentials implementation.
-     */
-    void writeCredentials(Credential credential) throws CredentialStoreException;
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java
deleted file mode 100644
index 8b96187..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CertificateCredentialWriter.java
+++ /dev/null
@@ -1,121 +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.credential.store.store.impl;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ApplicationSettings;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.DefaultKeyStorePasswordCallback;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-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.impl.db.CommunityUserDAO;
-import org.apache.airavata.credential.store.store.impl.db.CredentialsDAO;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-import org.apache.airavata.credential.store.store.CredentialWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-/**
- * Writes certificate credentials to database.
- */
-public class CertificateCredentialWriter implements CredentialWriter {
-
-    private CredentialsDAO credentialsDAO;
-    private CommunityUserDAO communityUserDAO;
-
-    protected static Logger log = LoggerFactory.getLogger(CertificateCredentialWriter.class);
-
-    private DBUtil dbUtil;
-
-    public CertificateCredentialWriter(DBUtil dbUtil) throws ApplicationSettingsException {
-
-        this.dbUtil = dbUtil;
-
-        this.credentialsDAO = new CredentialsDAO(ApplicationSettings.getCredentialStoreKeyStorePath(),
-                ApplicationSettings.getCredentialStoreKeyAlias(), new DefaultKeyStorePasswordCallback());
-
-        communityUserDAO = new CommunityUserDAO();
-    }
-
-    public void writeCredentials(Credential credential) throws CredentialStoreException {
-
-        CertificateCredential certificateCredential = (CertificateCredential) credential;
-
-        Connection connection = null;
-
-        try {
-
-            connection = dbUtil.getConnection();
-            // Write community user
-            writeCommunityUser(certificateCredential.getCommunityUser(), credential.getToken(), connection);
-            // First delete existing credentials
-            credentialsDAO.deleteCredentials(certificateCredential.getCommunityUser().getGatewayName(),
-                    certificateCredential.getToken(), connection);
-            // Add the new certificate
-            credentialsDAO.addCredentials(certificateCredential.getCommunityUser().getGatewayName(), credential,
-                    connection);
-
-            if (!connection.getAutoCommit()) {
-                connection.commit();
-            }
-
-        } catch (SQLException e) {
-            if (connection != null) {
-                try {
-                    connection.rollback();
-                } catch (SQLException e1) {
-                    log.error("Unable to rollback transaction", e1);
-                }
-            }
-            throw new CredentialStoreException("Unable to retrieve database connection.", e);
-        } finally {
-            DBUtil.cleanup(connection);
-        }
-
-    }
-
-    public void writeCommunityUser(CommunityUser communityUser, String token, Connection connection)
-            throws CredentialStoreException {
-
-        // First delete existing community user
-        communityUserDAO.deleteCommunityUserByToken(communityUser, token, connection);
-
-        // Persist new community user
-        communityUserDAO.addCommunityUser(communityUser, token, connection);
-
-    }
-
-    /*
-     * TODO Remove later - If we dont need to expose this in the interface public void writeCommunityUser(CommunityUser
-     * communityUser, String token) throws CredentialStoreException {
-     * 
-     * Connection connection = null; try { connection = dbUtil.getConnection(); writeCommunityUser(communityUser, token,
-     * connection);
-     * 
-     * } catch (SQLException e) { throw new CredentialStoreException("Unable to retrieve database connection.", e); }
-     * finally { DBUtil.cleanup(connection); } }
-     */
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java
deleted file mode 100644
index dc2fd60..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/CredentialReaderImpl.java
+++ /dev/null
@@ -1,162 +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.credential.store.store.impl;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ApplicationSettings;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.DefaultKeyStorePasswordCallback;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.credential.impl.certificate.CertificateAuditInfo;
-import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
-import org.apache.airavata.credential.store.store.CredentialReader;
-import org.apache.airavata.credential.store.store.impl.db.CredentialsDAO;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-
-import java.io.Serializable;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.List;
-
-/**
- * Credential store API implementation.
- */
-public class CredentialReaderImpl implements CredentialReader, Serializable {
-
-    private CredentialsDAO credentialsDAO;
-
-    private DBUtil dbUtil;
-
-    public CredentialReaderImpl(DBUtil dbUtil) throws ApplicationSettingsException {
-
-        this.credentialsDAO = new CredentialsDAO(ApplicationSettings.getCredentialStoreKeyStorePath(),
-                ApplicationSettings.getCredentialStoreKeyAlias(), new DefaultKeyStorePasswordCallback());
-
-        this.dbUtil = dbUtil;
-    }
-
-    private Connection getConnection() throws CredentialStoreException {
-        try {
-            return this.dbUtil.getConnection();
-        } catch (SQLException e) {
-            throw new CredentialStoreException("Unable to retrieve database connection.", e);
-        }
-    }
-
-    @Override
-    public Credential getCredential(String gatewayId, String tokenId) throws CredentialStoreException {
-
-        Connection connection = getConnection();
-
-        try {
-            return this.credentialsDAO.getCredential(gatewayId, tokenId, connection);
-        } finally {
-            DBUtil.cleanup(connection);
-        }
-    }
-
-    public List<Credential> getAllCredentials() throws CredentialStoreException {
-
-        Connection connection = getConnection();
-
-        try {
-            return this.credentialsDAO.getCredentials(connection);
-        } finally {
-            DBUtil.cleanup(connection);
-        }
-
-    }
-
-    public String getPortalUser(String gatewayName, String tokenId) throws CredentialStoreException {
-
-        Connection connection = getConnection();
-
-        Credential credential;
-
-        try {
-            credential = this.credentialsDAO.getCredential(gatewayName, tokenId, connection);
-
-        } finally {
-            DBUtil.cleanup(connection);
-        }
-
-        return credential.getPortalUserName();
-    }
-
-    public CertificateAuditInfo getAuditInfo(String gatewayName, String tokenId) throws CredentialStoreException {
-
-        Connection connection = getConnection();
-
-        CertificateAuditInfo certificateAuditInfo;
-
-        try {
-
-            CertificateCredential certificateCredential = (CertificateCredential) this.credentialsDAO.getCredential(
-                    gatewayName, tokenId, connection);
-
-            certificateAuditInfo = new CertificateAuditInfo();
-
-            CommunityUser retrievedUser = certificateCredential.getCommunityUser();
-            certificateAuditInfo.setCommunityUserName(retrievedUser.getUserName());
-            certificateAuditInfo.setCredentialLifeTime(certificateCredential.getLifeTime());
-            certificateAuditInfo.setCredentialsRequestedTime(certificateCredential.getCertificateRequestedTime());
-            certificateAuditInfo.setGatewayName(gatewayName);
-            certificateAuditInfo.setNotAfter(certificateCredential.getNotAfter());
-            certificateAuditInfo.setNotBefore(certificateCredential.getNotBefore());
-            certificateAuditInfo.setPortalUserName(certificateCredential.getPortalUserName());
-
-        } finally {
-            DBUtil.cleanup(connection);
-        }
-
-        return certificateAuditInfo;
-    }
-
-    public void updateCommunityUserEmail(String gatewayName, String communityUser, String email)
-            throws CredentialStoreException {
-        // TODO
-    }
-
-    public void removeCredentials(String gatewayName, String tokenId) throws CredentialStoreException {
-
-        Connection connection = getConnection();
-
-        try {
-            credentialsDAO.deleteCredentials(gatewayName, tokenId, connection);
-        } finally {
-            DBUtil.cleanup(connection);
-        }
-
-    }
-
-	@Override
-	public String getGatewayID(String tokenId) throws CredentialStoreException {
-		 Connection connection = getConnection();
-	        try {
-	            return this.credentialsDAO.getGatewayID(tokenId, connection);
-	        } finally {
-	            DBUtil.cleanup(connection);
-	        }
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java
deleted file mode 100644
index ad4f6b3..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/SSHCredentialWriter.java
+++ /dev/null
@@ -1,87 +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.credential.store.store.impl;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ApplicationSettings;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.DefaultKeyStorePasswordCallback;
-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.CredentialStoreException;
-import org.apache.airavata.credential.store.store.CredentialWriter;
-import org.apache.airavata.credential.store.store.impl.db.CredentialsDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Writes SSH credentials to database.
- */
-public class SSHCredentialWriter implements CredentialWriter {
-
-    private CredentialsDAO credentialsDAO;
-    private DBUtil dbUtil;
-    
-    protected static Logger logger = LoggerFactory.getLogger(SSHCredentialWriter.class);
-
-    public SSHCredentialWriter(DBUtil dbUtil) throws ApplicationSettingsException {
-        this.dbUtil = dbUtil;
-        this.credentialsDAO = new CredentialsDAO(ApplicationSettings.getCredentialStoreKeyStorePath(),
-                ApplicationSettings.getCredentialStoreKeyAlias(), new DefaultKeyStorePasswordCallback());
-
-    }
-
-    public void writeCredentials(Credential credential) throws CredentialStoreException {
-
-        SSHCredential sshCredential = (SSHCredential) credential;
-        Connection connection = null;
-
-        try {
-            connection = dbUtil.getConnection();
-            // First delete existing credentials
-            credentialsDAO.deleteCredentials(sshCredential.getGateway(), sshCredential.getToken(), connection);
-            // Add the new certificate
-            credentialsDAO.addCredentials(sshCredential.getGateway(), credential, connection);
-
-            if (!connection.getAutoCommit()) {
-                connection.commit();
-            }
-
-        } catch (SQLException e) {
-            if (connection != null) {
-                try {
-                    connection.rollback();
-                } catch (SQLException e1) {
-                    logger.error("Unable to rollback transaction", e1);
-                }
-            }
-            throw new CredentialStoreException("Unable to retrieve database connection.", e);
-        } finally {
-            DBUtil.cleanup(connection);
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
deleted file mode 100644
index f55cd55..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
+++ /dev/null
@@ -1,257 +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.credential.store.store.impl.db;
-
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Data access class for community_user table.
- */
-public class CommunityUserDAO extends ParentDAO {
-
-    public CommunityUserDAO() {
-        super();
-    }
-
-    public void addCommunityUser(CommunityUser user, String token, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "INSERT INTO COMMUNITY_USER VALUES (?, ?, ?, ?)";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, user.getGatewayName());
-            preparedStatement.setString(2, user.getUserName());
-            preparedStatement.setString(3, token);
-            preparedStatement.setString(4, user.getUserEmail());
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error persisting community user.");
-            stringBuilder.append("gateway - ").append(user.getGatewayName());
-            stringBuilder.append("community user name - ").append(user.getUserName());
-            stringBuilder.append("community user email - ").append(user.getUserEmail());
-            stringBuilder.append("token id - ").append(token);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-
-            DBUtil.cleanup(preparedStatement);
-        }
-    }
-
-    public void deleteCommunityUser(CommunityUser user, Connection connection) throws CredentialStoreException {
-
-        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, user.getGatewayName());
-            preparedStatement.setString(2, user.getUserName());
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error deleting community user.");
-            stringBuilder.append("gateway - ").append(user.getGatewayName());
-            stringBuilder.append("community user name - ").append(user.getUserName());
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement);
-        }
-    }
-
-    public void deleteCommunityUserByToken(CommunityUser user, String token, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=? AND TOKEN_ID=?";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, user.getGatewayName());
-            preparedStatement.setString(2, user.getUserName());
-            preparedStatement.setString(3, token);
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error deleting community user.");
-            stringBuilder.append("gateway - ").append(user.getGatewayName());
-            stringBuilder.append("community user name - ").append(user.getUserName());
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement);
-        }
-    }
-
-    public void updateCommunityUser(CommunityUser user) throws CredentialStoreException {
-
-        // TODO
-    }
-
-    public CommunityUser getCommunityUser(String gatewayName, String communityUserName, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, gatewayName);
-            preparedStatement.setString(2, communityUserName);
-
-            ResultSet resultSet = preparedStatement.executeQuery();
-
-            if (resultSet.next()) {
-                String email = resultSet.getString("COMMUNITY_USER_EMAIL"); // TODO fix typo
-
-                return new CommunityUser(gatewayName, communityUserName, email);
-
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving community user.");
-            stringBuilder.append("gateway - ").append(gatewayName);
-            stringBuilder.append("community user name - ").append(communityUserName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement);
-        }
-
-        return null;
-    }
-
-    public CommunityUser getCommunityUserByToken(String gatewayName, String tokenId, Connection connection)
-            throws CredentialStoreException {
-
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND TOKEN_ID=?";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, gatewayName);
-            preparedStatement.setString(2, tokenId);
-
-            ResultSet resultSet = preparedStatement.executeQuery();
-
-            if (resultSet.next()) {
-                String communityUserName = resultSet.getString("COMMUNITY_USER_NAME");
-                String email = resultSet.getString("COMMUNITY_USER_EMAIL"); // TODO fix typo
-
-                return new CommunityUser(gatewayName, communityUserName, email);
-
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving community user.");
-            stringBuilder.append("gateway - ").append(gatewayName);
-            stringBuilder.append("token- ").append(tokenId);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement);
-        }
-
-        return null;
-    }
-
-    public List<CommunityUser> getCommunityUsers(String gatewayName, Connection connection)
-            throws CredentialStoreException {
-
-        List<CommunityUser> userList = new ArrayList<CommunityUser>();
-
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=?";
-
-        PreparedStatement preparedStatement = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, gatewayName);
-
-            ResultSet resultSet = preparedStatement.executeQuery();
-
-            while (resultSet.next()) {
-                String userName = resultSet.getString("COMMUNITY_USER_NAME");
-                String email = resultSet.getString("COMMUNITY_USER_EMAIL"); // TODO fix typo
-
-                userList.add(new CommunityUser(gatewayName, userName, email));
-
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving community users for ");
-            stringBuilder.append("gateway - ").append(gatewayName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new CredentialStoreException(stringBuilder.toString(), e);
-        } finally {
-            DBUtil.cleanup(preparedStatement);
-        }
-
-        return userList;
-    }
-
-}


[38/62] [abbrv] airavata git commit: continuation of authentication mode implementation

Posted by la...@apache.org.
continuation of authentication mode implementation

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/7ef88004
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/7ef88004
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/7ef88004

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 7ef880044a2916adabe4f33d47e6349367a3a84c
Parents: 7883eb9
Author: msmemon <sh...@gmail.com>
Authored: Tue Mar 10 17:20:17 2015 +0100
Committer: msmemon <sh...@gmail.com>
Committed: Tue Mar 10 17:20:17 2015 +0100

----------------------------------------------------------------------
 .../catalog/data/impl/ComputeResourceImpl.java  |  1 +
 .../data/model/UnicoreJobSubmission.java        | 16 +++++++-
 .../data/resources/AbstractResource.java        |  1 +
 .../resources/UnicoreJobSubmissionResource.java | 39 ++++++++++++++------
 .../catalog/data/util/AppCatalogJPAUtils.java   |  1 +
 .../data/util/AppCatalogThriftConversion.java   |  3 +-
 .../src/main/resources/appcatalog-derby.sql     |  1 +
 .../src/main/resources/appcatalog-mysql.sql     |  1 +
 8 files changed, 50 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
index 75b0987..4e6b7ae 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
@@ -209,6 +209,7 @@ public class ComputeResourceImpl implements ComputeResource {
              unicoreJobSubmission.setJobSubmissionInterfaceId(AppCatalogUtils.getID("UNICORE"));
              UnicoreJobSubmissionResource resource = AppCatalogThriftConversion.getUnicoreJobSubmission(unicoreJobSubmission);
              resource.setUnicoreEndpointUrl(unicoreJobSubmission.getUnicoreEndPointURL());
+             resource.setAuthenticationMode(unicoreJobSubmission.getAuthenticationMode().toString());
              if (unicoreJobSubmission.getSecurityProtocol() !=  null){
                  resource.setSecurityProtocol(unicoreJobSubmission.getSecurityProtocol().toString());
              }

http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
index d37fda4..626fee4 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/UnicoreJobSubmission.java
@@ -37,7 +37,20 @@ public class UnicoreJobSubmission {
 
     @Column(name = "UNICORE_ENDPOINT_URL")
     private String unicoreEndpointUrl;
+    
+    @Column(name = "AUTHENTICATION_MODE")
+    private String authenticationMode;
 
+
+    public String getAuthenticationMode() {
+		return authenticationMode;
+	}
+
+    public void setAuthenticationMode(String authenticationMode) {
+		this.authenticationMode = authenticationMode;
+	}
+
+    
     public String getUnicoreEndpointUrl() {
 		return unicoreEndpointUrl;
 	}
@@ -45,7 +58,8 @@ public class UnicoreJobSubmission {
     public void setUnicoreEndpointUrl(String unicoreEndpointUrl) {
 		this.unicoreEndpointUrl = unicoreEndpointUrl;
 	}
-
+    
+    
 	public String getSubmissionID() {
         return submissionID;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
index 5f55069..5b8695a 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
@@ -125,6 +125,7 @@ public abstract class AbstractResource implements Resource {
         public static final String SUBMISSION_ID = "submissionID";
         public static final String SECURITY_PROTOCAL = "securityProtocol";
         public static final String UNICORE_ENDPOINT_URL = "unicoreEndpointUrl";
+        public static final String AUTHENTICATION_MODE = "authenticationMode";
     }
 
     public final class UnicoreDataMovementConstants {

http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
index a43b300..df401ad 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/UnicoreJobSubmissionResource.java
@@ -24,7 +24,6 @@ package org.apache.aiaravata.application.catalog.data.resources;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
@@ -46,8 +45,9 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
 	private String jobSubmissionInterfaceId;
 	private String securityProtocol;
 	private String unicoreEndpointUrl;
+	private String authenticationMode;
 
-	 public void remove(Object identifier) throws AppCatalogException {
+	public void remove(Object identifier) throws AppCatalogException {
 	        EntityManager em = null;
 	        try {
 	            em = AppCatalogJPAUtils.getEntityManager();
@@ -72,21 +72,13 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
 	    }
 
 	 public Resource get(Object identifier) throws AppCatalogException {
-		 // TODO: what? there is no sense to pass string and expect hashmap.. :(
 		 HashMap<String, String> ids;
-//	        if (identifier instanceof Map) {
-//	            ids = (HashMap) identifier;
-//	        } else {
-//	            logger.error("Identifier should be a map with the field name and it's value");
-//	            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
-//	        }   
 		 EntityManager em = null;
 	        try {
 	            em = AppCatalogJPAUtils.getEntityManager();
 	            em.getTransaction().begin();
 	            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(UNICORE_JOB_SUBMISSION);
 	            generator.setParameter(UnicoreJobSubmissionConstants.SUBMISSION_ID, identifier);
-//	            generator.setParameter(UnicoreJobSubmissionConstants.UNICORE_ENDPOINT_URL, ids.get(UnicoreJobSubmissionConstants.UNICORE_ENDPOINT_URL));
 	            Query q = generator.selectQuery(em);
 	            UnicoreJobSubmission unicoreJobSubmission = (UnicoreJobSubmission) q.getSingleResult();
 	            UnicoreJobSubmissionResource unicoreSubmissionResource =
@@ -145,7 +137,21 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
 	                        unicoreSubmissionResourceList.add(unicoreJobSubmissionResource);
 	                    }
 	                }
-	            } else {
+	            } else if (fieldName.equals(UnicoreJobSubmissionConstants.AUTHENTICATION_MODE)) {
+	                generator.setParameter(UnicoreJobSubmissionConstants.AUTHENTICATION_MODE, value);
+	                q = generator.selectQuery(em);
+	                results = q.getResultList();
+	                if (results.size() != 0) {
+	                    for (Object result : results) {
+	                        UnicoreJobSubmission unicoreJobSubmission = (UnicoreJobSubmission) result;
+	                        UnicoreJobSubmissionResource unicoreJobSubmissionResource =
+	                                (UnicoreJobSubmissionResource) AppCatalogJPAUtils.getResource(
+	                                        AppCatalogResourceType.UNICORE_JOB_SUBMISSION, unicoreJobSubmission);
+	                        unicoreSubmissionResourceList.add(unicoreJobSubmissionResource);
+	                    }
+	                }
+	            }        
+	            else {
 	                em.getTransaction().commit();
 	                em.close();
 	                logger.error("Unsupported field name for Unicore submission resource.", new IllegalArgumentException());
@@ -264,12 +270,14 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
                 existingUnicoreSubmission.setSubmissionID(jobSubmissionInterfaceId);;
                 existingUnicoreSubmission.setUnicoreEndpointUrl(unicoreEndpointUrl);
                 existingUnicoreSubmission.setSecurityProtocol(securityProtocol);
+                existingUnicoreSubmission.setAuthenticationMode(authenticationMode);
                 em.merge(existingUnicoreSubmission);
             } else {
             	UnicoreJobSubmission unicoreJobSubmission = new UnicoreJobSubmission();
                 unicoreJobSubmission.setSubmissionID(jobSubmissionInterfaceId);
                 unicoreJobSubmission.setUnicoreEndpointUrl(unicoreEndpointUrl);
                 unicoreJobSubmission.setSecurityProtocol(securityProtocol);
+                unicoreJobSubmission.setAuthenticationMode(authenticationMode);
                 em.persist(unicoreJobSubmission);
             }
             em.getTransaction().commit();
@@ -331,6 +339,15 @@ public class UnicoreJobSubmissionResource extends AbstractResource {
 	public void setUnicoreEndpointUrl(String unicoreEndpointUrl) {
 		this.unicoreEndpointUrl = unicoreEndpointUrl;
 	}
+
 	
+     public String getAuthenticationMode() {
+		return authenticationMode;
+	}
+
+	public void setAuthenticationMode(String authenticationMode) {
+		this.authenticationMode = authenticationMode;
+	}
+
 	
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
index 3a9b6ed..0ee1ad0 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
@@ -533,6 +533,7 @@ public class AppCatalogJPAUtils {
             submissionResource.setjobSubmissionInterfaceId(o.getSubmissionID());
             submissionResource.setUnicoreEndpointUrl(o.getUnicoreEndpointUrl());
             submissionResource.setSecurityProtocol(o.getSecurityProtocol());
+            submissionResource.setAuthenticationMode(o.getAuthenticationMode());
         }
         return submissionResource;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
index 1df6c24..941b844 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
@@ -237,6 +237,7 @@ public class AppCatalogThriftConversion {
             resource.setSecurityProtocol(submission.getSecurityProtocol().toString());
         }
         resource.setUnicoreEndpointUrl(submission.getUnicoreEndPointURL());
+        resource.setAuthenticationMode(submission.getAuthenticationMode().toString());
         return resource;
     }
 
@@ -337,10 +338,10 @@ public class AppCatalogThriftConversion {
     	UnicoreJobSubmission unicoreJobSubmission = new UnicoreJobSubmission();
     	unicoreJobSubmission.setUnicoreEndPointURL(submission.getUnicoreEndpointUrl());
     	unicoreJobSubmission.setJobSubmissionInterfaceId(submission.getjobSubmissionInterfaceId());
+    	unicoreJobSubmission.setAuthenticationMode(AuthenticationMode.valueOf(submission.getAuthenticationMode()));
         if (submission.getSecurityProtocol() != null){
             unicoreJobSubmission.setSecurityProtocol(SecurityProtocol.valueOf(submission.getSecurityProtocol()));
         }
-
         return unicoreJobSubmission;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
index 4e28e04..5396541 100644
--- a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
+++ b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
@@ -79,6 +79,7 @@ CREATE TABLE UNICORE_SUBMISSION
          SUBMISSION_ID VARCHAR(255),
          SECURITY_PROTOCAL VARCHAR(255),
          UNICORE_ENDPOINT_URL VARCHAR(255),
+         AUTHENTICATION_MODE VARCHAR(255),
          PRIMARY KEY(SUBMISSION_ID)
 );
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/7ef88004/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
index cfb8022..98f27db 100644
--- a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
+++ b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
@@ -91,6 +91,7 @@ CREATE TABLE UNICORE_SUBMISSION
          SUBMISSION_ID VARCHAR(255),
          SECURITY_PROTOCAL VARCHAR(255),
          UNICORE_ENDPOINT_URL VARCHAR(255),
+         AUTHENTICATION_MODE VARCHAR(255),
          PRIMARY KEY(SUBMISSION_ID)
 );
 


[39/62] [abbrv] airavata git commit: fixing compilation isssue, bug in getAvailableAppInterfaceComputeResources(), fixing AIRAVATA-1226, AIRAVATA-1626

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
index 121db80..5a6df09 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
@@ -3049,6 +3049,251 @@ uint32_t Airavata_getProject_presult::read(::apache::thrift::protocol::TProtocol
   return xfer;
 }
 
+uint32_t Airavata_deleteProject_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+  uint32_t xfer = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TType ftype;
+  int16_t fid;
+
+  xfer += iprot->readStructBegin(fname);
+
+  using ::apache::thrift::protocol::TProtocolException;
+
+  bool isset_projectId = false;
+
+  while (true)
+  {
+    xfer += iprot->readFieldBegin(fname, ftype, fid);
+    if (ftype == ::apache::thrift::protocol::T_STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->projectId);
+          isset_projectId = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  if (!isset_projectId)
+    throw TProtocolException(TProtocolException::INVALID_DATA);
+  return xfer;
+}
+
+uint32_t Airavata_deleteProject_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("Airavata_deleteProject_args");
+
+  xfer += oprot->writeFieldBegin("projectId", ::apache::thrift::protocol::T_STRING, 1);
+  xfer += oprot->writeString(this->projectId);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t Airavata_deleteProject_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("Airavata_deleteProject_pargs");
+
+  xfer += oprot->writeFieldBegin("projectId", ::apache::thrift::protocol::T_STRING, 1);
+  xfer += oprot->writeString((*(this->projectId)));
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t Airavata_deleteProject_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+  uint32_t xfer = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TType ftype;
+  int16_t fid;
+
+  xfer += iprot->readStructBegin(fname);
+
+  using ::apache::thrift::protocol::TProtocolException;
+
+
+  while (true)
+  {
+    xfer += iprot->readFieldBegin(fname, ftype, fid);
+    if (ftype == ::apache::thrift::protocol::T_STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+        if (ftype == ::apache::thrift::protocol::T_BOOL) {
+          xfer += iprot->readBool(this->success);
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 1:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->ire.read(iprot);
+          this->__isset.ire = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 2:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->ace.read(iprot);
+          this->__isset.ace = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 3:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->ase.read(iprot);
+          this->__isset.ase = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 4:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->pnfe.read(iprot);
+          this->__isset.pnfe = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t Airavata_deleteProject_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+  uint32_t xfer = 0;
+
+  xfer += oprot->writeStructBegin("Airavata_deleteProject_result");
+
+  if (this->__isset.success) {
+    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0);
+    xfer += oprot->writeBool(this->success);
+    xfer += oprot->writeFieldEnd();
+  } else if (this->__isset.ire) {
+    xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+    xfer += this->ire.write(oprot);
+    xfer += oprot->writeFieldEnd();
+  } else if (this->__isset.ace) {
+    xfer += oprot->writeFieldBegin("ace", ::apache::thrift::protocol::T_STRUCT, 2);
+    xfer += this->ace.write(oprot);
+    xfer += oprot->writeFieldEnd();
+  } else if (this->__isset.ase) {
+    xfer += oprot->writeFieldBegin("ase", ::apache::thrift::protocol::T_STRUCT, 3);
+    xfer += this->ase.write(oprot);
+    xfer += oprot->writeFieldEnd();
+  } else if (this->__isset.pnfe) {
+    xfer += oprot->writeFieldBegin("pnfe", ::apache::thrift::protocol::T_STRUCT, 4);
+    xfer += this->pnfe.write(oprot);
+    xfer += oprot->writeFieldEnd();
+  }
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t Airavata_deleteProject_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+  uint32_t xfer = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TType ftype;
+  int16_t fid;
+
+  xfer += iprot->readStructBegin(fname);
+
+  using ::apache::thrift::protocol::TProtocolException;
+
+
+  while (true)
+  {
+    xfer += iprot->readFieldBegin(fname, ftype, fid);
+    if (ftype == ::apache::thrift::protocol::T_STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+        if (ftype == ::apache::thrift::protocol::T_BOOL) {
+          xfer += iprot->readBool((*(this->success)));
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 1:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->ire.read(iprot);
+          this->__isset.ire = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 2:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->ace.read(iprot);
+          this->__isset.ace = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 3:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->ase.read(iprot);
+          this->__isset.ase = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 4:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->pnfe.read(iprot);
+          this->__isset.pnfe = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
 uint32_t Airavata_getAllUserProjects_args::read(::apache::thrift::protocol::TProtocol* iprot) {
 
   uint32_t xfer = 0;
@@ -29080,6 +29325,76 @@ void AiravataClient::recv_getProject( ::apache::airavata::model::workspace::Proj
   throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getProject failed: unknown result");
 }
 
+bool AiravataClient::deleteProject(const std::string& projectId)
+{
+  send_deleteProject(projectId);
+  return recv_deleteProject();
+}
+
+void AiravataClient::send_deleteProject(const std::string& projectId)
+{
+  int32_t cseqid = 0;
+  oprot_->writeMessageBegin("deleteProject", ::apache::thrift::protocol::T_CALL, cseqid);
+
+  Airavata_deleteProject_pargs args;
+  args.projectId = &projectId;
+  args.write(oprot_);
+
+  oprot_->writeMessageEnd();
+  oprot_->getTransport()->writeEnd();
+  oprot_->getTransport()->flush();
+}
+
+bool AiravataClient::recv_deleteProject()
+{
+
+  int32_t rseqid = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TMessageType mtype;
+
+  iprot_->readMessageBegin(fname, mtype, rseqid);
+  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+    ::apache::thrift::TApplicationException x;
+    x.read(iprot_);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+    throw x;
+  }
+  if (mtype != ::apache::thrift::protocol::T_REPLY) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  if (fname.compare("deleteProject") != 0) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  bool _return;
+  Airavata_deleteProject_presult result;
+  result.success = &_return;
+  result.read(iprot_);
+  iprot_->readMessageEnd();
+  iprot_->getTransport()->readEnd();
+
+  if (result.__isset.success) {
+    return _return;
+  }
+  if (result.__isset.ire) {
+    throw result.ire;
+  }
+  if (result.__isset.ace) {
+    throw result.ace;
+  }
+  if (result.__isset.ase) {
+    throw result.ase;
+  }
+  if (result.__isset.pnfe) {
+    throw result.pnfe;
+  }
+  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "deleteProject failed: unknown result");
+}
+
 void AiravataClient::getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName)
 {
   send_getAllUserProjects(gatewayId, userName);
@@ -36812,6 +37127,72 @@ void AiravataProcessor::process_getProject(int32_t seqid, ::apache::thrift::prot
   }
 }
 
+void AiravataProcessor::process_deleteProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+  void* ctx = NULL;
+  if (this->eventHandler_.get() != NULL) {
+    ctx = this->eventHandler_->getContext("Airavata.deleteProject", callContext);
+  }
+  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Airavata.deleteProject");
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preRead(ctx, "Airavata.deleteProject");
+  }
+
+  Airavata_deleteProject_args args;
+  args.read(iprot);
+  iprot->readMessageEnd();
+  uint32_t bytes = iprot->getTransport()->readEnd();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postRead(ctx, "Airavata.deleteProject", bytes);
+  }
+
+  Airavata_deleteProject_result result;
+  try {
+    result.success = iface_->deleteProject(args.projectId);
+    result.__isset.success = true;
+  } catch ( ::apache::airavata::api::error::InvalidRequestException &ire) {
+    result.ire = ire;
+    result.__isset.ire = true;
+  } catch ( ::apache::airavata::api::error::AiravataClientException &ace) {
+    result.ace = ace;
+    result.__isset.ace = true;
+  } catch ( ::apache::airavata::api::error::AiravataSystemException &ase) {
+    result.ase = ase;
+    result.__isset.ase = true;
+  } catch ( ::apache::airavata::api::error::ProjectNotFoundException &pnfe) {
+    result.pnfe = pnfe;
+    result.__isset.pnfe = true;
+  } catch (const std::exception& e) {
+    if (this->eventHandler_.get() != NULL) {
+      this->eventHandler_->handlerError(ctx, "Airavata.deleteProject");
+    }
+
+    ::apache::thrift::TApplicationException x(e.what());
+    oprot->writeMessageBegin("deleteProject", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+    x.write(oprot);
+    oprot->writeMessageEnd();
+    oprot->getTransport()->writeEnd();
+    oprot->getTransport()->flush();
+    return;
+  }
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preWrite(ctx, "Airavata.deleteProject");
+  }
+
+  oprot->writeMessageBegin("deleteProject", ::apache::thrift::protocol::T_REPLY, seqid);
+  result.write(oprot);
+  oprot->writeMessageEnd();
+  bytes = oprot->getTransport()->writeEnd();
+  oprot->getTransport()->flush();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postWrite(ctx, "Airavata.deleteProject", bytes);
+  }
+}
+
 void AiravataProcessor::process_getAllUserProjects(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
 {
   void* ctx = NULL;

http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
index 4604bf8..78a7e9c 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
@@ -45,6 +45,7 @@ class AiravataIf {
   virtual void createProject(std::string& _return, const std::string& gatewayId, const  ::apache::airavata::model::workspace::Project& project) = 0;
   virtual void updateProject(const std::string& projectId, const  ::apache::airavata::model::workspace::Project& updatedProject) = 0;
   virtual void getProject( ::apache::airavata::model::workspace::Project& _return, const std::string& projectId) = 0;
+  virtual bool deleteProject(const std::string& projectId) = 0;
   virtual void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName) = 0;
   virtual void searchProjectsByProjectName(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName, const std::string& projectName) = 0;
   virtual void searchProjectsByProjectDesc(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName, const std::string& description) = 0;
@@ -217,6 +218,10 @@ class AiravataNull : virtual public AiravataIf {
   void getProject( ::apache::airavata::model::workspace::Project& /* _return */, const std::string& /* projectId */) {
     return;
   }
+  bool deleteProject(const std::string& /* projectId */) {
+    bool _return = false;
+    return _return;
+  }
   void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & /* _return */, const std::string& /* gatewayId */, const std::string& /* userName */) {
     return;
   }
@@ -2290,6 +2295,148 @@ class Airavata_getProject_presult {
 };
 
 
+class Airavata_deleteProject_args {
+ public:
+
+  Airavata_deleteProject_args() : projectId() {
+  }
+
+  virtual ~Airavata_deleteProject_args() throw() {}
+
+  std::string projectId;
+
+  void __set_projectId(const std::string& val) {
+    projectId = val;
+  }
+
+  bool operator == (const Airavata_deleteProject_args & rhs) const
+  {
+    if (!(projectId == rhs.projectId))
+      return false;
+    return true;
+  }
+  bool operator != (const Airavata_deleteProject_args &rhs) const {
+    return !(*this == rhs);
+  }
+
+  bool operator < (const Airavata_deleteProject_args & ) const;
+
+  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Airavata_deleteProject_pargs {
+ public:
+
+
+  virtual ~Airavata_deleteProject_pargs() throw() {}
+
+  const std::string* projectId;
+
+  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Airavata_deleteProject_result__isset {
+  _Airavata_deleteProject_result__isset() : success(false), ire(false), ace(false), ase(false), pnfe(false) {}
+  bool success;
+  bool ire;
+  bool ace;
+  bool ase;
+  bool pnfe;
+} _Airavata_deleteProject_result__isset;
+
+class Airavata_deleteProject_result {
+ public:
+
+  Airavata_deleteProject_result() : success(0) {
+  }
+
+  virtual ~Airavata_deleteProject_result() throw() {}
+
+  bool success;
+   ::apache::airavata::api::error::InvalidRequestException ire;
+   ::apache::airavata::api::error::AiravataClientException ace;
+   ::apache::airavata::api::error::AiravataSystemException ase;
+   ::apache::airavata::api::error::ProjectNotFoundException pnfe;
+
+  _Airavata_deleteProject_result__isset __isset;
+
+  void __set_success(const bool val) {
+    success = val;
+  }
+
+  void __set_ire(const  ::apache::airavata::api::error::InvalidRequestException& val) {
+    ire = val;
+  }
+
+  void __set_ace(const  ::apache::airavata::api::error::AiravataClientException& val) {
+    ace = val;
+  }
+
+  void __set_ase(const  ::apache::airavata::api::error::AiravataSystemException& val) {
+    ase = val;
+  }
+
+  void __set_pnfe(const  ::apache::airavata::api::error::ProjectNotFoundException& val) {
+    pnfe = val;
+  }
+
+  bool operator == (const Airavata_deleteProject_result & rhs) const
+  {
+    if (!(success == rhs.success))
+      return false;
+    if (!(ire == rhs.ire))
+      return false;
+    if (!(ace == rhs.ace))
+      return false;
+    if (!(ase == rhs.ase))
+      return false;
+    if (!(pnfe == rhs.pnfe))
+      return false;
+    return true;
+  }
+  bool operator != (const Airavata_deleteProject_result &rhs) const {
+    return !(*this == rhs);
+  }
+
+  bool operator < (const Airavata_deleteProject_result & ) const;
+
+  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Airavata_deleteProject_presult__isset {
+  _Airavata_deleteProject_presult__isset() : success(false), ire(false), ace(false), ase(false), pnfe(false) {}
+  bool success;
+  bool ire;
+  bool ace;
+  bool ase;
+  bool pnfe;
+} _Airavata_deleteProject_presult__isset;
+
+class Airavata_deleteProject_presult {
+ public:
+
+
+  virtual ~Airavata_deleteProject_presult() throw() {}
+
+  bool* success;
+   ::apache::airavata::api::error::InvalidRequestException ire;
+   ::apache::airavata::api::error::AiravataClientException ace;
+   ::apache::airavata::api::error::AiravataSystemException ase;
+   ::apache::airavata::api::error::ProjectNotFoundException pnfe;
+
+  _Airavata_deleteProject_presult__isset __isset;
+
+  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
 class Airavata_getAllUserProjects_args {
  public:
 
@@ -16351,6 +16498,9 @@ class AiravataClient : virtual public AiravataIf {
   void getProject( ::apache::airavata::model::workspace::Project& _return, const std::string& projectId);
   void send_getProject(const std::string& projectId);
   void recv_getProject( ::apache::airavata::model::workspace::Project& _return);
+  bool deleteProject(const std::string& projectId);
+  void send_deleteProject(const std::string& projectId);
+  bool recv_deleteProject();
   void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName);
   void send_getAllUserProjects(const std::string& gatewayId, const std::string& userName);
   void recv_getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return);
@@ -16685,6 +16835,7 @@ class AiravataProcessor : public ::apache::thrift::TDispatchProcessor {
   void process_createProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
   void process_updateProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
   void process_getProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+  void process_deleteProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
   void process_getAllUserProjects(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
   void process_searchProjectsByProjectName(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
   void process_searchProjectsByProjectDesc(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
@@ -16803,6 +16954,7 @@ class AiravataProcessor : public ::apache::thrift::TDispatchProcessor {
     processMap_["createProject"] = &AiravataProcessor::process_createProject;
     processMap_["updateProject"] = &AiravataProcessor::process_updateProject;
     processMap_["getProject"] = &AiravataProcessor::process_getProject;
+    processMap_["deleteProject"] = &AiravataProcessor::process_deleteProject;
     processMap_["getAllUserProjects"] = &AiravataProcessor::process_getAllUserProjects;
     processMap_["searchProjectsByProjectName"] = &AiravataProcessor::process_searchProjectsByProjectName;
     processMap_["searchProjectsByProjectDesc"] = &AiravataProcessor::process_searchProjectsByProjectDesc;
@@ -17059,6 +17211,15 @@ class AiravataMultiface : virtual public AiravataIf {
     return;
   }
 
+  bool deleteProject(const std::string& projectId) {
+    size_t sz = ifaces_.size();
+    size_t i = 0;
+    for (; i < (sz - 1); ++i) {
+      ifaces_[i]->deleteProject(projectId);
+    }
+    return ifaces_[i]->deleteProject(projectId);
+  }
+
   void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName) {
     size_t sz = ifaces_.size();
     size_t i = 0;

http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
index 482119d..96b9e0f 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
@@ -104,6 +104,11 @@ class AiravataHandler : virtual public AiravataIf {
     printf("getProject\n");
   }
 
+  bool deleteProject(const std::string& projectId) {
+    // Your implementation goes here
+    printf("deleteProject\n");
+  }
+
   void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName) {
     // Your implementation goes here
     printf("getAllUserProjects\n");

http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index 85bf7e6..0865706 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -30,6 +30,7 @@ interface AiravataIf {
   public function createProject($gatewayId, \Airavata\Model\Workspace\Project $project);
   public function updateProject($projectId, \Airavata\Model\Workspace\Project $updatedProject);
   public function getProject($projectId);
+  public function deleteProject($projectId);
   public function getAllUserProjects($gatewayId, $userName);
   public function searchProjectsByProjectName($gatewayId, $userName, $projectName);
   public function searchProjectsByProjectDesc($gatewayId, $userName, $description);
@@ -927,6 +928,69 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("getProject failed: unknown result");
   }
 
+  public function deleteProject($projectId)
+  {
+    $this->send_deleteProject($projectId);
+    return $this->recv_deleteProject();
+  }
+
+  public function send_deleteProject($projectId)
+  {
+    $args = new \Airavata\API\Airavata_deleteProject_args();
+    $args->projectId = $projectId;
+    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+    if ($bin_accel)
+    {
+      thrift_protocol_write_binary($this->output_, 'deleteProject', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+    }
+    else
+    {
+      $this->output_->writeMessageBegin('deleteProject', TMessageType::CALL, $this->seqid_);
+      $args->write($this->output_);
+      $this->output_->writeMessageEnd();
+      $this->output_->getTransport()->flush();
+    }
+  }
+
+  public function recv_deleteProject()
+  {
+    $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+    if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_deleteProject_result', $this->input_->isStrictRead());
+    else
+    {
+      $rseqid = 0;
+      $fname = null;
+      $mtype = 0;
+
+      $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+      if ($mtype == TMessageType::EXCEPTION) {
+        $x = new TApplicationException();
+        $x->read($this->input_);
+        $this->input_->readMessageEnd();
+        throw $x;
+      }
+      $result = new \Airavata\API\Airavata_deleteProject_result();
+      $result->read($this->input_);
+      $this->input_->readMessageEnd();
+    }
+    if ($result->success !== null) {
+      return $result->success;
+    }
+    if ($result->ire !== null) {
+      throw $result->ire;
+    }
+    if ($result->ace !== null) {
+      throw $result->ace;
+    }
+    if ($result->ase !== null) {
+      throw $result->ase;
+    }
+    if ($result->pnfe !== null) {
+      throw $result->pnfe;
+    }
+    throw new \Exception("deleteProject failed: unknown result");
+  }
+
   public function getAllUserProjects($gatewayId, $userName)
   {
     $this->send_getAllUserProjects($gatewayId, $userName);
@@ -9983,6 +10047,238 @@ class Airavata_getProject_result {
 
 }
 
+class Airavata_deleteProject_args {
+  static $_TSPEC;
+
+  public $projectId = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'projectId',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['projectId'])) {
+        $this->projectId = $vals['projectId'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'Airavata_deleteProject_args';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 1:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->projectId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('Airavata_deleteProject_args');
+    if ($this->projectId !== null) {
+      $xfer += $output->writeFieldBegin('projectId', TType::STRING, 1);
+      $xfer += $output->writeString($this->projectId);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+class Airavata_deleteProject_result {
+  static $_TSPEC;
+
+  public $success = null;
+  public $ire = null;
+  public $ace = null;
+  public $ase = null;
+  public $pnfe = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        0 => array(
+          'var' => 'success',
+          'type' => TType::BOOL,
+          ),
+        1 => array(
+          'var' => 'ire',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\InvalidRequestException',
+          ),
+        2 => array(
+          'var' => 'ace',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AiravataClientException',
+          ),
+        3 => array(
+          'var' => 'ase',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AiravataSystemException',
+          ),
+        4 => array(
+          'var' => 'pnfe',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\ProjectNotFoundException',
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['success'])) {
+        $this->success = $vals['success'];
+      }
+      if (isset($vals['ire'])) {
+        $this->ire = $vals['ire'];
+      }
+      if (isset($vals['ace'])) {
+        $this->ace = $vals['ace'];
+      }
+      if (isset($vals['ase'])) {
+        $this->ase = $vals['ase'];
+      }
+      if (isset($vals['pnfe'])) {
+        $this->pnfe = $vals['pnfe'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'Airavata_deleteProject_result';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 0:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->success);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 1:
+          if ($ftype == TType::STRUCT) {
+            $this->ire = new \Airavata\API\Error\InvalidRequestException();
+            $xfer += $this->ire->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRUCT) {
+            $this->ace = new \Airavata\API\Error\AiravataClientException();
+            $xfer += $this->ace->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::STRUCT) {
+            $this->ase = new \Airavata\API\Error\AiravataSystemException();
+            $xfer += $this->ase->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRUCT) {
+            $this->pnfe = new \Airavata\API\Error\ProjectNotFoundException();
+            $xfer += $this->pnfe->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('Airavata_deleteProject_result');
+    if ($this->success !== null) {
+      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
+      $xfer += $output->writeBool($this->success);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ire !== null) {
+      $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+      $xfer += $this->ire->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ace !== null) {
+      $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 2);
+      $xfer += $this->ace->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ase !== null) {
+      $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 3);
+      $xfer += $this->ase->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->pnfe !== null) {
+      $xfer += $output->writeFieldBegin('pnfe', TType::STRUCT, 4);
+      $xfer += $this->pnfe->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
 class Airavata_getAllUserProjects_args {
   static $_TSPEC;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 3d58197..6110f53 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -61,7 +61,7 @@ public class CreateLaunchExperiment {
     private static String echoAppId = "Echo_8506337e-ab7a-46b6-9b71-4a461b6c5e35";
     private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
-    private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
+    private static String amberAppId = "Amber_aa083c86-4680-4002-b3ef-fad93c181926";
     private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
     private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
     private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f";
@@ -85,15 +85,36 @@ public class CreateLaunchExperiment {
     public static void main(String[] args) throws Exception {
         airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
         System.out.println("API version is " + airavataClient.getAPIVersion());
+        getAvailableAppInterfaceComputeResources("Echo_4fb76cb3-6bf6-409e-aa17-7cc7ee6e41af");
 //        createGateway();
 //        getGateway("testGatewayId");
-//      registerApplications(); // run this only the first time
-        createAndLaunchExp();
+//        registerApplications(); // run this only the first time
+//        createAndLaunchExp();
     }
     
     private static String fsdResourceId;
 
 
+    public static void getAvailableAppInterfaceComputeResources(String appInterfaceId) {
+        try {
+            Map<String, String> availableAppInterfaceComputeResources = airavataClient.getAvailableAppInterfaceComputeResources(appInterfaceId);
+            for (String key : availableAppInterfaceComputeResources.keySet()){
+                System.out.println("id : " + key);
+                System.out.println("name : " + availableAppInterfaceComputeResources.get(key));
+            }
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
     public static void createGateway(){
         try {
             Gateway gateway = new Gateway();
@@ -154,14 +175,14 @@ public class CreateLaunchExperiment {
 //                final String expId = createExperimentForBR2Amber(airavataClient);
 //                final String expId = createExperimentWRFStampede(airavataClient);
 //                final String expId = createExperimentForStampedeAmber(airavataClient);
-//                final String expId = createExperimentForTrestlesAmber(airavataClient);
+                final String expId = createExperimentForTrestlesAmber(airavataClient);
 //                final String expId = createExperimentGROMACSStampede(airavataClient);
 //                final String expId = createExperimentESPRESSOStampede(airavataClient);
 //                final String expId = createExperimentLAMMPSStampede(airavataClient);
 //                final String expId = createExperimentNWCHEMStampede(airavataClient);
 //                final String expId = createExperimentTRINITYStampede(airavataClient);
 //                final String expId = createExperimentAUTODOCKStampede(airavataClient); // this is not working , we need to register AutoDock app on stampede
-                final String expId = createExperimentForLSF(airavataClient);
+//                final String expId = createExperimentForLSF(airavataClient);
 //            	  final String expId = "Ultrascan_ln_eb029947-391a-4ccf-8ace-9bafebe07cc0";
                 System.out.println("Experiment ID : " + expId);
 //                updateExperiment(airavata, expId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java
new file mode 100644
index 0000000..762d031
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java
@@ -0,0 +1,70 @@
+/**
+ * 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.
+ */
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.model.appcatalog.computeresource;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+/**
+ * AuthenticationMode
+ * 
+ * SERVER_ISSUED: use CA credentials to generate a certificate based on user name.
+ * server properties.
+ * MYPROXY_ISSUED: rely on GSI method implementation already provided
+ * by Airavata security libs.
+ */
+@SuppressWarnings("all") public enum AuthenticationMode implements org.apache.thrift.TEnum {
+  SERVER_ISSUED(0),
+  MYPROXY_ISSUED(1);
+
+  private final int value;
+
+  private AuthenticationMode(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static AuthenticationMode findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return SERVER_ISSUED;
+      case 1:
+        return MYPROXY_ISSUED;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
index 95a91e6..b12c3b8 100644
--- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
@@ -176,6 +176,12 @@ service Airavata {
                 3: airavataErrors.AiravataSystemException ase,
                 4: airavataErrors.ProjectNotFoundException pnfe)
 
+  bool deleteProject (1: required string projectId)
+          throws (1: airavataErrors.InvalidRequestException ire,
+                  2: airavataErrors.AiravataClientException ace,
+                  3: airavataErrors.AiravataSystemException ase,
+                  4: airavataErrors.ProjectNotFoundException pnfe)
+
  /**
    * Get all Project by user
    *


[05/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java
new file mode 100644
index 0000000..b9dc2ef
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAO.java
@@ -0,0 +1,458 @@
+/*
+ *
+ * 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.credential.store.store.impl.db;
+
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.KeyStorePasswordCallback;
+import org.apache.airavata.common.utils.SecurityUtil;
+import org.apache.airavata.credential.store.credential.Credential;
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+
+import java.io.*;
+import java.security.GeneralSecurityException;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Data access class for credential store.
+ */
+public class CredentialsDAO extends ParentDAO {
+
+    private String keyStorePath = null;
+    private String secretKeyAlias = null;
+    private KeyStorePasswordCallback keyStorePasswordCallback = null;
+
+    public CredentialsDAO() {
+    }
+
+    public CredentialsDAO(String keyStore, String alias, KeyStorePasswordCallback passwordCallback) {
+        this.keyStorePath = keyStore;
+        this.secretKeyAlias = alias;
+        this.keyStorePasswordCallback = passwordCallback;
+    }
+
+    public String getKeyStorePath() {
+        return keyStorePath;
+    }
+
+    public void setKeyStorePath(String keyStorePath) {
+        this.keyStorePath = keyStorePath;
+    }
+
+    public String getSecretKeyAlias() {
+        return secretKeyAlias;
+    }
+
+    public void setSecretKeyAlias(String secretKeyAlias) {
+        this.secretKeyAlias = secretKeyAlias;
+    }
+
+    public KeyStorePasswordCallback getKeyStorePasswordCallback() {
+        return keyStorePasswordCallback;
+    }
+
+    public void setKeyStorePasswordCallback(KeyStorePasswordCallback keyStorePasswordCallback) {
+        this.keyStorePasswordCallback = keyStorePasswordCallback;
+    }
+
+    /**
+     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
+     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
+     * + ")";
+     */
+
+    public void addCredentials(String gatewayId, Credential credential, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "INSERT INTO CREDENTIALS VALUES (?, ?, ?, ?, ?)";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, gatewayId);
+            preparedStatement.setString(2, credential.getToken());
+
+            InputStream isCert = new ByteArrayInputStream(convertObjectToByteArray(credential));
+            preparedStatement.setBinaryStream(3, isCert);
+
+            preparedStatement.setString(4, credential.getPortalUserName());
+
+            java.util.Date date = new java.util.Date();
+            Timestamp timestamp = new Timestamp(date.getTime());
+
+            preparedStatement.setTimestamp(5, timestamp);
+
+            preparedStatement.executeUpdate();
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error persisting credentials.");
+            stringBuilder.append(" gateway - ").append(gatewayId);
+            stringBuilder.append(" token id - ").append(credential.getToken());
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+
+            DBUtil.cleanup(preparedStatement);
+        }
+    }
+
+    public void deleteCredentials(String gatewayName, String tokenId, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "DELETE FROM CREDENTIALS WHERE GATEWAY_ID=? AND TOKEN_ID=?";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, gatewayName);
+            preparedStatement.setString(2, tokenId);
+
+            preparedStatement.executeUpdate();
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error deleting credentials for .");
+            stringBuilder.append("gateway - ").append(gatewayName);
+            stringBuilder.append("token id - ").append(tokenId);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement);
+        }
+    }
+
+    /**
+     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
+     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
+     * + ")";
+     */
+    public void updateCredentials(String gatewayId, Credential credential, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "UPDATE CREDENTIALS set CREDENTIAL = ?, PORTAL_USER_ID = ?, TIME_PERSISTED = ? where GATEWAY_ID = ? and TOKEN_ID = ?";
+
+        PreparedStatement preparedStatement = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            InputStream isCert = new ByteArrayInputStream(convertObjectToByteArray(credential));
+            preparedStatement.setBinaryStream(1, isCert);
+
+            preparedStatement.setString(2, credential.getPortalUserName());
+
+            preparedStatement.setTimestamp(3, new Timestamp(new java.util.Date().getTime()));
+            preparedStatement.setString(4, gatewayId);
+            preparedStatement.setString(5, credential.getToken());
+
+            preparedStatement.executeUpdate();
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
+            stringBuilder.append(" gateway - ").append(gatewayId);
+            stringBuilder.append(" token id - ").append(credential.getToken());
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+
+            DBUtil.cleanup(preparedStatement);
+        }
+
+    }
+
+    /**
+     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
+     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
+     * + ")";
+     */
+    public Credential getCredential(String gatewayName, String tokenId, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "SELECT * FROM CREDENTIALS WHERE GATEWAY_ID=? AND TOKEN_ID=?";
+
+        PreparedStatement preparedStatement = null;
+        ResultSet resultSet = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, gatewayName);
+            preparedStatement.setString(2, tokenId);
+
+            resultSet = preparedStatement.executeQuery();
+
+            if (resultSet.next()) {
+                // CertificateCredential certificateCredential = new CertificateCredential();
+
+                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
+                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());
+
+                Credential certificateCredential = (Credential) convertByteArrayToObject(certificate);
+
+                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
+                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));
+
+                return certificateCredential;
+            }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving credentials for user.");
+            stringBuilder.append("gateway - ").append(gatewayName);
+            stringBuilder.append("token id - ").append(tokenId);
+
+            log.debug(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement, resultSet);
+        }
+
+        return null;
+    }
+    /**
+     * 
+     */
+    public String getGatewayID(String tokenId, Connection connection)
+            throws CredentialStoreException {
+
+        String sql = "SELECT GATEWAY_ID FROM CREDENTIALS WHERE TOKEN_ID=?";
+
+        PreparedStatement preparedStatement = null;
+        ResultSet resultSet = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, tokenId);
+         
+            resultSet = preparedStatement.executeQuery();
+
+            if (resultSet.next()) {
+            	return resultSet.getString("GATEWAY_ID");
+              }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving credentials for user.");
+            stringBuilder.append("token id - ").append(tokenId);
+
+            log.debug(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement, resultSet);
+        }
+
+        return null;
+    }
+    /**
+     * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TOKEN_ID VARCHAR(256) NOT NULL,\n" + // Actual token used to identify the credential
+     * "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n" +
+     * "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n" + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n"
+     * + ")";
+     */
+    public List<Credential> getCredentials(String gatewayName, Connection connection) throws CredentialStoreException {
+
+        List<Credential> credentialList = new ArrayList<Credential>();
+
+        String sql = "SELECT * FROM CREDENTIALS WHERE GATEWAY_ID=?";
+
+        PreparedStatement preparedStatement = null;
+        ResultSet resultSet = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, gatewayName);
+
+            resultSet = preparedStatement.executeQuery();
+
+            Credential certificateCredential;
+
+            while (resultSet.next()) {
+
+                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
+                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());
+
+                certificateCredential = (Credential) convertByteArrayToObject(certificate);
+
+                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
+                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));
+
+                credentialList.add(certificateCredential);
+            }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving credential list for ");
+            stringBuilder.append("gateway - ").append(gatewayName);
+
+            log.debug(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement, resultSet);
+        }
+
+        return credentialList;
+    }
+
+    /**
+     * Gets all credentials.
+     * @param connection The database connection
+     * @return All credentials as a list
+     * @throws CredentialStoreException If an error occurred while rerieving credentials.
+     */
+    public List<Credential> getCredentials(Connection connection) throws CredentialStoreException {
+
+        List<Credential> credentialList = new ArrayList<Credential>();
+
+        String sql = "SELECT * FROM CREDENTIALS";
+
+        PreparedStatement preparedStatement = null;
+        ResultSet resultSet = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            resultSet = preparedStatement.executeQuery();
+
+            Credential certificateCredential;
+
+            while (resultSet.next()) {
+
+                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
+                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());
+
+                certificateCredential = (Credential) convertByteArrayToObject(certificate);
+
+                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
+                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));
+
+                credentialList.add(certificateCredential);
+            }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving all credentials");
+
+            log.debug(stringBuilder.toString(), e);
+
+            throw new CredentialStoreException(stringBuilder.toString(), e);
+        } finally {
+            DBUtil.cleanup(preparedStatement, resultSet);
+        }
+
+        return credentialList;
+    }
+
+    public Object convertByteArrayToObject(byte[] data) throws CredentialStoreException {
+        ObjectInputStream objectInputStream = null;
+        Object o = null;
+        try {
+            try {
+                //decrypt the data first
+                if (encrypt()) {
+                    data = SecurityUtil.decrypt(this.keyStorePath, this.secretKeyAlias, this.keyStorePasswordCallback, data);
+                }
+
+                objectInputStream = new ObjectInputStream(new ByteArrayInputStream(data));
+                o = objectInputStream.readObject();
+
+            } catch (IOException e) {
+                throw new CredentialStoreException("Error de-serializing object.", e);
+            } catch (ClassNotFoundException e) {
+                throw new CredentialStoreException("Error de-serializing object.", e);
+            } catch (GeneralSecurityException e) {
+                throw new CredentialStoreException("Error decrypting data.", e);
+            }
+        } finally {
+            if (objectInputStream != null) {
+                try {
+                    objectInputStream.close();
+                } catch (IOException e) {
+                    log.error("Error occurred while closing the stream", e);
+                }
+            }
+        }
+        return o;
+    }
+
+    public byte[] convertObjectToByteArray(Serializable o) throws CredentialStoreException {
+        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+
+        ObjectOutputStream objectOutputStream = null;
+        try {
+            objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
+            objectOutputStream.writeObject(o);
+            objectOutputStream.flush();
+        } catch (IOException e) {
+            throw new CredentialStoreException("Error serializing object.", e);
+        } finally {
+            if (objectOutputStream != null) {
+                try {
+                    objectOutputStream.close();
+                } catch (IOException e) {
+                    log.error("Error occurred while closing object output stream", e);
+                }
+            }
+        }
+
+        // encrypt the byte array
+        if (encrypt()) {
+            byte[] array = byteArrayOutputStream.toByteArray();
+            try {
+                return SecurityUtil.encrypt(this.keyStorePath, this.secretKeyAlias, this.keyStorePasswordCallback, array);
+            } catch (GeneralSecurityException e) {
+                throw new CredentialStoreException("Error encrypting data", e);
+            } catch (IOException e) {
+                throw new CredentialStoreException("Error encrypting data. IO exception.", e);
+            }
+        } else {
+            return byteArrayOutputStream.toByteArray();
+        }
+    }
+
+    /**
+     * Says whether to encrypt data or not. if alias, keystore is set
+     * we treat encryption true.
+     * @return true if data should encrypt else false.
+     */
+    private boolean encrypt() {
+        return this.keyStorePath != null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java
new file mode 100644
index 0000000..8ef0d69
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/ParentDAO.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.credential.store.store.impl.db;
+
+import org.apache.airavata.common.utils.DBUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Super class to abstract out Data access classes.
+ */
+public class ParentDAO {
+    protected static Logger log = LoggerFactory.getLogger(ParentDAO.class);
+
+    public ParentDAO() {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java
new file mode 100644
index 0000000..e44d4d8
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/ConfigurationReader.java
@@ -0,0 +1,121 @@
+/*
+ *
+ * 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.credential.store.util;
+
+import org.apache.airavata.credential.store.store.CredentialStoreException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 8/25/13
+ * Time: 6:40 AM
+ */
+
+/**
+ * Reads credential store specific configurations from the client.xml file.
+ */
+public class ConfigurationReader {
+
+    private String successUrl;
+
+    private String errorUrl;
+
+    private String portalRedirectUrl;
+
+    public String getPortalRedirectUrl() {
+        return portalRedirectUrl;
+    }
+
+    public void setPortalRedirectUrl(String portalRedirectUrl) {
+        this.portalRedirectUrl = portalRedirectUrl;
+    }
+
+    public ConfigurationReader() throws CredentialStoreException {
+
+        try {
+            loadConfigurations();
+        } catch (Exception e) {
+            throw new CredentialStoreException("Unable to read credential store specific configurations." , e);
+        }
+
+
+    }
+
+    private void loadConfigurations() throws ParserConfigurationException,
+            IOException, SAXException {
+        InputStream inputStream
+                = this.getClass().getClassLoader().getResourceAsStream("credential-store/client.xml");
+
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        Document doc = dBuilder.parse(inputStream);
+
+        doc.getDocumentElement().normalize();
+
+        NodeList nodeList = doc.getElementsByTagName("credential-store");
+
+        readElementValue(nodeList);
+
+    }
+
+    private void readElementValue(NodeList nodeList) {
+        for (int temp = 0; temp < nodeList.getLength(); temp++) {
+
+            Node nNode = nodeList.item(temp);
+
+            if (nNode.getNodeType() == Node.ELEMENT_NODE) {
+
+                Element eElement = (Element) nNode;
+
+                this.successUrl = eElement.getElementsByTagName("successUri").item(0).getTextContent();
+                this.errorUrl =  eElement.getElementsByTagName("errorUri").item(0).getTextContent();
+                this.portalRedirectUrl = eElement.getElementsByTagName("redirectUri").item(0).getTextContent();
+            }
+        }
+    }
+
+    public String getSuccessUrl() {
+        return successUrl;
+    }
+
+    public void setSuccessUrl(String successUrl) {
+        this.successUrl = successUrl;
+    }
+
+    public String getErrorUrl() {
+        return errorUrl;
+    }
+
+    public void setErrorUrl(String errorUrl) {
+        this.errorUrl = errorUrl;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java
new file mode 100644
index 0000000..de3c59c
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/CredentialStoreConstants.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.credential.store.util;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 8/25/13
+ * Time: 4:34 PM
+ */
+
+public class CredentialStoreConstants {
+
+    public static final String GATEWAY_NAME_QUERY_PARAMETER = "gatewayName";
+    public static final String PORTAL_USER_QUERY_PARAMETER = "portalUserName";
+    public static final String PORTAL_USER_EMAIL_QUERY_PARAMETER = "email";
+    public static final String PORTAL_TOKEN_ID_ASSIGNED = "associatedToken";
+    public static final String DURATION_QUERY_PARAMETER = "duration";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java
new file mode 100644
index 0000000..cd6db7e
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/PrivateKeyStore.java
@@ -0,0 +1,70 @@
+/*
+ *
+ * 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.credential.store.util;
+
+import java.security.PrivateKey;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 9/5/13
+ * Time: 6:47 PM
+ */
+
+public class PrivateKeyStore {
+
+    private Map<String, PrivateKey> privateKeyMap;
+
+    private static PrivateKeyStore privateKeyStore = null;
+
+    private PrivateKeyStore() {
+        privateKeyMap = new HashMap<String, PrivateKey>();
+    }
+
+    public static PrivateKeyStore getPrivateKeyStore() {
+
+        if (privateKeyStore == null) {
+            privateKeyStore = new PrivateKeyStore();
+        }
+
+        return privateKeyStore;
+    }
+
+    public synchronized void addKey(String tokenId, PrivateKey privateKey) {
+
+        privateKeyMap.put(tokenId, privateKey);
+    }
+
+    public synchronized PrivateKey getKey(String tokenId) {
+
+        PrivateKey privateKey = privateKeyMap.get(tokenId);
+
+        if (privateKey != null) {
+            privateKeyMap.remove(tokenId);
+        }
+
+        return privateKey;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java
new file mode 100644
index 0000000..1c36f8d
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/TokenGenerator.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * 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.credential.store.util;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 5/21/13
+ * Time: 3:07 PM
+ */
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Timestamp;
+import java.util.UUID;
+
+/**
+ * Generates tokens for users.
+ */
+public class TokenGenerator {
+
+    protected static Logger log = LoggerFactory.getLogger(TokenGenerator.class);
+
+
+    public TokenGenerator() {
+
+    }
+
+    public static String generateToken(String gatewayId, String metadata) {
+
+        return UUID.randomUUID().toString();
+    }
+
+    public String encryptToken(String token) {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/Utility.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/Utility.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/Utility.java
new file mode 100644
index 0000000..0ea7bc1
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/util/Utility.java
@@ -0,0 +1,110 @@
+/*
+ *
+ * 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.credential.store.util;
+
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.KeyPair;
+import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
+import org.apache.commons.io.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.security.KeyStore;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Contains some utility methods.
+ */
+public class Utility {
+
+    protected static Logger log = LoggerFactory.getLogger(Utility.class);
+
+    private static final String DATE_FORMAT = "MM/dd/yyyy HH:mm:ss";
+
+    public static String convertDateToString(Date date) {
+
+        DateFormat df = new SimpleDateFormat(DATE_FORMAT);
+        return df.format(date);
+    }
+
+    public static Date convertStringToDate(String date) throws ParseException {
+
+        DateFormat df = new SimpleDateFormat(DATE_FORMAT);
+        return df.parse(date);
+    }
+
+    public static String encrypt(String stringToEncrypt) {
+        return null;
+
+    }
+
+    public static KeyStore loadKeyStore(String keyStoreFile) throws Exception {
+        KeyStore ks = KeyStore.getInstance("JKS");
+        // get user password and file input stream
+        char[] password = getPassword();
+
+        java.io.FileInputStream fis = null;
+        try {
+            fis = new FileInputStream(keyStoreFile);
+            ks.load(fis, password);
+
+            return ks;
+        } finally {
+            if (fis != null) {
+                fis.close();
+            }
+        }
+    }
+
+    public static char[] getPassword() {
+        return new char[0];
+    }
+
+    public static org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential generateKeyPair(SSHCredential credential) throws Exception{
+        JSch jsch=new JSch();
+        try{
+            KeyPair kpair=KeyPair.genKeyPair(jsch, KeyPair.RSA);
+            File file = File.createTempFile("id_rsa", "");
+            String fileName = file.getAbsolutePath();
+
+            kpair.writePrivateKey(fileName,credential.getPassphrase().getBytes());
+            kpair.writePublicKey(fileName + ".pub"  , "");
+            kpair.dispose();
+            byte[] priKey = FileUtils.readFileToByteArray(new File(fileName));
+
+            byte[] pubKey = FileUtils.readFileToByteArray(new File(fileName + ".pub"));
+            credential.setPrivateKey(priKey);
+            credential.setPublicKey(pubKey);
+            return credential;
+        }
+        catch(Exception e){
+            log.error("Error while creating key pair", e);
+            throw new Exception("Error while creating key pair", e);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java
new file mode 100644
index 0000000..05d7a10
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/notifier/impl/EmailNotifierTest.java
@@ -0,0 +1,56 @@
+/*
+ *
+ * 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.credential.store.notifier.impl;
+
+import junit.framework.TestCase;
+import org.apache.airavata.credential.store.notifier.NotificationMessage;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 12/27/13
+ * Time: 1:54 PM
+ */
+
+public class EmailNotifierTest extends TestCase {
+    public void setUp() throws Exception {
+        super.setUp();
+
+    }
+
+    // Test is disabled. Need to fill in parameters to send mails
+    public void xtestNotifyMessage() throws Exception {
+
+        EmailNotifierConfiguration emailNotifierConfiguration = new EmailNotifierConfiguration("smtp.googlemail.com",
+                465, "yyy", "xxx", true, "yyy@gmail.com");
+
+        EmailNotifier notifier = new EmailNotifier(emailNotifierConfiguration);
+        EmailNotificationMessage emailNotificationMessage = new EmailNotificationMessage("Test",
+                "ggg@gmail.com", "Testing credential store");
+        notifier.notifyMessage(emailNotificationMessage);
+
+    }
+
+    // Just to ignore test failures.
+    public void testIgnore() {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
new file mode 100644
index 0000000..8ed8a6a
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAOTest.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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.credential.store.store.impl.db;
+
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.DatabaseTestCases;
+import org.apache.airavata.common.utils.DerbyUtil;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+import org.junit.*;
+
+import java.sql.Connection;
+import java.util.List;
+
+/**
+ * Test for community user DAO.
+ */
+public class CommunityUserDAOTest extends DatabaseTestCases {
+
+    private CommunityUserDAO communityUserDAO;
+
+    @BeforeClass
+    public static void setUpDatabase() throws Exception {
+
+        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
+
+        waitTillServerStarts();
+
+        String createTable = "CREATE TABLE COMMUNITY_USER\n" + "                (\n"
+                + "                        GATEWAY_NAME VARCHAR(256) NOT NULL,\n"
+                + "                        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,\n"
+                + "                        TOKEN_ID VARCHAR(256) NOT NULL,\n"
+                + "                        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,\n"
+                + "                        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)\n"
+                + "                )";
+
+        String dropTable = "drop table COMMUNITY_USER";
+
+        try {
+            executeSQL(dropTable);
+        } catch (Exception e) {
+        }
+
+        executeSQL(createTable);
+
+    }
+
+    @AfterClass
+    public static void shutDownDatabase() throws Exception {
+        DerbyUtil.stopDerbyServer();
+    }
+
+    @Before
+    public void setUp() throws Exception {
+
+        communityUserDAO = new CommunityUserDAO();
+
+        Connection connection = getDbUtil().getConnection();
+
+        try {
+            DBUtil.truncate("community_user", connection);
+        } finally {
+            connection.close();
+        }
+
+    }
+
+    @Test
+    public void testAddCommunityUser() throws Exception {
+
+        Connection connection = getConnection();
+
+        try {
+
+            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
+            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
+
+            communityUser = new CommunityUser("gw1", "ogce2", "ogce@sciencegateway.org");
+            communityUserDAO.addCommunityUser(communityUser, "Token2", connection);
+
+            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
+            Assert.assertNotNull(user);
+            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
+
+            user = communityUserDAO.getCommunityUser("gw1", "ogce2", connection);
+            Assert.assertNotNull(user);
+            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
+
+            user = communityUserDAO.getCommunityUserByToken("gw1", "Token1", connection);
+            Assert.assertNotNull(user);
+            Assert.assertEquals("ogce", user.getUserName());
+            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
+
+            user = communityUserDAO.getCommunityUserByToken("gw1", "Token2", connection);
+            Assert.assertNotNull(user);
+            Assert.assertEquals("ogce2", user.getUserName());
+            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
+
+        } finally {
+            connection.close();
+        }
+
+    }
+
+    @Test
+    public void testDeleteCommunityUser() throws Exception {
+
+        Connection connection = getConnection();
+
+        try {
+            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
+            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
+
+            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
+            Assert.assertNotNull(user);
+
+            communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
+            communityUserDAO.deleteCommunityUser(communityUser, connection);
+
+            user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
+            Assert.assertNull(user);
+
+        } finally {
+            connection.close();
+        }
+    }
+
+    @Test
+    public void testDeleteCommunityUserByToken() throws Exception {
+
+        Connection connection = getConnection();
+
+        try {
+            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
+            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
+
+            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
+            Assert.assertNotNull(user);
+
+            communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
+            communityUserDAO.deleteCommunityUserByToken(communityUser, "Token1", connection);
+
+            user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
+            Assert.assertNull(user);
+
+        } finally {
+            connection.close();
+        }
+
+    }
+
+    @Test
+    public void testGetCommunityUsers() throws Exception {
+
+        Connection connection = getConnection();
+
+        try {
+            CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
+            communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
+
+            CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce", connection);
+            Assert.assertNotNull(user);
+            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
+
+        } finally {
+            connection.close();
+        }
+
+    }
+
+    @Test
+    public void testGetCommunityUsersForGateway() throws Exception {
+
+        Connection connection = getConnection();
+
+        CommunityUser communityUser = new CommunityUser("gw1", "ogce", "ogce@sciencegateway.org");
+        communityUserDAO.addCommunityUser(communityUser, "Token1", connection);
+
+        communityUser = new CommunityUser("gw1", "ogce2", "ogce@sciencegateway.org");
+        communityUserDAO.addCommunityUser(communityUser, "Token2", connection);
+
+        List<CommunityUser> users = communityUserDAO.getCommunityUsers("gw1", connection);
+        Assert.assertNotNull(users);
+        Assert.assertEquals(2, users.size());
+
+        Assert.assertEquals(users.get(0).getUserName(), "ogce");
+        Assert.assertEquals(users.get(1).getUserName(), "ogce2");
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java
new file mode 100644
index 0000000..c175454
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/CredentialsDAOTest.java
@@ -0,0 +1,421 @@
+/*
+ *
+ * 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.credential.store.store.impl.db;
+
+import junit.framework.Assert;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.DatabaseTestCases;
+import org.apache.airavata.common.utils.DerbyUtil;
+import org.apache.airavata.common.utils.KeyStorePasswordCallback;
+import org.apache.airavata.credential.store.credential.CommunityUser;
+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.CredentialStoreException;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.net.URL;
+import java.security.*;
+import java.security.cert.X509Certificate;
+import java.sql.Connection;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Test class for credential class
+ */
+public class CredentialsDAOTest extends DatabaseTestCases {
+
+    private static final Logger logger = LoggerFactory.getLogger(CredentialsDAOTest.class);
+
+    private CredentialsDAO credentialsDAO;
+
+    private X509Certificate[] x509Certificates;
+    private PrivateKey privateKey;
+
+    @BeforeClass
+    public static void setUpDatabase() throws Exception {
+        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
+
+        waitTillServerStarts();
+
+        /*
+         * String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n" + "        GATEWAY_NAME VARCHAR(256) NOT NULL,\n" +
+         * "        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,\n" + "        CREDENTIAL BLOB NOT NULL,\n" +
+         * "        PRIVATE_KEY BLOB NOT NULL,\n" + "        NOT_BEFORE VARCHAR(256) NOT NULL,\n" +
+         * "        NOT_AFTER VARCHAR(256) NOT NULL,\n" + "        LIFETIME INTEGER NOT NULL,\n" +
+         * "        REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,\n" +
+         * "        REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',\n" +
+         * "        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)\n" + ")";
+         */
+
+        String createTable = "CREATE TABLE CREDENTIALS\n" + "(\n"
+                + "        GATEWAY_ID VARCHAR(256) NOT NULL,\n"
+                + "        TOKEN_ID VARCHAR(256) NOT NULL,\n"
+                + // Actual token used to identify the credential
+                "        CREDENTIAL BLOB NOT NULL,\n" + "        PORTAL_USER_ID VARCHAR(256) NOT NULL,\n"
+                + "        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n"
+                + "        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)\n" + ")";
+
+        String dropTable = "drop table CREDENTIALS";
+
+        try {
+            executeSQL(dropTable);
+        } catch (Exception e) {
+        }
+
+        executeSQL(createTable);
+
+    }
+
+    @AfterClass
+    public static void shutDownDatabase() throws Exception {
+        DerbyUtil.stopDerbyServer();
+    }
+
+    @Before
+    public void setUp() throws Exception {
+
+        credentialsDAO = new CredentialsDAO();
+
+        x509Certificates = new X509Certificate[1];
+
+        // Cleanup tables;
+        Connection connection = getConnection();
+
+        try {
+            DBUtil.truncate("credentials", connection);
+        } finally {
+            connection.close();
+        }
+
+        initializeKeys();
+    }
+
+    private void initializeKeys() throws Exception {
+        KeyStore ks = KeyStore.getInstance("JKS");
+        char[] password = "password".toCharArray();
+
+        String baseDirectory = System.getProperty("credential.module.directory");
+
+        String keyStorePath = "src" + File.separator + "test" + File.separator + "resources" + File.separator
+                + "keystore.jks";
+
+        if (baseDirectory != null) {
+            keyStorePath = baseDirectory + File.separator + keyStorePath;
+        } else {
+            keyStorePath = "modules" + File.separator + "credential-store" + File.separator + keyStorePath;
+        }
+
+        File keyStoreFile = new File(keyStorePath);
+        if (!keyStoreFile.exists()) {
+            logger.error("Unable to read keystore file " + keyStoreFile);
+            throw new RuntimeException("Unable to read keystore file " + keyStoreFile);
+
+        }
+
+        java.io.FileInputStream fis = null;
+        try {
+            fis = new java.io.FileInputStream(keyStorePath);
+            ks.load(fis, password);
+        } finally {
+            if (fis != null) {
+                fis.close();
+            }
+        }
+
+        fis.close();
+
+        privateKey = (PrivateKey) ks.getKey("selfsigned", password);
+        x509Certificates[0] = (X509Certificate) ks.getCertificate("selfsigned");
+
+    }
+
+    @Test
+    public void testKeyReading() throws Exception {
+        initializeKeys();
+        System.out.println(privateKey.getAlgorithm());
+        System.out.println(x509Certificates[0].getIssuerDN());
+
+        Assert.assertNotNull(privateKey);
+        Assert.assertNotNull(x509Certificates);
+    }
+
+    private CommunityUser getCommunityUser(String gateway, String name) {
+        return new CommunityUser(gateway, name, "amila@sciencegateway.org");
+    }
+
+    private void addTestCredentials() throws Exception {
+
+        Connection connection = getConnection();
+
+        try {
+            CertificateCredential certificateCredential = getTestCredentialObject();
+            credentialsDAO.addCredentials(certificateCredential.getCommunityUser().getGatewayName(),
+                    certificateCredential, connection);
+
+        } finally {
+            connection.close();
+        }
+    }
+
+    public CertificateCredential getTestCredentialObject() {
+
+        CertificateCredential certificateCredential = new CertificateCredential();
+        certificateCredential.setToken("tom");
+        certificateCredential.setCertificates(x509Certificates);
+        certificateCredential.setPrivateKey(privateKey);
+        certificateCredential.setCommunityUser(getCommunityUser("gw1", "tom"));
+        certificateCredential.setLifeTime(1000);
+        certificateCredential.setPortalUserName("jerry");
+        certificateCredential.setNotBefore("13 OCT 2012 5:34:23");
+        certificateCredential.setNotAfter("14 OCT 2012 5:34:23");
+
+        return certificateCredential;
+
+    }
+
+    @Test
+    public void testSerialization() throws CredentialStoreException {
+
+        CertificateCredential certificateCredential = getTestCredentialObject();
+
+        CredentialsDAO credentialsDAO1 = new CredentialsDAO();
+
+        byte[] array = credentialsDAO1.convertObjectToByteArray(certificateCredential);
+        CertificateCredential readCertificateCredential = (CertificateCredential) credentialsDAO1
+                .convertByteArrayToObject(array);
+
+        checkEquality(certificateCredential.getCertificates(), readCertificateCredential.getCertificates());
+        Assert.assertEquals(certificateCredential.getCertificateRequestedTime(),
+                readCertificateCredential.getCertificateRequestedTime());
+        Assert.assertEquals(certificateCredential.getCommunityUser().getGatewayName(), readCertificateCredential
+                .getCommunityUser().getGatewayName());
+        Assert.assertEquals(certificateCredential.getCommunityUser().getUserEmail(), readCertificateCredential
+                .getCommunityUser().getUserEmail());
+        Assert.assertEquals(certificateCredential.getCommunityUser().getUserName(), readCertificateCredential
+                .getCommunityUser().getUserName());
+        Assert.assertEquals(certificateCredential.getLifeTime(), readCertificateCredential.getLifeTime());
+        Assert.assertEquals(certificateCredential.getNotAfter(), readCertificateCredential.getNotAfter());
+        Assert.assertEquals(certificateCredential.getNotBefore(), readCertificateCredential.getNotBefore());
+        Assert.assertEquals(certificateCredential.getPortalUserName(), readCertificateCredential.getPortalUserName());
+
+        PrivateKey newKey = readCertificateCredential.getPrivateKey();
+
+        Assert.assertNotNull(newKey);
+        Assert.assertEquals(privateKey.getClass(), newKey.getClass());
+
+        Assert.assertEquals(privateKey.getFormat(), newKey.getFormat());
+        Assert.assertEquals(privateKey.getAlgorithm(), newKey.getAlgorithm());
+        Assert.assertTrue(Arrays.equals(privateKey.getEncoded(), newKey.getEncoded()));
+    }
+
+    @Test
+    public void testSerializationWithEncryption() throws CredentialStoreException {
+
+        URL url = this.getClass().getClassLoader().getResource("mykeystore.jks");
+        String secretKeyAlias = "mykey";
+
+        assert url != null;
+
+        CertificateCredential certificateCredential = getTestCredentialObject();
+
+        CredentialsDAO credentialsDAO1 = new CredentialsDAO(url.getPath(), secretKeyAlias,
+                new TestACSKeyStoreCallback());
+
+        byte[] array = credentialsDAO1.convertObjectToByteArray(certificateCredential);
+        CertificateCredential readCertificateCredential = (CertificateCredential) credentialsDAO1
+                .convertByteArrayToObject(array);
+
+        checkEquality(certificateCredential.getCertificates(), readCertificateCredential.getCertificates());
+        Assert.assertEquals(certificateCredential.getCertificateRequestedTime(),
+                readCertificateCredential.getCertificateRequestedTime());
+        Assert.assertEquals(certificateCredential.getCommunityUser().getGatewayName(), readCertificateCredential
+                .getCommunityUser().getGatewayName());
+        Assert.assertEquals(certificateCredential.getCommunityUser().getUserEmail(), readCertificateCredential
+                .getCommunityUser().getUserEmail());
+        Assert.assertEquals(certificateCredential.getCommunityUser().getUserName(), readCertificateCredential
+                .getCommunityUser().getUserName());
+        Assert.assertEquals(certificateCredential.getLifeTime(), readCertificateCredential.getLifeTime());
+        Assert.assertEquals(certificateCredential.getNotAfter(), readCertificateCredential.getNotAfter());
+        Assert.assertEquals(certificateCredential.getNotBefore(), readCertificateCredential.getNotBefore());
+        Assert.assertEquals(certificateCredential.getPortalUserName(), readCertificateCredential.getPortalUserName());
+
+        PrivateKey newKey = readCertificateCredential.getPrivateKey();
+
+        Assert.assertNotNull(newKey);
+        Assert.assertEquals(privateKey.getClass(), newKey.getClass());
+
+        Assert.assertEquals(privateKey.getFormat(), newKey.getFormat());
+        Assert.assertEquals(privateKey.getAlgorithm(), newKey.getAlgorithm());
+        Assert.assertTrue(Arrays.equals(privateKey.getEncoded(), newKey.getEncoded()));
+    }
+
+    private class TestACSKeyStoreCallback implements KeyStorePasswordCallback {
+
+        @Override
+        public char[] getStorePassword() {
+            return "airavata".toCharArray();
+        }
+
+        @Override
+        public char[] getSecretKeyPassPhrase(String keyAlias) {
+            if (keyAlias.equals("mykey")) {
+                return "airavatasecretkey".toCharArray();
+            }
+
+            return null;
+        }
+    }
+
+    private void checkEquality(X509Certificate[] certificates1, X509Certificate[] certificates2) {
+
+        int i = 0;
+
+        for (X509Certificate certificate : certificates1) {
+            Assert.assertEquals(certificate, certificates2[i]);
+        }
+
+        Assert.assertEquals(certificates1.length, certificates2.length);
+
+    }
+
+    @Test
+    public void testAddCredentials() throws Exception {
+
+        addTestCredentials();
+
+        Connection connection = getConnection();
+
+        try {
+            CertificateCredential certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1",
+                    "tom", connection);
+            //Test get gateway name
+            String gateway = credentialsDAO.getGatewayID("tom", connection);
+            Assert.assertNotNull(certificateCredential);
+            Assert.assertEquals("jerry", certificateCredential.getPortalUserName());
+            Assert.assertEquals("gw1", gateway);
+            checkEquality(x509Certificates, certificateCredential.getCertificates());
+            Assert.assertEquals(privateKey.getFormat(), certificateCredential.getPrivateKey().getFormat());
+        } finally {
+            connection.close();
+        }
+    }
+    
+    @Test
+    public void testDeleteCredentials() throws Exception {
+
+        addTestCredentials();
+
+        Connection connection = getConnection();
+
+        try {
+            CertificateCredential certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1",
+                    "tom", connection);
+            Assert.assertNotNull(certificateCredential);
+
+            credentialsDAO.deleteCredentials("gw1", "tom", connection);
+
+            certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1", "tom", connection);
+            Assert.assertNull(certificateCredential);
+
+        } finally {
+            connection.close();
+        }
+    }
+
+    @Test
+    public void testUpdateCredentials() throws Exception {
+
+        addTestCredentials();
+
+        Connection connection = getConnection();
+
+        try {
+            CommunityUser communityUser = getCommunityUser("gw1", "tom");
+            CertificateCredential certificateCredential = new CertificateCredential();
+            certificateCredential.setToken("tom");
+            certificateCredential.setCommunityUser(communityUser);
+            certificateCredential.setCertificates(x509Certificates);
+            // certificateCredential.setPrivateKey(privateKey);
+            certificateCredential.setPortalUserName("test2");
+            certificateCredential.setLifeTime(50);
+            certificateCredential.setNotBefore("15 OCT 2012 5:34:23");
+            certificateCredential.setNotAfter("16 OCT 2012 5:34:23");
+
+            credentialsDAO.updateCredentials(communityUser.getGatewayName(), certificateCredential, connection);
+
+            certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1", "tom", connection);
+
+            Assert.assertEquals("CN=Airavata Project, OU=IU, O=Indiana University, L=Bloomington, ST=IN, C=US",
+                    certificateCredential.getCertificates()[0].getIssuerDN().toString());
+            // Assert.assertNotNull(certificateCredential.getPrivateKey());
+            Assert.assertEquals("test2", certificateCredential.getPortalUserName());
+
+        } finally {
+            connection.close();
+        }
+
+    }
+
+    @Test
+    public void testGetCredentials() throws Exception {
+
+        addTestCredentials();
+
+        Connection connection = getConnection();
+
+        try {
+
+            CertificateCredential certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1",
+                    "tom", connection);
+            Assert.assertEquals("CN=Airavata Project, OU=IU, O=Indiana University, L=Bloomington, ST=IN, C=US",
+                    certificateCredential.getCertificates()[0].getIssuerDN().toString());
+            // Assert.assertNotNull(certificateCredential.getPrivateKey());
+
+        } finally {
+            connection.close();
+        }
+    }
+
+    @Test
+    public void testGetGatewayCredentials() throws Exception {
+
+        addTestCredentials();
+
+        Connection connection = getConnection();
+
+        try {
+            List<Credential> list = credentialsDAO.getCredentials("gw1", connection);
+
+            Assert.assertEquals(1, list.size());
+        } finally {
+            connection.close();
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java
new file mode 100644
index 0000000..7a95e3e
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/ConfigurationReaderTest.java
@@ -0,0 +1,58 @@
+/*
+ *
+ * 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.credential.store.util;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 8/25/13
+ * Time: 10:28 AM
+ */
+
+public class ConfigurationReaderTest extends TestCase {
+    public void setUp() throws Exception {
+        super.setUp();
+
+    }
+
+    public void testGetSuccessUrl() throws Exception {
+
+        ConfigurationReader configurationReader = new ConfigurationReader();
+        System.out.println(configurationReader.getSuccessUrl());
+        Assert.assertEquals("/credential-store/success.jsp", configurationReader.getSuccessUrl());
+    }
+
+    public void testGetErrorUrl() throws Exception {
+
+        ConfigurationReader configurationReader = new ConfigurationReader();
+        Assert.assertEquals("/credential-store/error.jsp", configurationReader.getErrorUrl());
+
+    }
+
+    public void testRedirectUrl() throws Exception {
+
+        ConfigurationReader configurationReader = new ConfigurationReader();
+        Assert.assertEquals("/credential-store/show-redirect.jsp", configurationReader.getPortalRedirectUrl());
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java
new file mode 100644
index 0000000..57b52ae
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/util/TokenGeneratorTest.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.credential.store.util;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+/**
+ * User: AmilaJ (amilaj@apache.org)
+ * Date: 8/5/13
+ * Time: 4:20 PM
+ */
+
+public class    TokenGeneratorTest extends TestCase {
+
+    public void testGenerateToken() throws Exception {
+
+        String token = TokenGenerator.generateToken("gw1", "admin");
+        Assert.assertNotNull(token);
+        System.out.println(token);
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/resources/credential-store/client.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/resources/credential-store/client.xml b/modules/credential-store/credential-store-service/src/test/resources/credential-store/client.xml
new file mode 100644
index 0000000..8b934e6
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/resources/credential-store/client.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--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. -->
+
+<config>
+    <client name="acs">
+        <logging
+                logFileName="../logs/oa4mp.log"
+                logName="oa4mp"
+                logSize="1000000"
+                logFileCount="2"
+                debug="true"/>
+        <id>myproxy:oa4mp,2012:/client/24c45c2eb65d93231d02d423e94d0362</id>
+        <serviceUri>https://oa4mp.xsede.org/oauth</serviceUri>
+        <callbackUri>https://localhost:8443/airavata/callback</callbackUri>
+        <lifetime>864000</lifetime>
+        <publicKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-pubkey.pem</publicKeyFile>
+        <privateKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-privkey.pk8</privateKeyFile>
+    </client>
+
+    <credential-store>
+        <successUri>/credential-store/success.jsp</successUri>
+        <errorUri>/credential-store/error.jsp</errorUri>
+        <redirectUri>/credential-store/show-redirect.jsp</redirectUri>
+    </credential-store>
+
+</config>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/resources/keystore.jks
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/resources/keystore.jks b/modules/credential-store/credential-store-service/src/test/resources/keystore.jks
new file mode 100644
index 0000000..14cf022
Binary files /dev/null and b/modules/credential-store/credential-store-service/src/test/resources/keystore.jks differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/test/resources/mykeystore.jks
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/resources/mykeystore.jks b/modules/credential-store/credential-store-service/src/test/resources/mykeystore.jks
new file mode 100644
index 0000000..335ebf8
Binary files /dev/null and b/modules/credential-store/credential-store-service/src/test/resources/mykeystore.jks differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/pom.xml b/modules/credential-store/credential-store-stubs/pom.xml
new file mode 100644
index 0000000..2a1c431
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>credential-store</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <version>0.15-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>Credential Store CPI Stubs</name>
+    <artifactId>airavata-credential-store-stubs</artifactId>
+    <packaging>jar</packaging>
+    <url>http://airavata.apache.org/</url>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+            <version>${thrift.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${org.slf4j.version}</version>
+        </dependency>
+    </dependencies>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+
+</project>
\ No newline at end of file


[47/62] [abbrv] airavata git commit: using login username inside gfac

Posted by la...@apache.org.
using login username inside gfac


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/674db3c3
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/674db3c3
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/674db3c3

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 674db3c3e7e5adb252102ea18581d4d0523d5d62
Parents: 4000b82
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Wed Mar 11 17:22:49 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Wed Mar 11 17:22:49 2015 -0400

----------------------------------------------------------------------
 .../airavata/gfac/core/context/JobExecutionContext.java |  9 +++++++++
 .../apache/airavata/gfac/core/cpi/BetterGfacImpl.java   |  4 ++++
 .../org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java | 12 +++++++++---
 3 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/674db3c3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
index c8c48ef..6a8dd5f 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
@@ -78,6 +78,7 @@ public class JobExecutionContext extends AbstractContext implements Serializable
      * User defined scratch/temp directory
      */
     private String scratchLocation;
+    private String loginUserName;
     /**
      * User defined working directory.
      */
@@ -500,4 +501,12 @@ public class JobExecutionContext extends AbstractContext implements Serializable
             return applicationContext.getApplicationDeploymentDescription().getExecutablePath();
         }
     }
+
+    public String getLoginUserName() {
+        return loginUserName;
+    }
+
+    public void setLoginUserName(String loginUserName) {
+        this.loginUserName = loginUserName;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/674db3c3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 00d313c..420df6d 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -353,6 +353,10 @@ public class BetterGfacImpl implements GFac,Watcher {
                 }
             }
 
+            if(gatewayResourcePreferences.getLoginUserName() != null){
+                jobExecutionContext.setLoginUserName(gatewayResourcePreferences.getLoginUserName());
+            }
+
             // set gatewayUserPreferred data movement protocol and interface
             jobExecutionContext.setPreferredDataMovementProtocol(gatewayResourcePreferences.getPreferredDataMovementProtocol());
             if (gatewayResourcePreferences.getPreferredJobSubmissionProtocol() == null) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/674db3c3/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 890768a..f477f62 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
@@ -110,12 +110,18 @@ public class GFACSSHUtils {
                             Properties configurationProperties = ServerSettings.getProperties();
                             tokenizedSSHAuthInfo = new DefaultPasswordAuthenticationInfo(configurationProperties.getProperty(Constants.SSH_PASSWORD));
                         }
-                        serverInfo.setUserName(credentials.getPortalUserName());
-                        jobExecutionContext.getExperiment().setUserName(credentials.getPortalUserName());
+                        // This should be the login user name from compute resource preference
+                        String loginUser = jobExecutionContext.getLoginUserName();
+                        if (loginUser == null) {
+                            loginUser = credentials.getPortalUserName();
+                        }
+                        serverInfo.setUserName(loginUser);
+                        jobExecutionContext.getExperiment().setUserName(loginUser);
+
 
                         // inside the pbsCluser object
 
-                        String key = credentials.getPortalUserName() + jobExecutionContext.getHostName() + serverInfo.getPort();
+                        String key = loginUser + jobExecutionContext.getHostName() + serverInfo.getPort();
                         boolean recreate = false;
                         synchronized (clusters) {
                             if (clusters.containsKey(key) && clusters.get(key).size() < maxClusterCount) {


[51/62] [abbrv] airavata git commit: Fixing the sample for Unicore change.AIRAVATA-1596

Posted by la...@apache.org.
Fixing the sample for Unicore change.AIRAVATA-1596 

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/757e8a3a
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/757e8a3a
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/757e8a3a

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 757e8a3abb66905b62016c0e0b5caa420c7d7bfb
Parents: a2181e4
Author: raminder <ra...@apache.org>
Authored: Fri Mar 13 13:08:13 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Fri Mar 13 13:08:13 2015 -0400

----------------------------------------------------------------------
 .../apache/airavata/client/tools/RegisterSampleApplications.java    | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/757e8a3a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index 02cf0ec..b562eb0 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -257,6 +257,7 @@ public class RegisterSampleApplications {
 		UnicoreJobSubmission ucrJobSubmission = new UnicoreJobSubmission();
 		ucrJobSubmission.setSecurityProtocol(securityProtocol);
 		ucrJobSubmission.setUnicoreEndPointURL(unicoreEndPointURL);
+		ucrJobSubmission.setAuthenticationMode(AuthenticationMode.MYPROXY_ISSUED);
 		jobSubmission.setJobSubmissionProtocol(JobSubmissionProtocol.UNICORE);
 		
 		airavataClient.addUNICOREJobSubmissionDetails(fsdResourceId, 0, ucrJobSubmission);


[04/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
new file mode 100644
index 0000000..5d9c05c
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
@@ -0,0 +1,6888 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CredentialStoreService {
+
+  public interface Iface {
+
+    /**
+     * Query CS server to fetch the CPI version
+     */
+    public String getCSServiceVersion() throws org.apache.thrift.TException;
+
+    /**
+     * This method is to add SSHCredential which will return the token Id in success
+     * 
+     * 
+     * @param sshCredential
+     */
+    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+  }
+
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
+      public Factory() {}
+      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
+        return new Client(prot);
+      }
+      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+        return new Client(iprot, oprot);
+      }
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol prot)
+    {
+      super(prot, prot);
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+      super(iprot, oprot);
+    }
+
+    public String getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      send_getCSServiceVersion();
+      return recv_getCSServiceVersion();
+    }
+
+    public void send_getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      getCSServiceVersion_args args = new getCSServiceVersion_args();
+      sendBase("getCSServiceVersion", args);
+    }
+
+    public String recv_getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      getCSServiceVersion_result result = new getCSServiceVersion_result();
+      receiveBase(result, "getCSServiceVersion");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCSServiceVersion failed: unknown result");
+    }
+
+    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_addSSHCredential(sshCredential);
+      return recv_addSSHCredential();
+    }
+
+    public void send_addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.thrift.TException
+    {
+      addSSHCredential_args args = new addSSHCredential_args();
+      args.setSshCredential(sshCredential);
+      sendBase("addSSHCredential", args);
+    }
+
+    public String recv_addSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      addSSHCredential_result result = new addSSHCredential_result();
+      receiveBase(result, "addSSHCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addSSHCredential failed: unknown result");
+    }
+
+    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_addCertificateCredential(certificateCredential);
+      return recv_addCertificateCredential();
+    }
+
+    public void send_addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.thrift.TException
+    {
+      addCertificateCredential_args args = new addCertificateCredential_args();
+      args.setCertificateCredential(certificateCredential);
+      sendBase("addCertificateCredential", args);
+    }
+
+    public String recv_addCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      addCertificateCredential_result result = new addCertificateCredential_result();
+      receiveBase(result, "addCertificateCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addCertificateCredential failed: unknown result");
+    }
+
+    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_addPasswordCredential(passwordCredential);
+      return recv_addPasswordCredential();
+    }
+
+    public void send_addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.thrift.TException
+    {
+      addPasswordCredential_args args = new addPasswordCredential_args();
+      args.setPasswordCredential(passwordCredential);
+      sendBase("addPasswordCredential", args);
+    }
+
+    public String recv_addPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      addPasswordCredential_result result = new addPasswordCredential_result();
+      receiveBase(result, "addPasswordCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addPasswordCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_getSSHCredential(tokenId, gatewayId);
+      return recv_getSSHCredential();
+    }
+
+    public void send_getSSHCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
+    {
+      getSSHCredential_args args = new getSSHCredential_args();
+      args.setTokenId(tokenId);
+      args.setGatewayId(gatewayId);
+      sendBase("getSSHCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential recv_getSSHCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      getSSHCredential_result result = new getSSHCredential_result();
+      receiveBase(result, "getSSHCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSSHCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_getCertificateCredential(tokenId, gatewayId);
+      return recv_getCertificateCredential();
+    }
+
+    public void send_getCertificateCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
+    {
+      getCertificateCredential_args args = new getCertificateCredential_args();
+      args.setTokenId(tokenId);
+      args.setGatewayId(gatewayId);
+      sendBase("getCertificateCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential recv_getCertificateCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      getCertificateCredential_result result = new getCertificateCredential_result();
+      receiveBase(result, "getCertificateCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCertificateCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      send_getPasswordCredential(tokenId, gatewayId);
+      return recv_getPasswordCredential();
+    }
+
+    public void send_getPasswordCredential(String tokenId, String gatewayId) throws org.apache.thrift.TException
+    {
+      getPasswordCredential_args args = new getPasswordCredential_args();
+      args.setTokenId(tokenId);
+      args.setGatewayId(gatewayId);
+      sendBase("getPasswordCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential recv_getPasswordCredential() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+    {
+      getPasswordCredential_result result = new getPasswordCredential_result();
+      receiveBase(result, "getPasswordCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.csException != null) {
+        throw result.csException;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPasswordCredential failed: unknown result");
+    }
+
+  }
+  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
+    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
+      private org.apache.thrift.async.TAsyncClientManager clientManager;
+      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
+      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
+        this.clientManager = clientManager;
+        this.protocolFactory = protocolFactory;
+      }
+      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
+        return new AsyncClient(protocolFactory, clientManager, transport);
+      }
+    }
+
+    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
+      super(protocolFactory, clientManager, transport);
+    }
+
+    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getCSServiceVersion_call method_call = new getCSServiceVersion_call(resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getCSServiceVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
+      public getCSServiceVersion_call(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);
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCSServiceVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getCSServiceVersion_args args = new getCSServiceVersion_args();
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getCSServiceVersion();
+      }
+    }
+
+    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addSSHCredential_call method_call = new addSSHCredential_call(sshCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential;
+      public addSSHCredential_call(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, 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.sshCredential = sshCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addSSHCredential_args args = new addSSHCredential_args();
+        args.setSshCredential(sshCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addSSHCredential();
+      }
+    }
+
+    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addCertificateCredential_call method_call = new addCertificateCredential_call(certificateCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential;
+      public addCertificateCredential_call(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, 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.certificateCredential = certificateCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addCertificateCredential_args args = new addCertificateCredential_args();
+        args.setCertificateCredential(certificateCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addCertificateCredential();
+      }
+    }
+
+    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addPasswordCredential_call method_call = new addPasswordCredential_call(passwordCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential;
+      public addPasswordCredential_call(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, 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.passwordCredential = passwordCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addPasswordCredential_args args = new addPasswordCredential_args();
+        args.setPasswordCredential(passwordCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addPasswordCredential();
+      }
+    }
+
+    public void getSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getSSHCredential_call method_call = new getSSHCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      private String gatewayId;
+      public getSSHCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
+        this.gatewayId = gatewayId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getSSHCredential_args args = new getSSHCredential_args();
+        args.setTokenId(tokenId);
+        args.setGatewayId(gatewayId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.SSHCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getSSHCredential();
+      }
+    }
+
+    public void getCertificateCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getCertificateCredential_call method_call = new getCertificateCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      private String gatewayId;
+      public getCertificateCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
+        this.gatewayId = gatewayId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getCertificateCredential_args args = new getCertificateCredential_args();
+        args.setTokenId(tokenId);
+        args.setGatewayId(gatewayId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.CertificateCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getCertificateCredential();
+      }
+    }
+
+    public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getPasswordCredential_call method_call = new getPasswordCredential_call(tokenId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      private String gatewayId;
+      public getPasswordCredential_call(String tokenId, String gatewayId, 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.tokenId = tokenId;
+        this.gatewayId = gatewayId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getPasswordCredential_args args = new getPasswordCredential_args();
+        args.setTokenId(tokenId);
+        args.setGatewayId(gatewayId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.PasswordCredential getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getPasswordCredential();
+      }
+    }
+
+  }
+
+  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+    public Processor(I iface) {
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
+    }
+
+    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
+      processMap.put("getCSServiceVersion", new getCSServiceVersion());
+      processMap.put("addSSHCredential", new addSSHCredential());
+      processMap.put("addCertificateCredential", new addCertificateCredential());
+      processMap.put("addPasswordCredential", new addPasswordCredential());
+      processMap.put("getSSHCredential", new getSSHCredential());
+      processMap.put("getCertificateCredential", new getCertificateCredential());
+      processMap.put("getPasswordCredential", new getPasswordCredential());
+      return processMap;
+    }
+
+    public static class getCSServiceVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCSServiceVersion_args> {
+      public getCSServiceVersion() {
+        super("getCSServiceVersion");
+      }
+
+      public getCSServiceVersion_args getEmptyArgsInstance() {
+        return new getCSServiceVersion_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getCSServiceVersion_result getResult(I iface, getCSServiceVersion_args args) throws org.apache.thrift.TException {
+        getCSServiceVersion_result result = new getCSServiceVersion_result();
+        result.success = iface.getCSServiceVersion();
+        return result;
+      }
+    }
+
+    public static class addSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addSSHCredential_args> {
+      public addSSHCredential() {
+        super("addSSHCredential");
+      }
+
+      public addSSHCredential_args getEmptyArgsInstance() {
+        return new addSSHCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addSSHCredential_result getResult(I iface, addSSHCredential_args args) throws org.apache.thrift.TException {
+        addSSHCredential_result result = new addSSHCredential_result();
+        try {
+          result.success = iface.addSSHCredential(args.sshCredential);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class addCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addCertificateCredential_args> {
+      public addCertificateCredential() {
+        super("addCertificateCredential");
+      }
+
+      public addCertificateCredential_args getEmptyArgsInstance() {
+        return new addCertificateCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addCertificateCredential_result getResult(I iface, addCertificateCredential_args args) throws org.apache.thrift.TException {
+        addCertificateCredential_result result = new addCertificateCredential_result();
+        try {
+          result.success = iface.addCertificateCredential(args.certificateCredential);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class addPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addPasswordCredential_args> {
+      public addPasswordCredential() {
+        super("addPasswordCredential");
+      }
+
+      public addPasswordCredential_args getEmptyArgsInstance() {
+        return new addPasswordCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addPasswordCredential_result getResult(I iface, addPasswordCredential_args args) throws org.apache.thrift.TException {
+        addPasswordCredential_result result = new addPasswordCredential_result();
+        try {
+          result.success = iface.addPasswordCredential(args.passwordCredential);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class getSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSSHCredential_args> {
+      public getSSHCredential() {
+        super("getSSHCredential");
+      }
+
+      public getSSHCredential_args getEmptyArgsInstance() {
+        return new getSSHCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getSSHCredential_result getResult(I iface, getSSHCredential_args args) throws org.apache.thrift.TException {
+        getSSHCredential_result result = new getSSHCredential_result();
+        try {
+          result.success = iface.getSSHCredential(args.tokenId, args.gatewayId);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class getCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCertificateCredential_args> {
+      public getCertificateCredential() {
+        super("getCertificateCredential");
+      }
+
+      public getCertificateCredential_args getEmptyArgsInstance() {
+        return new getCertificateCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getCertificateCredential_result getResult(I iface, getCertificateCredential_args args) throws org.apache.thrift.TException {
+        getCertificateCredential_result result = new getCertificateCredential_result();
+        try {
+          result.success = iface.getCertificateCredential(args.tokenId, args.gatewayId);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+    public static class getPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPasswordCredential_args> {
+      public getPasswordCredential() {
+        super("getPasswordCredential");
+      }
+
+      public getPasswordCredential_args getEmptyArgsInstance() {
+        return new getPasswordCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getPasswordCredential_result getResult(I iface, getPasswordCredential_args args) throws org.apache.thrift.TException {
+        getPasswordCredential_result result = new getPasswordCredential_result();
+        try {
+          result.success = iface.getPasswordCredential(args.tokenId, args.gatewayId);
+        } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+          result.csException = csException;
+        }
+        return result;
+      }
+    }
+
+  }
+
+  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
+    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
+    public AsyncProcessor(I iface) {
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
+    }
+
+    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      processMap.put("getCSServiceVersion", new getCSServiceVersion());
+      processMap.put("addSSHCredential", new addSSHCredential());
+      processMap.put("addCertificateCredential", new addCertificateCredential());
+      processMap.put("addPasswordCredential", new addPasswordCredential());
+      processMap.put("getSSHCredential", new getSSHCredential());
+      processMap.put("getCertificateCredential", new getCertificateCredential());
+      processMap.put("getPasswordCredential", new getPasswordCredential());
+      return processMap;
+    }
+
+    public static class getCSServiceVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCSServiceVersion_args, String> {
+      public getCSServiceVersion() {
+        super("getCSServiceVersion");
+      }
+
+      public getCSServiceVersion_args getEmptyArgsInstance() {
+        return new getCSServiceVersion_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            getCSServiceVersion_result result = new getCSServiceVersion_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getCSServiceVersion_result result = new getCSServiceVersion_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getCSServiceVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.getCSServiceVersion(resultHandler);
+      }
+    }
+
+    public static class addSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addSSHCredential_args, String> {
+      public addSSHCredential() {
+        super("addSSHCredential");
+      }
+
+      public addSSHCredential_args getEmptyArgsInstance() {
+        return new addSSHCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addSSHCredential_result result = new addSSHCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addSSHCredential_result result = new addSSHCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addSSHCredential(args.sshCredential,resultHandler);
+      }
+    }
+
+    public static class addCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addCertificateCredential_args, String> {
+      public addCertificateCredential() {
+        super("addCertificateCredential");
+      }
+
+      public addCertificateCredential_args getEmptyArgsInstance() {
+        return new addCertificateCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addCertificateCredential_result result = new addCertificateCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addCertificateCredential_result result = new addCertificateCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addCertificateCredential(args.certificateCredential,resultHandler);
+      }
+    }
+
+    public static class addPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addPasswordCredential_args, String> {
+      public addPasswordCredential() {
+        super("addPasswordCredential");
+      }
+
+      public addPasswordCredential_args getEmptyArgsInstance() {
+        return new addPasswordCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addPasswordCredential_result result = new addPasswordCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addPasswordCredential_result result = new addPasswordCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addPasswordCredential(args.passwordCredential,resultHandler);
+      }
+    }
+
+    public static class getSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSSHCredential_args, org.apache.airavata.credential.store.datamodel.SSHCredential> {
+      public getSSHCredential() {
+        super("getSSHCredential");
+      }
+
+      public getSSHCredential_args getEmptyArgsInstance() {
+        return new getSSHCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.SSHCredential o) {
+            getSSHCredential_result result = new getSSHCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getSSHCredential_result result = new getSSHCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> resultHandler) throws TException {
+        iface.getSSHCredential(args.tokenId, args.gatewayId,resultHandler);
+      }
+    }
+
+    public static class getCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCertificateCredential_args, org.apache.airavata.credential.store.datamodel.CertificateCredential> {
+      public getCertificateCredential() {
+        super("getCertificateCredential");
+      }
+
+      public getCertificateCredential_args getEmptyArgsInstance() {
+        return new getCertificateCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.CertificateCredential o) {
+            getCertificateCredential_result result = new getCertificateCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getCertificateCredential_result result = new getCertificateCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> resultHandler) throws TException {
+        iface.getCertificateCredential(args.tokenId, args.gatewayId,resultHandler);
+      }
+    }
+
+    public static class getPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPasswordCredential_args, org.apache.airavata.credential.store.datamodel.PasswordCredential> {
+      public getPasswordCredential() {
+        super("getPasswordCredential");
+      }
+
+      public getPasswordCredential_args getEmptyArgsInstance() {
+        return new getPasswordCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.PasswordCredential o) {
+            getPasswordCredential_result result = new getPasswordCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getPasswordCredential_result result = new getPasswordCredential_result();
+            if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+                        result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+                        result.setCsExceptionIsSet(true);
+                        msg = result;
+            }
+             else 
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> resultHandler) throws TException {
+        iface.getPasswordCredential(args.tokenId, args.gatewayId,resultHandler);
+      }
+    }
+
+  }
+
+  public static class getCSServiceVersion_args implements org.apache.thrift.TBase<getCSServiceVersion_args, getCSServiceVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_args");
+
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getCSServiceVersion_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getCSServiceVersion_argsTupleSchemeFactory());
+    }
+
+
+    /** 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 {
+;
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_args.class, metaDataMap);
+    }
+
+    public getCSServiceVersion_args() {
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getCSServiceVersion_args(getCSServiceVersion_args other) {
+    }
+
+    public getCSServiceVersion_args deepCopy() {
+      return new getCSServiceVersion_args(this);
+    }
+
+    @Override
+    public void clear() {
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getCSServiceVersion_args)
+        return this.equals((getCSServiceVersion_args)that);
+      return false;
+    }
+
+    public boolean equals(getCSServiceVersion_args that) {
+      if (that == null)
+        return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getCSServiceVersion_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getCSServiceVersion_args(");
+      boolean first = true;
+
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getCSServiceVersion_argsStandardSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_argsStandardScheme getScheme() {
+        return new getCSServiceVersion_argsStandardScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_argsStandardScheme extends StandardScheme<getCSServiceVersion_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getCSServiceVersion_argsTupleSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_argsTupleScheme getScheme() {
+        return new getCSServiceVersion_argsTupleScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_argsTupleScheme extends TupleScheme<getCSServiceVersion_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+      }
+    }
+
+  }
+
+  public static class getCSServiceVersion_result implements org.apache.thrift.TBase<getCSServiceVersion_result, getCSServiceVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getCSServiceVersion_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getCSServiceVersion_resultTupleSchemeFactory());
+    }
+
+    public String success; // 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 {
+      SUCCESS((short)0, "success");
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_result.class, metaDataMap);
+    }
+
+    public getCSServiceVersion_result() {
+    }
+
+    public getCSServiceVersion_result(
+      String success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getCSServiceVersion_result(getCSServiceVersion_result other) {
+      if (other.isSetSuccess()) {
+        this.success = other.success;
+      }
+    }
+
+    public getCSServiceVersion_result deepCopy() {
+      return new getCSServiceVersion_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public String getSuccess() {
+      return this.success;
+    }
+
+    public getCSServiceVersion_result setSuccess(String success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getCSServiceVersion_result)
+        return this.equals((getCSServiceVersion_result)that);
+      return false;
+    }
+
+    public boolean equals(getCSServiceVersion_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getCSServiceVersion_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getCSServiceVersion_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getCSServiceVersion_resultStandardSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_resultStandardScheme getScheme() {
+        return new getCSServiceVersion_resultStandardScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_resultStandardScheme extends StandardScheme<getCSServiceVersion_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.success = iprot.readString();
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          oprot.writeString(struct.success);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getCSServiceVersion_resultTupleSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_resultTupleScheme getScheme() {
+        return new getCSServiceVersion_resultTupleScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_resultTupleScheme extends TupleScheme<getCSServiceVersion_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          oprot.writeString(struct.success);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.success = iprot.readString();
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class addSSHCredential_args implements org.apache.thrift.TBase<addSSHCredential_args, addSSHCredential_args._Fields>, java.io.Serializable, Cloneable, Comparable<addSSHCredential_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSSHCredential_args");
+
+    private static final org.apache.thrift.protocol.TField SSH_CREDENTIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("sshCredential", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new addSSHCredential_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new addSSHCredential_argsTupleSchemeFactory());
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential; // 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 {
+      SSH_CREDENTIAL((short)1, "sshCredential");
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 1: // SSH_CREDENTIAL
+            return SSH_CREDENTIAL;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SSH_CREDENTIAL, new org.apache.thrift.meta_data.FieldMetaData("sshCredential", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.credential.store.datamodel.SSHCredential.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addSSHCredential_args.class, metaDataMap);
+    }
+
+    public addSSHCredential_args() {
+    }
+
+    public addSSHCredential_args(
+      org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential)
+    {
+      this();
+      this.sshCredential = sshCredential;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public addSSHCredential_args(addSSHCredential_args other) {
+      if (other.isSetSshCredential()) {
+        this.sshCredential = new org.apache.airavata.credential.store.datamodel.SSHCredential(other.sshCredential);
+      }
+    }
+
+    public addSSHCredential_args deepCopy() {
+      return new addSSHCredential_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.sshCredential = null;
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSshCredential() {
+      return this.sshCredential;
+    }
+
+    public addSSHCredential_args setSshCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) {
+      this.sshCredential = sshCredential;
+      return this;
+    }
+
+    public void unsetSshCredential() {
+      this.sshCredential = null;
+    }
+
+    /** Returns true if field sshCredential is set (has been assigned a value) and false otherwise */
+    public boolean isSetSshCredential() {
+      return this.sshCredential != null;
+    }
+
+    public void setSshCredentialIsSet(boolean value) {
+      if (!value) {
+        this.sshCredential = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SSH_CREDENTIAL:
+        if (value == null) {
+          unsetSshCredential();
+        } else {
+          setSshCredential((org.apache.airavata.credential.store.datamodel.SSHCredential)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SSH_CREDENTIAL:
+        return getSshCredential();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SSH_CREDENTIAL:
+        return isSetSshCredential();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof addSSHCredential_args)
+        return this.equals((addSSHCredential_args)that);
+      return false;
+    }
+
+    public boolean equals(addSSHCredential_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_sshCredential = true && this.isSetSshCredential();
+      boolean that_present_sshCredential = true && that.isSetSshCredential();
+      if (this_present_sshCredential || that_present_sshCredential) {
+        if (!(this_present_sshCredential && that_present_sshCredential))
+          return false;
+        if (!this.sshCredential.equals(that.sshCredential))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(addSSHCredential_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSshCredential()).compareTo(other.isSetSshCredential());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSshCredential()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sshCredential, other.sshCredential);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("addSSHCredential_args(");
+      boolean first = true;
+
+      sb.append("sshCredential:");
+      if (this.sshCredential == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.sshCredential);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (sshCredential == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'sshCredential' was not present! Struct: " + toString());
+      }
+      // check for sub-struct validity
+      if (sshCredential != null) {
+        sshCredential.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void 

<TRUNCATED>

[57/62] [abbrv] airavata git commit: Fixing. AIRAVATA-1631

Posted by la...@apache.org.
Fixing. AIRAVATA-1631

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/5749f124
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/5749f124
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/5749f124

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 5749f124e15a3704c4815f9e00e5fad90481a76d
Parents: be1c6a0
Author: raminder <ra...@apache.org>
Authored: Mon Mar 16 14:46:50 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Mon Mar 16 14:46:50 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/5749f124/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index cc8a899..5dcea2e 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -395,7 +395,7 @@ public class BetterGfacImpl implements GFac,Watcher {
                 	if(objectType.getLocation().startsWith(File.separator)){
                 		filePath = objectType.getLocation() + File.separator + filePath;
                     }else{
-                    	filePath = jobExecutionContext.getOutputDir() + File.separator + objectType.getLocation()+ filePath;
+                    	filePath = jobExecutionContext.getOutputDir() + File.separator + objectType.getLocation() + File.separator + filePath;
                     }
                 }
                 objectType.setValue(filePath);


[16/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/acs.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/acs.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/acs.jsp
deleted file mode 100644
index 94bc6d9..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/acs.jsp
+++ /dev/null
@@ -1,62 +0,0 @@
-<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
-<%--
-  Created by IntelliJ IDEA.
-  User: thejaka
-  Date: 8/5/13
-  Time: 4:48 PM
-  To change this template use File | Settings | File Templates.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%--
-  ~ 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.
-  --%>
-
-
-<html>
-<body>
-
-<table width="100%" border="0">
-    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
-</table>
-
-<h2>Sample Gateway</h2>
-
-
-
-<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
-<form name="input" action="https://localhost:8443/airavata/acs-start-servlet" method="post">
-
-    <table border="0">
-        <tr>
-            <td>Gateway Name</td>
-            <td><input type="text" name="gatewayName" value="default" readonly="readonly"></td>
-        </tr>
-        <tr>
-            <td>Portal Username</td>
-            <td><input type="text" name="portalUserName"></td>
-        </tr>
-        <tr>
-            <td>Contact Email</td>
-            <td><input type="text" name="email"></td>
-        </tr>
-    </table>
-
-    <input type="submit" value="Submit">
-</form>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/callback.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/callback.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/callback.jsp
deleted file mode 100644
index 560f64f..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/callback.jsp
+++ /dev/null
@@ -1,78 +0,0 @@
-<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
-<%--
-  Created by IntelliJ IDEA.
-  User: thejaka
-  Date: 8/5/13
-  Time: 4:48 PM
-  To change this template use File | Settings | File Templates.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%--
-  ~ 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.
-  --%>
-
-<%
-    SampleGateway sampleGateway = (SampleGateway)session.getAttribute(SampleGateway.GATEWAY_SESSION);
-
-    boolean success = false;
-
-    String tokenId = request.getParameter("tokenId");
-
-    if (tokenId != null) {
-        sampleGateway.updateTokenId(tokenId);
-        success = true;
-    }
-%>
-
-<html>
-<body>
-
-<table width="100%" border="0">
-    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
-</table>
-
-<h2>Sample Gateway</h2>
-<%
-    out.println("The received token id - ");
-    out.println(tokenId);
-
-    if (success) {
-%>
-<p>Token id successfully updated.</p>
-
-<p>
-    View users who obtained token id.
-<ol>
-    <li><a href="list_users.jsp">List Users</a></li>
-</ol>
-</p>
-
-<%
-    } else {
-
-%>
-<p> Error updating token id.</p>
-<%
-
-    }
-
-%>
-
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/list_users.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/list_users.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/list_users.jsp
deleted file mode 100644
index 36883b7..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/list_users.jsp
+++ /dev/null
@@ -1,78 +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.
-  --%>
-
-<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.apache.airavata.sample.gateway.userstore.User" %>
-<%--
-  Created by IntelliJ IDEA.
-  User: thejaka
-  Date: 8/5/13
-  Time: 12:30 PM
-  To change this template use File | Settings | File Templates.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    SampleGateway sampleGateway = (SampleGateway)session.getAttribute(SampleGateway.GATEWAY_SESSION);
-%>
-
-<html>
-<head>
-    <title>List Users</title>
-</head>
-<body>
-
-<table width="100%" border="0">
-    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
-</table>
-
-<h1>Sample Gateway</h1>
-
-
-<p> This page lists all users and their attributes. </p>
-
-<table>
-    <tr>
-        <td>UserName</td>
-        <td>E-Mail</td>
-        <td>TokenId</td>
-    </tr>
-<%
-    List<User> userList = sampleGateway.getAllUsers();
-    for (User u : userList) {
-%>
-    <tr>
-        <td>
-            <%=u.getUserName() %>
-        </td>
-        <td>
-            <%=u.getEmail() %>
-        </td>
-        <td>
-            <%=u.getToken() %>
-        </td>
-
-    </tr>
-    <%
-        }
-    %>
-</table>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/logout.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/logout.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/logout.jsp
deleted file mode 100644
index 63d90be..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/logout.jsp
+++ /dev/null
@@ -1,35 +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.
-  --%>
-<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %><%
-    session.removeAttribute("userName");
-    session.removeAttribute(SampleGateway.GATEWAY_SESSION);
-    session.invalidate();
-%>
-
-<html>
-<head>
-    <script language=javascript>
-        function redirect(){
-            window.location = "../index.jsp";
-        }
-    </script>
-</head>
-<body onload="redirect()">
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/user.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/user.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/user.jsp
deleted file mode 100644
index 1fd1957..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/gateway/user.jsp
+++ /dev/null
@@ -1,102 +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.
-  --%>
-
-<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
-<%--
-  Created by IntelliJ IDEA.
-  User: thejaka
-  Date: 7/31/13
-  Time: 5:08 PM
-  To change this template use File | Settings | File Templates.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    String loginScreen = request.getParameter("loginScreen");
-
-    String user = (String)session.getAttribute("userName");
-    boolean authenticate = false;
-
-    if (loginScreen != null && loginScreen.equals("true")) {
-        SampleGateway sampleGateway = null;
-        sampleGateway = (SampleGateway) session.getAttribute(SampleGateway.GATEWAY_SESSION);
-
-        if (sampleGateway == null) {
-            sampleGateway = new SampleGateway(session.getServletContext());
-        }
-
-        session.setAttribute(SampleGateway.GATEWAY_SESSION, sampleGateway);
-
-        user = request.getParameter("username");
-        String password = request.getParameter("password");
-
-        authenticate = sampleGateway.authenticate(user, password);
-    } else {
-        authenticate = true;
-    }
-
-%>
-<html>
-
-<head>
-    <title>Manage</title>
-</head>
-<body>
-
-<table width="100%" border="0">
-    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
-</table>
-
-<h1>Sample Gateway</h1>
-
-<%
-    if (authenticate) {
-
-        session.setAttribute("userName", user);
-
-        if (SampleGateway.isAdmin(user)) {
-%>
-<h1>Administration</h1>
-<p>
-    This page allows administration functionality.
-<ol>
-    <li><a href="acs.jsp">Retrieve Credentials</a></li>
-    <li><a href="list_users.jsp">List Users</a></li>
-</ol>
-</p>
-
-
-<%
-     } else {
-%>
-
-<p> You are a normal user. Click <a href="job.jsp">here</a> to configure and run "Echo" workflow on a GRID machine.</p>
-
-<%
-     }
-    } else {
-%>
-
-<h1>Authentication failed</h1>
-
-<%
-    }
-%>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png b/modules/credential-store-service/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png
deleted file mode 100644
index 4baf51b..0000000
Binary files a/modules/credential-store-service/credential-store-webapp/src/main/webapp/images/airavata-logo-2.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/index.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/index.jsp
deleted file mode 100644
index 1bf0ed6..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/index.jsp
+++ /dev/null
@@ -1,26 +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.
---%>
-
-<html>
-<body>
-<img src="images/airavata-logo-2.png">
-<h2>Airavata Credential Store</h2>
-<p>Welcome to Airavata Credential Store Web Application</p>
-
-<p><a href="user-store/add.jsp"><b>Manage Local User Store</b></a></p>
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/add.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/add.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/add.jsp
deleted file mode 100644
index f37684d..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/add.jsp
+++ /dev/null
@@ -1,142 +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.
---%>
-<%@ page import="org.apache.airavata.credentialstore.local.LocalUserStore" %>
-
-<html>
-
-<head>
-    <script language="javascript" type="text/javascript">
-        function validatePassword(fld1name, regString) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-            if(regString != "null" && !stringValue.match(new RegExp(regString))){
-                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
-                        "characters.";
-                return errorMessage;
-            }else if(regString != "null" && stringValue == ''){
-                return errorMessage;
-            }
-
-            if (stringValue == '') {
-                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function validateUsername(fld1name) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue == '') {
-                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function checkPasswordsMatching(fld1name, fld2name) {
-
-            var stringValue1 = document.getElementsByName(fld1name)[0].value;
-            var stringValue2 = document.getElementsByName(fld2name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue1 != stringValue2) {
-                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-
-        }
-
-        function validate() {
-            var reason = "";
-
-            reason = validateUsername("username");
-
-            if (reason != "") {
-                alert(reason);
-                return false;
-            }
-
-            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                return false;
-            }
-
-            reason = checkPasswordsMatching("newPassword", "confirmPassword");
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                document.getElementsByName("confirmPassword")[0].clear();
-                return false;
-            }
-
-            return true;
-        }
-
-        function doProcess() {
-            if (validate() == true) {
-                document.registration.submit();
-            }
-        }
-
-
-    </script>
-</head>
-
-<body>
-<img src="../images/airavata-logo-2.png">
-<h2>Airavata Credential Store - Local User Store</h2>
-<p><b>Manage Local User Store - Add New User</b></p>
-
-<form action="index.jsp" name="registration" method="POST">
-
-    <input type="hidden" name="operation" value="addUser">
-    <table>
-        <tr>
-            <td>User Name</td>
-            <td><input type="text" name="username" maxlength="150"></td>
-        </tr>
-        <tr>
-            <td>Password</td>
-            <td><input type="password" name="newPassword"/></td>
-        </tr>
-        <tr>
-            <td>Re-Type Password</td>
-            <td><input type="password" name="confirmPassword"/></td>
-        </tr>
-    </table>
-
-    <table>
-        <tr>
-            <td><input type="button" value="Add" onclick= 'doProcess()'></td>
-            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
-        </tr>
-    </table>
-
-</form>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/index.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/index.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/index.jsp
deleted file mode 100644
index 732c0c7..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/index.jsp
+++ /dev/null
@@ -1,138 +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.
---%>
-
-<%@ page import = "org.apache.airavata.credentialstore.local.LocalUserStore" %>
-<%@ page import="org.apache.airavata.credentialstore.basic.BasicAccessAuthenticator" %>
-<%@ page import="org.apache.airavata.credentialstore.session.HttpAuthenticatorFilter" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.apache.airavata.common.utils.Constants" %>
-<%
-
-    LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
-
-    if (localUserStore == null) {
-
-        String operatingUser = (String) session.getAttribute(Constants.USER_IN_SESSION);
-
-        if (operatingUser == null || !operatingUser.equals("admin")) {
-            HttpAuthenticatorFilter.sendUnauthorisedError(response, "Insufficient privileges to perform user operations." +
-                    " Only admin user is allowed to perform user operations.");
-
-            return;
-        }
-
-        localUserStore = new LocalUserStore(application);
-
-        session.setAttribute("LocalUserStore", localUserStore);
-    }
-
-    String operation = request.getParameter("operation");
-    if (operation != null) {
-        if (operation.equals("addUser")) {
-            String userName = request.getParameter("username");
-            String password = request.getParameter("newPassword");
-
-            localUserStore.addUser(userName, password);
-        } else if (operation.equals("deleteUser")) {
-            String[] usersToDelete = request.getParameterValues("user-id");
-
-            for (String deleteUser : usersToDelete) {
-                localUserStore.deleteUser(deleteUser);
-            }
-        }
-    }
-
-    List<String> allUsers = localUserStore.getUsers();
-
-%>
-
-<html>
-<head>
-    <script language="javascript" type="text/javascript">
-
-        function validate() {
-            var checkSelected = false;
-            for (var i = 0; i < <%=allUsers.size()%>; i++) {
-                if (document.main["user-id"][i].checked) {
-                    checkSelected = true;
-                }
-            }
-            if (checkSelected) {
-                var answer = confirm("Are you sure you want to delete selected users from the system ?");
-                if (answer) {
-                    return true;
-                }
-            } else {
-                alert("Select at least one user to delete.");
-            }
-            return false;
-        }
-
-        function doProcess() {
-            if (validate() == true) {
-                document.main.submit();
-            }
-        }
-
-    </script>
-</head>
-<body>
-<img src="../images/airavata-logo-2.png">
-<h2>Airavata REST API - Local User Store</h2>
-<p><b>Manage Local User Store</b></p>
-
-
-<form action="index.jsp" name="main" method="POST">
-    <table>
-        <tr>
-            <td>&nbsp;</td>
-            <td>All Users</td>
-        </tr>
-        <%
-            for (String user : allUsers) {
-        %>
-
-        <tr>
-            <td><input type="checkbox" name="user-id" value="<%=user%>"></td>
-            <td><%=user%>
-            </td>
-            <td><a href="password.jsp?username=<%=user%>">Change Password</a></td>
-        </tr>
-
-        <%
-            }
-        %>
-    </table>
-
-    <br>
-
-    <table width="100">
-        <tr>
-            <td>
-                <a href="add.jsp"><input type="button" value="Add" name="Add"/></a>
-            </td>
-            <td>&nbsp;</td>
-            <input type="hidden" name="operation" value="deleteUser">
-            <td><input type="button" value="Delete" onclick="doProcess()"></td>
-        </tr>
-    </table>
-
-</form>
-
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/password.jsp
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/password.jsp b/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/password.jsp
deleted file mode 100644
index 9a316ee..0000000
--- a/modules/credential-store-service/credential-store-webapp/src/main/webapp/user-store/password.jsp
+++ /dev/null
@@ -1,157 +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.
---%>
-
-<%@ page import="org.apache.airavata.credentialstore.local.LocalUserStore" %>
-
-<%
-    String userName = request.getParameter("username");
-    if (userName == null) {
-        response.sendRedirect("index.jsp");
-    }
-
-    String password = request.getParameter("newPassword");
-    String confirmPassword = request.getParameter("confirmPassword");
-
-    if (password != null && confirmPassword != null && password.equals(confirmPassword)) {
-        LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
-        localUserStore.changePasswordByAdmin(userName, password);
-
-        response.sendRedirect("password.jsp?message=\"Password successfully change for user "
-                + userName + "\"&username=" + userName);
-    }
-
-%>
-
-<html>
-<head>
-    <script language="javascript" type="text/javascript">
-        function validatePassword(fld1name, regString) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-            if(regString != "null" && !stringValue.match(new RegExp(regString))){
-                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
-                        "characters.";
-                return errorMessage;
-            }else if(regString != "null" && stringValue == ''){
-                return errorMessage;
-            }
-
-            if (stringValue == '') {
-                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function validateUsername(fld1name) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue == '') {
-                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function checkPasswordsMatching(fld1name, fld2name) {
-
-            var stringValue1 = document.getElementsByName(fld1name)[0].value;
-            var stringValue2 = document.getElementsByName(fld2name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue1 != stringValue2) {
-                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-
-        }
-
-        function validate() {
-            var reason = "";
-
-            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                return false;
-            }
-
-            reason = checkPasswordsMatching("newPassword", "confirmPassword");
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                document.getElementsByName("confirmPassword")[0].clear();
-                return false;
-            }
-
-            return true;
-        }
-
-        function doProcess() {
-            if (validate() == true) {
-                document.passwordForm.submit();
-            }
-        }
-
-        function displayMessage() {
-            var msg = <%=request.getParameter("message")%>;
-            if (msg != null) {
-                alert(msg);
-            }
-        }
-
-
-    </script>
-</head>
-
-<body onload="displayMessage()">
-<img src="../images/airavata-logo-2.png">
-<h2>Airavata REST API - Local User Store</h2>
-<p><b>Manage Local User Store - Change Password of user - <%=userName%></b></p>
-
-<form action="password.jsp" name="passwordForm" method="POST">
-
-    <input type="hidden" name="username" value="<%=userName%>">
-    <table>
-        <tr>
-            <td>New Password</td>
-            <td><input type="password" name="newPassword"/></td>
-        </tr>
-        <tr>
-            <td>Re-Type Password</td>
-            <td><input type="password" name="confirmPassword"/></td>
-        </tr>
-    </table>
-
-    <table>
-        <tr>
-            <td><input type="button" value="Change" onclick= 'doProcess()'></td>
-            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
-        </tr>
-    </table>
-
-</form>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/pom.xml b/modules/credential-store-service/credential-store/pom.xml
deleted file mode 100644
index d8af25f..0000000
--- a/modules/credential-store-service/credential-store/pom.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--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. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<groupId>org.apache.airavata</groupId>
-		<artifactId>airavata</artifactId>
-		<version>0.15-SNAPSHOT</version>
-		<relativePath>../../../pom.xml</relativePath>
-	</parent>
-
-	<modelVersion>4.0.0</modelVersion>
-	<artifactId>airavata-credential-store</artifactId>
-	<name>Airavata Credential Store</name>
-	<description>Module to manage credentials</description>
-
-	<dependencies>
-		<dependency>
-			<groupId>edu.uiuc.ncsa.myproxy</groupId>
-			<artifactId>oa4mp-client-api</artifactId>
-			<version>${oa4mp.version}</version>
-		</dependency>
-		<dependency>
-            <groupId>edu.uiuc.ncsa.myproxy</groupId>
-            <artifactId>oa4mp-client-loader-oauth1</artifactId>
-            <version>${oa4mp.version}</version>
-            <exclusions>
-        	<exclusion>
-          		<groupId>net.oauth.core</groupId> 
-          		<artifactId>oauth-httpclient4</artifactId>
-        	</exclusion>
-			<exclusion>
-				<groupId>net.oauth.core</groupId>
-				<artifactId>oauth-consumer</artifactId>
-			</exclusion>
-			<exclusion>
-				<groupId>mysql</groupId>
-				<artifactId>mysql-connector-java</artifactId>
-			</exclusion>
-			<exclusion>
-				<groupId>postgresql</groupId>
-				<artifactId>postgresql</artifactId>
-			</exclusion>
-            </exclusions>
-        </dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.7</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derby</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbyclient</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbynet</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbytools</artifactId>
-			<version>${derby.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>commons-dbcp</groupId>
-			<artifactId>commons-dbcp</artifactId>
-			<version>1.4</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-common-utils</artifactId>
-			<version>${project.version}</version>
-		</dependency> 
-		<dependency>
-			<groupId>com.jcraft</groupId>
-			<artifactId>jsch</artifactId>
-			<version>0.1.50</version>
-		</dependency>
-		<dependency>
-			<groupId>javax.servlet</groupId>
-			<artifactId>servlet-api</artifactId>
-			<version>2.5</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-email</artifactId>
-			<version>1.3.2</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>1.3.2</version>
-		</dependency>
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<version>${surefire.version}</version>
-				<inherited>true</inherited>
-				<configuration>
-					<systemPropertyVariables>
-						<credential.module.directory>${basedir}</credential.module.directory>
-					</systemPropertyVariables>
-					<excludes>
-						<exclude>**/DAOBaseTestCase.java</exclude>
-						<exclude>**/MappingDAOTest.java</exclude>
-					</excludes>
-					<testSourceDirectory>${basedir}\src\test\java\</testSourceDirectory>
-				</configuration>
-			</plugin>
-
-		</plugins>
-		<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
-		<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
-		<testResources>
-			<testResource>
-				<directory>${project.basedir}/src/test/resources</directory>
-			</testResource>
-		</testResources>
-	</build>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/scripts/credential-store-h2.sql
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/scripts/credential-store-h2.sql b/modules/credential-store-service/credential-store/scripts/credential-store-h2.sql
deleted file mode 100644
index 91915b6..0000000
--- a/modules/credential-store-service/credential-store/scripts/credential-store-h2.sql
+++ /dev/null
@@ -1,42 +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.
- *
- */
-CREATE TABLE COMMUNITY_USER
-(
-	GATEWAY_NAME VARCHAR(256) NOT NULL,
-	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-	COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
-        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
-);
-
-
-CREATE TABLE CREDENTIALS
-(
-	GATEWAY_NAME VARCHAR(256) NOT NULL,
-	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-	CREDENTIAL CLOB NOT NULL,
-	PRIVATE_KEY CLOB NOT NULL,
-	NOT_BEFORE VARCHAR(256) NOT NULL,
-	NOT_AFTER VARCHAR(256) NOT NULL,
-	LIFETIME MEDIUMINT NOT NULL,
-	REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,
-	REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/scripts/credential-store-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/scripts/credential-store-mysql.sql b/modules/credential-store-service/credential-store/scripts/credential-store-mysql.sql
deleted file mode 100644
index 50d5e0f..0000000
--- a/modules/credential-store-service/credential-store/scripts/credential-store-mysql.sql
+++ /dev/null
@@ -1,42 +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.
- *
- */
-CREATE TABLE COMMUNITY_USER
-(
-	GATEWAY_NAME VARCHAR(256) NOT NULL,
-	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-	COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
-        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
-);
-
-
-CREATE TABLE CREDENTIALS
-(
-	GATEWAY_NAME VARCHAR(256) NOT NULL,
-	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-	CREDENTIAL TEXT NOT NULL,
-	PRIVATE_KEY TEXT NOT NULL,
-	NOT_BEFORE VARCHAR(256) NOT NULL,
-	NOT_AFTER VARCHAR(256) NOT NULL,
-	LIFETIME MEDIUMINT NOT NULL,
-	REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,
-	REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-    PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
-);

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
deleted file mode 100644
index 12105e2..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
+++ /dev/null
@@ -1,140 +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.credential.store.client;
-
-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.ServerSettings;
-import org.apache.airavata.credential.store.cpi.CredentialStoreService;
-import org.apache.airavata.credential.store.datamodel.CertificateCredential;
-import org.apache.airavata.credential.store.datamodel.CommunityUser;
-import org.apache.airavata.credential.store.datamodel.SSHCredential;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TSSLTransportFactory;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import org.apache.commons.codec.binary.Base64;
-
-public class TestSSLClient {
-    private void invoke() {
-        TTransport transport;
-        try {
-            AiravataUtils.setExecutionAsServer();
-            TSSLTransportFactory.TSSLTransportParameters params =
-                    new TSSLTransportFactory.TSSLTransportParameters();
-            String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
-            String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
-            params.setTrustStore(keystorePath, keystorePWD);
-            final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_PORT, "8960"));
-            final String serverHost = ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_HOST, null);
-
-            transport = TSSLTransportFactory.getClientSocket(serverHost, serverPort, 10000, params);
-            TProtocol protocol = new TBinaryProtocol(transport);
-
-            CredentialStoreService.Client client = new CredentialStoreService.Client(protocol);
-//            testSSHCredential(client);
-            testCertificateCredential(client);
-            transport.close();
-        } catch (TTransportException e) {
-            e.printStackTrace();
-        }catch (ApplicationSettingsException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void testSSHCredential (CredentialStoreService.Client client){
-        try {
-            SSHCredential sshCredential = new SSHCredential();
-            sshCredential.setUsername("test");
-            sshCredential.setGatewayId("testGateway");
-            sshCredential.setPassphrase("mypassphrase");
-            String token = client.addSSHCredential(sshCredential);
-            System.out.println("SSH Token :" + token);
-            SSHCredential credential = client.getSSHCredential(token, "testGateway");
-            System.out.println("private key : " + credential.getPrivateKey());
-            System.out.println("public key : " + credential.getPublicKey());
-        }catch (TTransportException e) {
-            e.printStackTrace();
-        } catch (TException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void testCertificateCredential (CredentialStoreService.Client client){
-        try {
-            CertificateCredential certificateCredential = new CertificateCredential();
-            CommunityUser communityUser = new CommunityUser("testGateway", "test", "test@ddsd");
-            certificateCredential.setCommunityUser(communityUser);
-            X509Certificate[] x509Certificates = new X509Certificate[1];
-            KeyStore ks = KeyStore.getInstance("JKS");
-            File keyStoreFile = new File("/Users/chathuri/dev/airavata/credential-store/oa4mp/airavata.jks");
-            FileInputStream fis = new FileInputStream(keyStoreFile);
-            char[] password = "airavata".toCharArray();
-            ks.load(fis,password);
-            x509Certificates[0] = (X509Certificate) ks.getCertificate("airavata");
-            Base64 encoder = new Base64(64);
-            String cert_begin = "-----BEGIN CERTIFICATE-----\n";
-            String end_cert = "-----END CERTIFICATE-----";
-            byte[] derCert = x509Certificates[0].getEncoded();
-            String pemCertPre = new String(encoder.encode(derCert));
-            String pemCert = cert_begin + pemCertPre + end_cert;
-            certificateCredential.setX509Cert(pemCert);
-            String token = client.addCertificateCredential(certificateCredential);
-            System.out.println("Certificate Token :" + token);
-            CertificateCredential credential = client.getCertificateCredential(token, "testGateway");
-            System.out.println("certificate : " + credential.getX509Cert());
-            System.out.println("gateway name  : " + credential.getCommunityUser().getGatewayNmae());
-        }catch (TTransportException e) {
-            e.printStackTrace();
-        } catch (TException e) {
-            e.printStackTrace();
-        } catch (KeyStoreException e) {
-            e.printStackTrace();
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-        } catch (CertificateException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void main(String[] args) {
-        TestSSLClient c = new TestSSLClient();
-        c.invoke();
-
-    }
-}


[28/62] [abbrv] airavata git commit: Moving credential store client to stubs module.

Posted by la...@apache.org.
Moving credential store client to stubs module.


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/8c84eeed
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/8c84eeed
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/8c84eeed

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 8c84eeedca003783f167437edfbd4a812e27d70f
Parents: 52f1e75
Author: Suresh Marru <sm...@apache.org>
Authored: Fri Mar 6 14:22:44 2015 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Fri Mar 6 14:22:44 2015 -0500

----------------------------------------------------------------------
 modules/credential-store/credential-store-stubs/pom.xml | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/8c84eeed/modules/credential-store/credential-store-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/pom.xml b/modules/credential-store/credential-store-stubs/pom.xml
index 2a1c431..838b2f3 100644
--- a/modules/credential-store/credential-store-stubs/pom.xml
+++ b/modules/credential-store/credential-store-stubs/pom.xml
@@ -35,6 +35,11 @@
             <artifactId>slf4j-log4j12</artifactId>
             <version>${org.slf4j.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 
     <properties>


[50/62] [abbrv] airavata git commit: Simple null check

Posted by la...@apache.org.
Simple null check


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: a2181e44af8fc3e19fa0069898f8053e253adb2b
Parents: 6da7a74
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Thu Mar 12 15:46:34 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Thu Mar 12 15:46:34 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gsi/ssh/GSSContextX509.java | 11 +++++++++--
 .../airavata/gsi/ssh/impl/GSISSHAbstractCluster.java     |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a2181e44/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
index 2eb70c6..351e1af 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
@@ -168,12 +168,19 @@ public class GSSContextX509 implements com.jcraft.jsch.GSSContext {
 
     public boolean isEstablished() {
         // this must check to see if the call returned GSS_S_COMPLETE
-        return context.isEstablished();
+        if (context != null){
+            return context.isEstablished();
+        }
+        return false;
     }
 
     public byte[] init(byte[] token, int s, int l) throws JSchException {
         try {
-            return context.initSecContext(token, s, l);
+            if (context != null){
+                return context.initSecContext(token, s, l);
+            }else {
+                throw new JSchException("Context is null..");
+            }
         } catch (GSSException ex) {
             throw new JSchException(ex.toString());
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a2181e44/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
index 0420cff..cf9f931 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
@@ -109,7 +109,7 @@ public class GSISSHAbstractCluster implements Cluster {
         this.authenticationInfo = authenticationInfo;
 
         if (authenticationInfo instanceof GSIAuthenticationInfo) {
-        	JSch.setConfig("gssapi-with-mic.x509", "org.apache.airavata.gsi.ssh.GSSContextX509");
+            JSch.setConfig("gssapi-with-mic.x509", "org.apache.airavata.gsi.ssh.GSSContextX509");
             JSch.setConfig("userauth.gssapi-with-mic", "com.jcraft.jsch.UserAuthGSSAPIWithMICGSSCredentials");
             System.setProperty(X509_CERT_DIR, (String) ((GSIAuthenticationInfo) authenticationInfo).getProperties().
                     get("X509_CERT_DIR"));


[14/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
deleted file mode 100644
index 2b8858e..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
+++ /dev/null
@@ -1,55 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class cs_cpi_serviceConstants {
-
-  public static final String CS_CPI_VERSION = "0.15.0";
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java
deleted file mode 100644
index 93b4e94..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/AuditInfo.java
+++ /dev/null
@@ -1,53 +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.credential.store.credential;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Any audit information related to a credential.
- */
-public interface AuditInfo extends Serializable {
-
-    /**
-     * Gets the community user associated with the credential.
-     * 
-     * @return The community user associated with the credential.
-     */
-    public CommunityUser getCommunityUser();
-
-    /**
-     * The portal user associated with the credential.
-     * 
-     * @return The portal user name.
-     */
-    public String getPortalUserId();
-
-    /**
-     * Get the time which credentials are persisted.
-     * 
-     * @return Time credentials are persisted.
-     */
-    public Date getTimePersisted();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java
deleted file mode 100644
index 2856f36..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/CommunityUser.java
+++ /dev/null
@@ -1,71 +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.credential.store.credential;
-
-import java.io.Serializable;
-
-/**
- * Represents the community user.
- */
-public class CommunityUser implements Serializable {
-
-    static final long serialVersionUID = 5783370135149452010L;
-
-    private String gatewayName;
-    private String userName;
-    private String userEmail;
-
-    public String getGatewayName() {
-        return gatewayName;
-    }
-
-    public void setGatewayName(String gatewayName) {
-        this.gatewayName = gatewayName;
-    }
-
-    public String getUserEmail() {
-        return userEmail;
-    }
-
-    public void setUserEmail(String userEmail) {
-        this.userEmail = userEmail;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public CommunityUser(String gatewayName, String userName, String userEmail) {
-        this.gatewayName = gatewayName;
-        this.userName = userName;
-        this.userEmail = userEmail;
-    }
-
-    public CommunityUser(String gatewayName, String userName) {
-        this.gatewayName = gatewayName;
-        this.userName = userName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/Credential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/Credential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/Credential.java
deleted file mode 100644
index 4f04123..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/Credential.java
+++ /dev/null
@@ -1,62 +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.credential.store.credential;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-import java.util.Date;
-
-/**
- * This class represents the actual credential. The credential can be a certificate, user name password or a SSH key. As
- * per now we only have certificate implementation.
- */
-public abstract class Credential implements Serializable {
-
-    private String portalUserName;
-    private Date persistedTime;
-    private String token;
-
-    public String getToken() {
-        return token;
-    }
-
-    public void setToken(String token) {
-        this.token = token;
-    }
-
-    public void setPortalUserName(String userName) {
-        portalUserName = userName;
-    }
-
-    public String getPortalUserName() {
-        return portalUserName;
-    }
-
-    public void setCertificateRequestedTime(Date ts) {
-        persistedTime = ts;
-    }
-
-    public Date getCertificateRequestedTime() {
-        return persistedTime;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java
deleted file mode 100644
index 17ddb3f..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateAuditInfo.java
+++ /dev/null
@@ -1,101 +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.credential.store.credential.impl.certificate;
-
-import org.apache.airavata.credential.store.credential.AuditInfo;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Date;
-
-/**
- * Audit information related to community credential.
- */
-@XmlRootElement
-public class CertificateAuditInfo implements AuditInfo {
-
-    private static final long serialVersionUID = 13213123L;
-
-    private String gatewayName;
-    private String communityUserName;
-    private String portalUserName;
-    private Date credentialsRequestedTime;
-    private String notBefore;
-    private String notAfter;
-    private long credentialLifeTime;
-
-    public String getGatewayName() {
-        return gatewayName;
-    }
-
-    public void setGatewayName(String gatewayName) {
-        this.gatewayName = gatewayName;
-    }
-
-    public void setCommunityUserName(String communityUserName) {
-        this.communityUserName = communityUserName;
-    }
-
-    public void setPortalUserName(String portalUserName) {
-        this.portalUserName = portalUserName;
-    }
-
-    public void setCredentialsRequestedTime(Date credentialsRequestedTime) {
-        this.credentialsRequestedTime = credentialsRequestedTime;
-    }
-
-    public String getNotBefore() {
-        return notBefore;
-    }
-
-    public void setNotBefore(String notBefore) {
-        this.notBefore = notBefore;
-    }
-
-    public String getNotAfter() {
-        return notAfter;
-    }
-
-    public void setNotAfter(String notAfter) {
-        this.notAfter = notAfter;
-    }
-
-    public long getCredentialLifeTime() {
-        return credentialLifeTime;
-    }
-
-    public void setCredentialLifeTime(long credentialLifeTime) {
-        this.credentialLifeTime = credentialLifeTime;
-    }
-
-    public CommunityUser getCommunityUser() {
-        return new CommunityUser(gatewayName, communityUserName);
-    }
-
-    public String getPortalUserId() {
-        return portalUserName;
-    }
-
-    public Date getTimePersisted() {
-        return credentialsRequestedTime;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java
deleted file mode 100644
index 16c3351..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/certificate/CertificateCredential.java
+++ /dev/null
@@ -1,102 +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.credential.store.credential.impl.certificate;
-
-import org.apache.airavata.credential.store.credential.CommunityUser;
-import org.apache.airavata.credential.store.credential.Credential;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-/**
- * Represents the certificate credentials.
- */
-public class CertificateCredential extends Credential {
-
-    static final long serialVersionUID = 6603675553790734432L;
-
-    /**
-     * The community user associated with this credentials.
-     */
-    private CommunityUser communityUser;
-
-    private String notAfter;
-
-    private X509Certificate[] certificates;
-
-    private PrivateKey privateKey;
-
-    private long lifeTime;
-
-    private String notBefore;
-
-    public CertificateCredential() {
-    }
-
-    public String getNotBefore() {
-        return notBefore;
-    }
-
-    public void setNotBefore(String notBefore) {
-        this.notBefore = notBefore;
-    }
-
-    public String getNotAfter() {
-        return notAfter;
-    }
-
-    public void setNotAfter(String notAfter) {
-        this.notAfter = notAfter;
-    }
-
-    public PrivateKey getPrivateKey() {
-        return privateKey;
-    }
-
-    public void setPrivateKey(PrivateKey privateKey) {
-        this.privateKey = privateKey;
-    }
-
-    public X509Certificate[] getCertificates() {
-        return certificates;
-    }
-
-    public void setCertificates(X509Certificate[] certificate) {
-        this.certificates = certificate;
-    }
-
-    public long getLifeTime() {
-        return lifeTime;
-    }
-
-    public void setLifeTime(long lifeTime) {
-        this.lifeTime = lifeTime;
-    }
-
-    public CommunityUser getCommunityUser() {
-        return communityUser;
-    }
-
-    public void setCommunityUser(CommunityUser communityUser) {
-        this.communityUser = communityUser;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java
deleted file mode 100644
index a31c98b..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/password/PasswordCredential.java
+++ /dev/null
@@ -1,53 +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.credential.store.credential.impl.password;
-
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
-
-import java.util.Date;
-
-/**
- * User name password credentials.
- */
-public class PasswordCredential extends SSHCredential {
-
-    private String userName;
-    private String password;
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java
deleted file mode 100644
index d41af21..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredential.java
+++ /dev/null
@@ -1,88 +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.credential.store.credential.impl.ssh;
-
-import org.apache.airavata.credential.store.credential.Credential;
-import java.io.Serializable;
-
-/**
- * An SSH Credential class which is an extension of Airavata Credential 
- */
-public class SSHCredential extends Credential implements Serializable {
-
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = 1277154647420198981L;
-	
-	private byte[] privatekey;
-    private byte[] publicKey;
-    private String passphrase;
-    private String gateway;
-    private String username;
-
-
-    public SSHCredential() {
-    }
-
-    public SSHCredential(byte[] privatekey, byte[] publicKey, String passphrase, String gateway,String username) {
-        this.privatekey = privatekey;
-        this.publicKey = publicKey;
-        this.passphrase = passphrase;
-        this.gateway = gateway;
-        this.username = username;
-        this.setPortalUserName(username);
-    }
-
-    public byte[] getPrivateKey() {
-        return privatekey;
-    }
-
-    public void setPrivateKey(byte[] privatekey) {
-        this.privatekey = privatekey;
-    }
-
-    public byte[] getPublicKey() {
-        return publicKey;
-    }
-
-    public void setPublicKey(byte[] pubKey) {
-        this.publicKey = pubKey;
-    }
-
-    public String getPassphrase() {
-        return passphrase;
-    }
-
-    public void setPassphrase(String passphrase) {
-        this.passphrase = passphrase;
-    }
-
-	public String getGateway() {
-		return gateway;
-	}
-
-	public void setGateway(String gateway) {
-		this.gateway = gateway;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java
deleted file mode 100644
index ac1f0df..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/credential/impl/ssh/SSHCredentialGenerator.java
+++ /dev/null
@@ -1,103 +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.credential.store.credential.impl.ssh;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-import org.apache.airavata.credential.store.store.impl.SSHCredentialWriter;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.RandomStringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.KeyPair;
-
-/**
- * A class which generates an SSH credential
- */
-public class SSHCredentialGenerator {
-	
-	private static Logger logger = LoggerFactory.getLogger(SSHCredentialWriter.class);
-	
-	/**
-	 * 
-	 * @return a SSH Credential generated and encrypted using a randomly generated password
-	 * @throws CredentialStoreException 
-	 */
-	public SSHCredential generateCredential(String tokenId) throws CredentialStoreException {
-        JSch jsch=new JSch();
-        try {
-            KeyPair kpair=KeyPair.genKeyPair(jsch, KeyPair.RSA);
-            File file;
-			
-				file = File.createTempFile("id_rsa", "");
-			
-            String fileName = file.getAbsolutePath();
-
-            String password = generateRandomString();
-            // We are encrypting the private key with the hash of (tokenId+password). 
-            // Any client which wants to use this private key will also generate a hash and then use it to decrypt the key.  
-            kpair.writePrivateKey(fileName,password.getBytes());
-            kpair.writePublicKey(fileName + ".pub"  , "");
-            kpair.dispose();
-            byte[] priKey = FileUtils.readFileToByteArray(new File(fileName));
-            byte[] pubKey = FileUtils.readFileToByteArray(new File(fileName + ".pub"));
-            SSHCredential sshCredential = new SSHCredential();
-            sshCredential.setPrivateKey(priKey);
-            sshCredential.setPublicKey(pubKey);
-            sshCredential.setPassphrase(password);
-            return sshCredential;
-		} catch (IOException e) {
-			logger.error("IO Exception when creating SSH credential ",e);
-			throw new CredentialStoreException("Unable to generate SSH Credential", e);
-		} catch (JSchException e) {
-			logger.error("JSch SSH credential creation exception ",e);
-			throw new CredentialStoreException("Unable to generate SSH Credential. JSch exception ", e);
-		}
-	}
-	
-	private String generateHash(String tokenId, String password) {
-        byte[] bytesOfMessage = new byte[0];
-        try {
-            bytesOfMessage = password.getBytes("UTF-8");
-            MessageDigest md = MessageDigest.getInstance("MD5");
-            return new String( md.digest(bytesOfMessage));
-        } catch (UnsupportedEncodingException e) {
-            logger.error(e.getMessage(), e);
-        } catch (NoSuchAlgorithmException e) {
-            logger.error(e.getMessage(), e);
-        }
-        return  null;
-    }
-
-	// Generate a random alphanumberic string of 16 characters length
-	private String generateRandomString() {
-		return RandomStringUtils.randomAlphanumeric(16);
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
deleted file mode 100644
index ae37b1d..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
+++ /dev/null
@@ -1,1104 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CertificateCredential implements org.apache.thrift.TBase<CertificateCredential, CertificateCredential._Fields>, java.io.Serializable, Cloneable, Comparable<CertificateCredential> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CertificateCredential");
-
-  private static final org.apache.thrift.protocol.TField COMMUNITY_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("communityUser", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-  private static final org.apache.thrift.protocol.TField X509_CERT_FIELD_DESC = new org.apache.thrift.protocol.TField("x509Cert", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField NOT_AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("notAfter", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)4);
-  private static final org.apache.thrift.protocol.TField LIFE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lifeTime", org.apache.thrift.protocol.TType.I64, (short)5);
-  private static final org.apache.thrift.protocol.TField NOT_BEFORE_FIELD_DESC = new org.apache.thrift.protocol.TField("notBefore", org.apache.thrift.protocol.TType.STRING, (short)6);
-  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)7);
-  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)8);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new CertificateCredentialStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new CertificateCredentialTupleSchemeFactory());
-  }
-
-  public CommunityUser communityUser; // required
-  public String x509Cert; // required
-  public String notAfter; // optional
-  public String privateKey; // optional
-  public long lifeTime; // optional
-  public String notBefore; // optional
-  public long persistedTime; // optional
-  public String token; // optional
-
-  /** 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 {
-    COMMUNITY_USER((short)1, "communityUser"),
-    X509_CERT((short)2, "x509Cert"),
-    NOT_AFTER((short)3, "notAfter"),
-    PRIVATE_KEY((short)4, "privateKey"),
-    LIFE_TIME((short)5, "lifeTime"),
-    NOT_BEFORE((short)6, "notBefore"),
-    PERSISTED_TIME((short)7, "persistedTime"),
-    TOKEN((short)8, "token");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // COMMUNITY_USER
-          return COMMUNITY_USER;
-        case 2: // X509_CERT
-          return X509_CERT;
-        case 3: // NOT_AFTER
-          return NOT_AFTER;
-        case 4: // PRIVATE_KEY
-          return PRIVATE_KEY;
-        case 5: // LIFE_TIME
-          return LIFE_TIME;
-        case 6: // NOT_BEFORE
-          return NOT_BEFORE;
-        case 7: // PERSISTED_TIME
-          return PERSISTED_TIME;
-        case 8: // TOKEN
-          return TOKEN;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __LIFETIME_ISSET_ID = 0;
-  private static final int __PERSISTEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.NOT_AFTER,_Fields.PRIVATE_KEY,_Fields.LIFE_TIME,_Fields.NOT_BEFORE,_Fields.PERSISTED_TIME,_Fields.TOKEN};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.COMMUNITY_USER, new org.apache.thrift.meta_data.FieldMetaData("communityUser", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CommunityUser.class)));
-    tmpMap.put(_Fields.X509_CERT, new org.apache.thrift.meta_data.FieldMetaData("x509Cert", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.NOT_AFTER, new org.apache.thrift.meta_data.FieldMetaData("notAfter", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.LIFE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lifeTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.NOT_BEFORE, new org.apache.thrift.meta_data.FieldMetaData("notBefore", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CertificateCredential.class, metaDataMap);
-  }
-
-  public CertificateCredential() {
-  }
-
-  public CertificateCredential(
-    CommunityUser communityUser,
-    String x509Cert)
-  {
-    this();
-    this.communityUser = communityUser;
-    this.x509Cert = x509Cert;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public CertificateCredential(CertificateCredential other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetCommunityUser()) {
-      this.communityUser = new CommunityUser(other.communityUser);
-    }
-    if (other.isSetX509Cert()) {
-      this.x509Cert = other.x509Cert;
-    }
-    if (other.isSetNotAfter()) {
-      this.notAfter = other.notAfter;
-    }
-    if (other.isSetPrivateKey()) {
-      this.privateKey = other.privateKey;
-    }
-    this.lifeTime = other.lifeTime;
-    if (other.isSetNotBefore()) {
-      this.notBefore = other.notBefore;
-    }
-    this.persistedTime = other.persistedTime;
-    if (other.isSetToken()) {
-      this.token = other.token;
-    }
-  }
-
-  public CertificateCredential deepCopy() {
-    return new CertificateCredential(this);
-  }
-
-  @Override
-  public void clear() {
-    this.communityUser = null;
-    this.x509Cert = null;
-    this.notAfter = null;
-    this.privateKey = null;
-    setLifeTimeIsSet(false);
-    this.lifeTime = 0;
-    this.notBefore = null;
-    setPersistedTimeIsSet(false);
-    this.persistedTime = 0;
-    this.token = null;
-  }
-
-  public CommunityUser getCommunityUser() {
-    return this.communityUser;
-  }
-
-  public CertificateCredential setCommunityUser(CommunityUser communityUser) {
-    this.communityUser = communityUser;
-    return this;
-  }
-
-  public void unsetCommunityUser() {
-    this.communityUser = null;
-  }
-
-  /** Returns true if field communityUser is set (has been assigned a value) and false otherwise */
-  public boolean isSetCommunityUser() {
-    return this.communityUser != null;
-  }
-
-  public void setCommunityUserIsSet(boolean value) {
-    if (!value) {
-      this.communityUser = null;
-    }
-  }
-
-  public String getX509Cert() {
-    return this.x509Cert;
-  }
-
-  public CertificateCredential setX509Cert(String x509Cert) {
-    this.x509Cert = x509Cert;
-    return this;
-  }
-
-  public void unsetX509Cert() {
-    this.x509Cert = null;
-  }
-
-  /** Returns true if field x509Cert is set (has been assigned a value) and false otherwise */
-  public boolean isSetX509Cert() {
-    return this.x509Cert != null;
-  }
-
-  public void setX509CertIsSet(boolean value) {
-    if (!value) {
-      this.x509Cert = null;
-    }
-  }
-
-  public String getNotAfter() {
-    return this.notAfter;
-  }
-
-  public CertificateCredential setNotAfter(String notAfter) {
-    this.notAfter = notAfter;
-    return this;
-  }
-
-  public void unsetNotAfter() {
-    this.notAfter = null;
-  }
-
-  /** Returns true if field notAfter is set (has been assigned a value) and false otherwise */
-  public boolean isSetNotAfter() {
-    return this.notAfter != null;
-  }
-
-  public void setNotAfterIsSet(boolean value) {
-    if (!value) {
-      this.notAfter = null;
-    }
-  }
-
-  public String getPrivateKey() {
-    return this.privateKey;
-  }
-
-  public CertificateCredential setPrivateKey(String privateKey) {
-    this.privateKey = privateKey;
-    return this;
-  }
-
-  public void unsetPrivateKey() {
-    this.privateKey = null;
-  }
-
-  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
-  public boolean isSetPrivateKey() {
-    return this.privateKey != null;
-  }
-
-  public void setPrivateKeyIsSet(boolean value) {
-    if (!value) {
-      this.privateKey = null;
-    }
-  }
-
-  public long getLifeTime() {
-    return this.lifeTime;
-  }
-
-  public CertificateCredential setLifeTime(long lifeTime) {
-    this.lifeTime = lifeTime;
-    setLifeTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetLifeTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIFETIME_ISSET_ID);
-  }
-
-  /** Returns true if field lifeTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetLifeTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __LIFETIME_ISSET_ID);
-  }
-
-  public void setLifeTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIFETIME_ISSET_ID, value);
-  }
-
-  public String getNotBefore() {
-    return this.notBefore;
-  }
-
-  public CertificateCredential setNotBefore(String notBefore) {
-    this.notBefore = notBefore;
-    return this;
-  }
-
-  public void unsetNotBefore() {
-    this.notBefore = null;
-  }
-
-  /** Returns true if field notBefore is set (has been assigned a value) and false otherwise */
-  public boolean isSetNotBefore() {
-    return this.notBefore != null;
-  }
-
-  public void setNotBeforeIsSet(boolean value) {
-    if (!value) {
-      this.notBefore = null;
-    }
-  }
-
-  public long getPersistedTime() {
-    return this.persistedTime;
-  }
-
-  public CertificateCredential setPersistedTime(long persistedTime) {
-    this.persistedTime = persistedTime;
-    setPersistedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetPersistedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetPersistedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  public void setPersistedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
-  }
-
-  public String getToken() {
-    return this.token;
-  }
-
-  public CertificateCredential setToken(String token) {
-    this.token = token;
-    return this;
-  }
-
-  public void unsetToken() {
-    this.token = null;
-  }
-
-  /** Returns true if field token is set (has been assigned a value) and false otherwise */
-  public boolean isSetToken() {
-    return this.token != null;
-  }
-
-  public void setTokenIsSet(boolean value) {
-    if (!value) {
-      this.token = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case COMMUNITY_USER:
-      if (value == null) {
-        unsetCommunityUser();
-      } else {
-        setCommunityUser((CommunityUser)value);
-      }
-      break;
-
-    case X509_CERT:
-      if (value == null) {
-        unsetX509Cert();
-      } else {
-        setX509Cert((String)value);
-      }
-      break;
-
-    case NOT_AFTER:
-      if (value == null) {
-        unsetNotAfter();
-      } else {
-        setNotAfter((String)value);
-      }
-      break;
-
-    case PRIVATE_KEY:
-      if (value == null) {
-        unsetPrivateKey();
-      } else {
-        setPrivateKey((String)value);
-      }
-      break;
-
-    case LIFE_TIME:
-      if (value == null) {
-        unsetLifeTime();
-      } else {
-        setLifeTime((Long)value);
-      }
-      break;
-
-    case NOT_BEFORE:
-      if (value == null) {
-        unsetNotBefore();
-      } else {
-        setNotBefore((String)value);
-      }
-      break;
-
-    case PERSISTED_TIME:
-      if (value == null) {
-        unsetPersistedTime();
-      } else {
-        setPersistedTime((Long)value);
-      }
-      break;
-
-    case TOKEN:
-      if (value == null) {
-        unsetToken();
-      } else {
-        setToken((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case COMMUNITY_USER:
-      return getCommunityUser();
-
-    case X509_CERT:
-      return getX509Cert();
-
-    case NOT_AFTER:
-      return getNotAfter();
-
-    case PRIVATE_KEY:
-      return getPrivateKey();
-
-    case LIFE_TIME:
-      return Long.valueOf(getLifeTime());
-
-    case NOT_BEFORE:
-      return getNotBefore();
-
-    case PERSISTED_TIME:
-      return Long.valueOf(getPersistedTime());
-
-    case TOKEN:
-      return getToken();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case COMMUNITY_USER:
-      return isSetCommunityUser();
-    case X509_CERT:
-      return isSetX509Cert();
-    case NOT_AFTER:
-      return isSetNotAfter();
-    case PRIVATE_KEY:
-      return isSetPrivateKey();
-    case LIFE_TIME:
-      return isSetLifeTime();
-    case NOT_BEFORE:
-      return isSetNotBefore();
-    case PERSISTED_TIME:
-      return isSetPersistedTime();
-    case TOKEN:
-      return isSetToken();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof CertificateCredential)
-      return this.equals((CertificateCredential)that);
-    return false;
-  }
-
-  public boolean equals(CertificateCredential that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_communityUser = true && this.isSetCommunityUser();
-    boolean that_present_communityUser = true && that.isSetCommunityUser();
-    if (this_present_communityUser || that_present_communityUser) {
-      if (!(this_present_communityUser && that_present_communityUser))
-        return false;
-      if (!this.communityUser.equals(that.communityUser))
-        return false;
-    }
-
-    boolean this_present_x509Cert = true && this.isSetX509Cert();
-    boolean that_present_x509Cert = true && that.isSetX509Cert();
-    if (this_present_x509Cert || that_present_x509Cert) {
-      if (!(this_present_x509Cert && that_present_x509Cert))
-        return false;
-      if (!this.x509Cert.equals(that.x509Cert))
-        return false;
-    }
-
-    boolean this_present_notAfter = true && this.isSetNotAfter();
-    boolean that_present_notAfter = true && that.isSetNotAfter();
-    if (this_present_notAfter || that_present_notAfter) {
-      if (!(this_present_notAfter && that_present_notAfter))
-        return false;
-      if (!this.notAfter.equals(that.notAfter))
-        return false;
-    }
-
-    boolean this_present_privateKey = true && this.isSetPrivateKey();
-    boolean that_present_privateKey = true && that.isSetPrivateKey();
-    if (this_present_privateKey || that_present_privateKey) {
-      if (!(this_present_privateKey && that_present_privateKey))
-        return false;
-      if (!this.privateKey.equals(that.privateKey))
-        return false;
-    }
-
-    boolean this_present_lifeTime = true && this.isSetLifeTime();
-    boolean that_present_lifeTime = true && that.isSetLifeTime();
-    if (this_present_lifeTime || that_present_lifeTime) {
-      if (!(this_present_lifeTime && that_present_lifeTime))
-        return false;
-      if (this.lifeTime != that.lifeTime)
-        return false;
-    }
-
-    boolean this_present_notBefore = true && this.isSetNotBefore();
-    boolean that_present_notBefore = true && that.isSetNotBefore();
-    if (this_present_notBefore || that_present_notBefore) {
-      if (!(this_present_notBefore && that_present_notBefore))
-        return false;
-      if (!this.notBefore.equals(that.notBefore))
-        return false;
-    }
-
-    boolean this_present_persistedTime = true && this.isSetPersistedTime();
-    boolean that_present_persistedTime = true && that.isSetPersistedTime();
-    if (this_present_persistedTime || that_present_persistedTime) {
-      if (!(this_present_persistedTime && that_present_persistedTime))
-        return false;
-      if (this.persistedTime != that.persistedTime)
-        return false;
-    }
-
-    boolean this_present_token = true && this.isSetToken();
-    boolean that_present_token = true && that.isSetToken();
-    if (this_present_token || that_present_token) {
-      if (!(this_present_token && that_present_token))
-        return false;
-      if (!this.token.equals(that.token))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(CertificateCredential other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetCommunityUser()).compareTo(other.isSetCommunityUser());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCommunityUser()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.communityUser, other.communityUser);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetX509Cert()).compareTo(other.isSetX509Cert());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetX509Cert()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.x509Cert, other.x509Cert);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetNotAfter()).compareTo(other.isSetNotAfter());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetNotAfter()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notAfter, other.notAfter);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPrivateKey()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetLifeTime()).compareTo(other.isSetLifeTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetLifeTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lifeTime, other.lifeTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetNotBefore()).compareTo(other.isSetNotBefore());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetNotBefore()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notBefore, other.notBefore);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPersistedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetToken()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("CertificateCredential(");
-    boolean first = true;
-
-    sb.append("communityUser:");
-    if (this.communityUser == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.communityUser);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("x509Cert:");
-    if (this.x509Cert == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.x509Cert);
-    }
-    first = false;
-    if (isSetNotAfter()) {
-      if (!first) sb.append(", ");
-      sb.append("notAfter:");
-      if (this.notAfter == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.notAfter);
-      }
-      first = false;
-    }
-    if (isSetPrivateKey()) {
-      if (!first) sb.append(", ");
-      sb.append("privateKey:");
-      if (this.privateKey == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.privateKey);
-      }
-      first = false;
-    }
-    if (isSetLifeTime()) {
-      if (!first) sb.append(", ");
-      sb.append("lifeTime:");
-      sb.append(this.lifeTime);
-      first = false;
-    }
-    if (isSetNotBefore()) {
-      if (!first) sb.append(", ");
-      sb.append("notBefore:");
-      if (this.notBefore == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.notBefore);
-      }
-      first = false;
-    }
-    if (isSetPersistedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("persistedTime:");
-      sb.append(this.persistedTime);
-      first = false;
-    }
-    if (isSetToken()) {
-      if (!first) sb.append(", ");
-      sb.append("token:");
-      if (this.token == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.token);
-      }
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (communityUser == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'communityUser' was not present! Struct: " + toString());
-    }
-    if (x509Cert == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'x509Cert' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-    if (communityUser != null) {
-      communityUser.validate();
-    }
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class CertificateCredentialStandardSchemeFactory implements SchemeFactory {
-    public CertificateCredentialStandardScheme getScheme() {
-      return new CertificateCredentialStandardScheme();
-    }
-  }
-
-  private static class CertificateCredentialStandardScheme extends StandardScheme<CertificateCredential> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, CertificateCredential struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // COMMUNITY_USER
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-              struct.communityUser = new CommunityUser();
-              struct.communityUser.read(iprot);
-              struct.setCommunityUserIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // X509_CERT
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.x509Cert = iprot.readString();
-              struct.setX509CertIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // NOT_AFTER
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.notAfter = iprot.readString();
-              struct.setNotAfterIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // PRIVATE_KEY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.privateKey = iprot.readString();
-              struct.setPrivateKeyIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // LIFE_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.lifeTime = iprot.readI64();
-              struct.setLifeTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // NOT_BEFORE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.notBefore = iprot.readString();
-              struct.setNotBeforeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 7: // PERSISTED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.persistedTime = iprot.readI64();
-              struct.setPersistedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 8: // TOKEN
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.token = iprot.readString();
-              struct.setTokenIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, CertificateCredential struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.communityUser != null) {
-        oprot.writeFieldBegin(COMMUNITY_USER_FIELD_DESC);
-        struct.communityUser.write(oprot);
-        oprot.writeFieldEnd();
-      }
-      if (struct.x509Cert != null) {
-        oprot.writeFieldBegin(X509_CERT_FIELD_DESC);
-        oprot.writeString(struct.x509Cert);
-        oprot.writeFieldEnd();
-      }
-      if (struct.notAfter != null) {
-        if (struct.isSetNotAfter()) {
-          oprot.writeFieldBegin(NOT_AFTER_FIELD_DESC);
-          oprot.writeString(struct.notAfter);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.privateKey != null) {
-        if (struct.isSetPrivateKey()) {
-          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
-          oprot.writeString(struct.privateKey);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetLifeTime()) {
-        oprot.writeFieldBegin(LIFE_TIME_FIELD_DESC);
-        oprot.writeI64(struct.lifeTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.notBefore != null) {
-        if (struct.isSetNotBefore()) {
-          oprot.writeFieldBegin(NOT_BEFORE_FIELD_DESC);
-          oprot.writeString(struct.notBefore);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.persistedTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.token != null) {
-        if (struct.isSetToken()) {
-          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
-          oprot.writeString(struct.token);
-          oprot.writeFieldEnd();
-        }
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class CertificateCredentialTupleSchemeFactory implements SchemeFactory {
-    public CertificateCredentialTupleScheme getScheme() {
-      return new CertificateCredentialTupleScheme();
-    }
-  }
-
-  private static class CertificateCredentialTupleScheme extends TupleScheme<CertificateCredential> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      struct.communityUser.write(oprot);
-      oprot.writeString(struct.x509Cert);
-      BitSet optionals = new BitSet();
-      if (struct.isSetNotAfter()) {
-        optionals.set(0);
-      }
-      if (struct.isSetPrivateKey()) {
-        optionals.set(1);
-      }
-      if (struct.isSetLifeTime()) {
-        optionals.set(2);
-      }
-      if (struct.isSetNotBefore()) {
-        optionals.set(3);
-      }
-      if (struct.isSetPersistedTime()) {
-        optionals.set(4);
-      }
-      if (struct.isSetToken()) {
-        optionals.set(5);
-      }
-      oprot.writeBitSet(optionals, 6);
-      if (struct.isSetNotAfter()) {
-        oprot.writeString(struct.notAfter);
-      }
-      if (struct.isSetPrivateKey()) {
-        oprot.writeString(struct.privateKey);
-      }
-      if (struct.isSetLifeTime()) {
-        oprot.writeI64(struct.lifeTime);
-      }
-      if (struct.isSetNotBefore()) {
-        oprot.writeString(struct.notBefore);
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeI64(struct.persistedTime);
-      }
-      if (struct.isSetToken()) {
-        oprot.writeString(struct.token);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.communityUser = new CommunityUser();
-      struct.communityUser.read(iprot);
-      struct.setCommunityUserIsSet(true);
-      struct.x509Cert = iprot.readString();
-      struct.setX509CertIsSet(true);
-      BitSet incoming = iprot.readBitSet(6);
-      if (incoming.get(0)) {
-        struct.notAfter = iprot.readString();
-        struct.setNotAfterIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.privateKey = iprot.readString();
-        struct.setPrivateKeyIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.lifeTime = iprot.readI64();
-        struct.setLifeTimeIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.notBefore = iprot.readString();
-        struct.setNotBeforeIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.persistedTime = iprot.readI64();
-        struct.setPersistedTimeIsSet(true);
-      }
-      if (incoming.get(5)) {
-        struct.token = iprot.readString();
-        struct.setTokenIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
deleted file mode 100644
index 9b62310..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
+++ /dev/null
@@ -1,589 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser");
-
-  private static final org.apache.thrift.protocol.TField GATEWAY_NMAE_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayNmae", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField USER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userEmail", org.apache.thrift.protocol.TType.STRING, (short)3);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new CommunityUserStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new CommunityUserTupleSchemeFactory());
-  }
-
-  public String gatewayNmae; // required
-  public String username; // required
-  public String userEmail; // 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 {
-    GATEWAY_NMAE((short)1, "gatewayNmae"),
-    USERNAME((short)2, "username"),
-    USER_EMAIL((short)3, "userEmail");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // GATEWAY_NMAE
-          return GATEWAY_NMAE;
-        case 2: // USERNAME
-          return USERNAME;
-        case 3: // USER_EMAIL
-          return USER_EMAIL;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.GATEWAY_NMAE, new org.apache.thrift.meta_data.FieldMetaData("gatewayNmae", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", 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(CommunityUser.class, metaDataMap);
-  }
-
-  public CommunityUser() {
-  }
-
-  public CommunityUser(
-    String gatewayNmae,
-    String username,
-    String userEmail)
-  {
-    this();
-    this.gatewayNmae = gatewayNmae;
-    this.username = username;
-    this.userEmail = userEmail;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public CommunityUser(CommunityUser other) {
-    if (other.isSetGatewayNmae()) {
-      this.gatewayNmae = other.gatewayNmae;
-    }
-    if (other.isSetUsername()) {
-      this.username = other.username;
-    }
-    if (other.isSetUserEmail()) {
-      this.userEmail = other.userEmail;
-    }
-  }
-
-  public CommunityUser deepCopy() {
-    return new CommunityUser(this);
-  }
-
-  @Override
-  public void clear() {
-    this.gatewayNmae = null;
-    this.username = null;
-    this.userEmail = null;
-  }
-
-  public String getGatewayNmae() {
-    return this.gatewayNmae;
-  }
-
-  public CommunityUser setGatewayNmae(String gatewayNmae) {
-    this.gatewayNmae = gatewayNmae;
-    return this;
-  }
-
-  public void unsetGatewayNmae() {
-    this.gatewayNmae = null;
-  }
-
-  /** Returns true if field gatewayNmae is set (has been assigned a value) and false otherwise */
-  public boolean isSetGatewayNmae() {
-    return this.gatewayNmae != null;
-  }
-
-  public void setGatewayNmaeIsSet(boolean value) {
-    if (!value) {
-      this.gatewayNmae = null;
-    }
-  }
-
-  public String getUsername() {
-    return this.username;
-  }
-
-  public CommunityUser setUsername(String username) {
-    this.username = username;
-    return this;
-  }
-
-  public void unsetUsername() {
-    this.username = null;
-  }
-
-  /** Returns true if field username is set (has been assigned a value) and false otherwise */
-  public boolean isSetUsername() {
-    return this.username != null;
-  }
-
-  public void setUsernameIsSet(boolean value) {
-    if (!value) {
-      this.username = null;
-    }
-  }
-
-  public String getUserEmail() {
-    return this.userEmail;
-  }
-
-  public CommunityUser setUserEmail(String userEmail) {
-    this.userEmail = userEmail;
-    return this;
-  }
-
-  public void unsetUserEmail() {
-    this.userEmail = null;
-  }
-
-  /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
-  public boolean isSetUserEmail() {
-    return this.userEmail != null;
-  }
-
-  public void setUserEmailIsSet(boolean value) {
-    if (!value) {
-      this.userEmail = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case GATEWAY_NMAE:
-      if (value == null) {
-        unsetGatewayNmae();
-      } else {
-        setGatewayNmae((String)value);
-      }
-      break;
-
-    case USERNAME:
-      if (value == null) {
-        unsetUsername();
-      } else {
-        setUsername((String)value);
-      }
-      break;
-
-    case USER_EMAIL:
-      if (value == null) {
-        unsetUserEmail();
-      } else {
-        setUserEmail((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case GATEWAY_NMAE:
-      return getGatewayNmae();
-
-    case USERNAME:
-      return getUsername();
-
-    case USER_EMAIL:
-      return getUserEmail();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case GATEWAY_NMAE:
-      return isSetGatewayNmae();
-    case USERNAME:
-      return isSetUsername();
-    case USER_EMAIL:
-      return isSetUserEmail();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof CommunityUser)
-      return this.equals((CommunityUser)that);
-    return false;
-  }
-
-  public boolean equals(CommunityUser that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_gatewayNmae = true && this.isSetGatewayNmae();
-    boolean that_present_gatewayNmae = true && that.isSetGatewayNmae();
-    if (this_present_gatewayNmae || that_present_gatewayNmae) {
-      if (!(this_present_gatewayNmae && that_present_gatewayNmae))
-        return false;
-      if (!this.gatewayNmae.equals(that.gatewayNmae))
-        return false;
-    }
-
-    boolean this_present_username = true && this.isSetUsername();
-    boolean that_present_username = true && that.isSetUsername();
-    if (this_present_username || that_present_username) {
-      if (!(this_present_username && that_present_username))
-        return false;
-      if (!this.username.equals(that.username))
-        return false;
-    }
-
-    boolean this_present_userEmail = true && this.isSetUserEmail();
-    boolean that_present_userEmail = true && that.isSetUserEmail();
-    if (this_present_userEmail || that_present_userEmail) {
-      if (!(this_present_userEmail && that_present_userEmail))
-        return false;
-      if (!this.userEmail.equals(that.userEmail))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(CommunityUser other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetGatewayNmae()).compareTo(other.isSetGatewayNmae());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGatewayNmae()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayNmae, other.gatewayNmae);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUsername()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(other.isSetUserEmail());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUserEmail()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, other.userEmail);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("CommunityUser(");
-    boolean first = true;
-
-    sb.append("gatewayNmae:");
-    if (this.gatewayNmae == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.gatewayNmae);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("username:");
-    if (this.username == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.username);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("userEmail:");
-    if (this.userEmail == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.userEmail);
-    }
-    first = false;
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (gatewayNmae == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayNmae' was not present! Struct: " + toString());
-    }
-    if (username == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
-    }
-    if (userEmail == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'userEmail' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class CommunityUserStandardSchemeFactory implements SchemeFactory {
-    public CommunityUserStandardScheme getScheme() {
-      return new CommunityUserStandardScheme();
-    }
-  }
-
-  private static class CommunityUserStandardScheme extends StandardScheme<CommunityUser> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, CommunityUser struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // GATEWAY_NMAE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.gatewayNmae = iprot.readString();
-              struct.setGatewayNmaeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // USERNAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.username = iprot.readString();
-              struct.setUsernameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // USER_EMAIL
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.userEmail = iprot.readString();
-              struct.setUserEmailIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, CommunityUser struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.gatewayNmae != null) {
-        oprot.writeFieldBegin(GATEWAY_NMAE_FIELD_DESC);
-        oprot.writeString(struct.gatewayNmae);
-        oprot.writeFieldEnd();
-      }
-      if (struct.username != null) {
-        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
-        oprot.writeString(struct.username);
-        oprot.writeFieldEnd();
-      }
-      if (struct.userEmail != null) {
-        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
-        oprot.writeString(struct.userEmail);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class CommunityUserTupleSchemeFactory implements SchemeFactory {
-    public CommunityUserTupleScheme getScheme() {
-      return new CommunityUserTupleScheme();
-    }
-  }
-
-  private static class CommunityUserTupleScheme extends TupleScheme<CommunityUser> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.gatewayNmae);
-      oprot.writeString(struct.username);
-      oprot.writeString(struct.userEmail);
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.gatewayNmae = iprot.readString();
-      struct.setGatewayNmaeIsSet(true);
-      struct.username = iprot.readString();
-      struct.setUsernameIsSet(true);
-      struct.userEmail = iprot.readString();
-      struct.setUserEmailIsSet(true);
-    }
-  }
-
-}
-


[53/62] [abbrv] airavata git commit: fixing AIRAVATA-1630

Posted by la...@apache.org.
fixing AIRAVATA-1630


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/73858d15
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/73858d15
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/73858d15

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 73858d152a23e1e044d6c1ee74f3f9bb056baf06
Parents: 990d72a
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 13 15:12:07 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 13 15:12:07 2015 -0400

----------------------------------------------------------------------
 .../airavata/gfac/core/utils/OutHandlerWorker.java       | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/73858d15/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutHandlerWorker.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutHandlerWorker.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutHandlerWorker.java
index d279bbe..08fa9a4 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutHandlerWorker.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/OutHandlerWorker.java
@@ -26,6 +26,8 @@ import org.apache.airavata.gfac.core.cpi.GFac;
 import org.apache.airavata.gfac.core.monitor.MonitorID;
 import org.apache.airavata.model.messaging.event.TaskIdentifier;
 import org.apache.airavata.model.messaging.event.TaskStatusChangeRequestEvent;
+import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
+import org.apache.airavata.model.workspace.experiment.ErrorCategory;
 import org.apache.airavata.model.workspace.experiment.TaskState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,9 +53,16 @@ public class OutHandlerWorker implements Runnable {
             gfac.invokeOutFlowHandlers(monitorID.getJobExecutionContext());
         } catch (GFacException e) {
             TaskIdentifier taskIdentifier = new TaskIdentifier(monitorID.getTaskID(), monitorID.getWorkflowNodeID(),monitorID.getExperimentID(), monitorID.getJobExecutionContext().getGatewayID());
-            monitorPublisher.publish(new TaskStatusChangeRequestEvent(TaskState.FAILED, taskIdentifier));
             //FIXME this is a case where the output retrieving fails even if the job execution was a success. Thus updating the task status
+            monitorPublisher.publish(new TaskStatusChangeRequestEvent(TaskState.FAILED, taskIdentifier));
+            try {
+                GFacUtils.saveErrorDetails(monitorID.getJobExecutionContext(), e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR);
+            } catch (GFacException e1) {
+                logger.error("Error while persisting error details", e);
+            }
             logger.info(e.getLocalizedMessage(), e);
+            // Save error details to registry
+
         }
         monitorPublisher.publish(monitorID.getStatus());
     }


[10/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/pom.xml b/modules/credential-store-service/pom.xml
deleted file mode 100644
index efc075f..0000000
--- a/modules/credential-store-service/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--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. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata</artifactId>
-        <version>0.15-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-credential-store-service</artifactId>
-    <packaging>pom</packaging>
-    <name>Airavata Credential Store Service</name>
-    <url>http://airavata.apache.org/</url>
-
-    <profiles>
-        <profile>
-            <id>default</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <modules>
-                <module>credential-store</module>
-                <module>credential-store-webapp</module>
-            </modules>
-        </profile>
-    </profiles>
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    </properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/pom.xml b/modules/credential-store/credential-store-service/pom.xml
new file mode 100644
index 0000000..d8af25f
--- /dev/null
+++ b/modules/credential-store/credential-store-service/pom.xml
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.apache.airavata</groupId>
+		<artifactId>airavata</artifactId>
+		<version>0.15-SNAPSHOT</version>
+		<relativePath>../../../pom.xml</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>airavata-credential-store</artifactId>
+	<name>Airavata Credential Store</name>
+	<description>Module to manage credentials</description>
+
+	<dependencies>
+		<dependency>
+			<groupId>edu.uiuc.ncsa.myproxy</groupId>
+			<artifactId>oa4mp-client-api</artifactId>
+			<version>${oa4mp.version}</version>
+		</dependency>
+		<dependency>
+            <groupId>edu.uiuc.ncsa.myproxy</groupId>
+            <artifactId>oa4mp-client-loader-oauth1</artifactId>
+            <version>${oa4mp.version}</version>
+            <exclusions>
+        	<exclusion>
+          		<groupId>net.oauth.core</groupId> 
+          		<artifactId>oauth-httpclient4</artifactId>
+        	</exclusion>
+			<exclusion>
+				<groupId>net.oauth.core</groupId>
+				<artifactId>oauth-consumer</artifactId>
+			</exclusion>
+			<exclusion>
+				<groupId>mysql</groupId>
+				<artifactId>mysql-connector-java</artifactId>
+			</exclusion>
+			<exclusion>
+				<groupId>postgresql</groupId>
+				<artifactId>postgresql</artifactId>
+			</exclusion>
+            </exclusions>
+        </dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.7</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>derby</artifactId>
+			<version>${derby.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>derbyclient</artifactId>
+			<version>${derby.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>derbynet</artifactId>
+			<version>${derby.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>derbytools</artifactId>
+			<version>${derby.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>commons-dbcp</groupId>
+			<artifactId>commons-dbcp</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.airavata</groupId>
+			<artifactId>airavata-common-utils</artifactId>
+			<version>${project.version}</version>
+		</dependency> 
+		<dependency>
+			<groupId>com.jcraft</groupId>
+			<artifactId>jsch</artifactId>
+			<version>0.1.50</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.5</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-email</artifactId>
+			<version>1.3.2</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>1.3.2</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>${surefire.version}</version>
+				<inherited>true</inherited>
+				<configuration>
+					<systemPropertyVariables>
+						<credential.module.directory>${basedir}</credential.module.directory>
+					</systemPropertyVariables>
+					<excludes>
+						<exclude>**/DAOBaseTestCase.java</exclude>
+						<exclude>**/MappingDAOTest.java</exclude>
+					</excludes>
+					<testSourceDirectory>${basedir}\src\test\java\</testSourceDirectory>
+				</configuration>
+			</plugin>
+
+		</plugins>
+		<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
+		<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
+		<testResources>
+			<testResource>
+				<directory>${project.basedir}/src/test/resources</directory>
+			</testResource>
+		</testResources>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/scripts/credential-store-h2.sql
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/scripts/credential-store-h2.sql b/modules/credential-store/credential-store-service/scripts/credential-store-h2.sql
new file mode 100644
index 0000000..91915b6
--- /dev/null
+++ b/modules/credential-store/credential-store-service/scripts/credential-store-h2.sql
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.
+ *
+ */
+CREATE TABLE COMMUNITY_USER
+(
+	GATEWAY_NAME VARCHAR(256) NOT NULL,
+	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+	COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
+);
+
+
+CREATE TABLE CREDENTIALS
+(
+	GATEWAY_NAME VARCHAR(256) NOT NULL,
+	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+	CREDENTIAL CLOB NOT NULL,
+	PRIVATE_KEY CLOB NOT NULL,
+	NOT_BEFORE VARCHAR(256) NOT NULL,
+	NOT_AFTER VARCHAR(256) NOT NULL,
+	LIFETIME MEDIUMINT NOT NULL,
+	REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,
+	REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/scripts/credential-store-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/scripts/credential-store-mysql.sql b/modules/credential-store/credential-store-service/scripts/credential-store-mysql.sql
new file mode 100644
index 0000000..50d5e0f
--- /dev/null
+++ b/modules/credential-store/credential-store-service/scripts/credential-store-mysql.sql
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.
+ *
+ */
+CREATE TABLE COMMUNITY_USER
+(
+	GATEWAY_NAME VARCHAR(256) NOT NULL,
+	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+	COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
+);
+
+
+CREATE TABLE CREDENTIALS
+(
+	GATEWAY_NAME VARCHAR(256) NOT NULL,
+	COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+	CREDENTIAL TEXT NOT NULL,
+	PRIVATE_KEY TEXT NOT NULL,
+	NOT_BEFORE VARCHAR(256) NOT NULL,
+	NOT_AFTER VARCHAR(256) NOT NULL,
+	LIFETIME MEDIUMINT NOT NULL,
+	REQUESTING_PORTAL_USER_NAME VARCHAR(256) NOT NULL,
+	REQUESTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+    PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME)
+);

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
new file mode 100644
index 0000000..12105e2
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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.credential.store.client;
+
+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.ServerSettings;
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import org.apache.airavata.credential.store.datamodel.CertificateCredential;
+import org.apache.airavata.credential.store.datamodel.CommunityUser;
+import org.apache.airavata.credential.store.datamodel.SSHCredential;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSSLTransportFactory;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import org.apache.commons.codec.binary.Base64;
+
+public class TestSSLClient {
+    private void invoke() {
+        TTransport transport;
+        try {
+            AiravataUtils.setExecutionAsServer();
+            TSSLTransportFactory.TSSLTransportParameters params =
+                    new TSSLTransportFactory.TSSLTransportParameters();
+            String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
+            String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
+            params.setTrustStore(keystorePath, keystorePWD);
+            final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_PORT, "8960"));
+            final String serverHost = ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_HOST, null);
+
+            transport = TSSLTransportFactory.getClientSocket(serverHost, serverPort, 10000, params);
+            TProtocol protocol = new TBinaryProtocol(transport);
+
+            CredentialStoreService.Client client = new CredentialStoreService.Client(protocol);
+//            testSSHCredential(client);
+            testCertificateCredential(client);
+            transport.close();
+        } catch (TTransportException e) {
+            e.printStackTrace();
+        }catch (ApplicationSettingsException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void testSSHCredential (CredentialStoreService.Client client){
+        try {
+            SSHCredential sshCredential = new SSHCredential();
+            sshCredential.setUsername("test");
+            sshCredential.setGatewayId("testGateway");
+            sshCredential.setPassphrase("mypassphrase");
+            String token = client.addSSHCredential(sshCredential);
+            System.out.println("SSH Token :" + token);
+            SSHCredential credential = client.getSSHCredential(token, "testGateway");
+            System.out.println("private key : " + credential.getPrivateKey());
+            System.out.println("public key : " + credential.getPublicKey());
+        }catch (TTransportException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void testCertificateCredential (CredentialStoreService.Client client){
+        try {
+            CertificateCredential certificateCredential = new CertificateCredential();
+            CommunityUser communityUser = new CommunityUser("testGateway", "test", "test@ddsd");
+            certificateCredential.setCommunityUser(communityUser);
+            X509Certificate[] x509Certificates = new X509Certificate[1];
+            KeyStore ks = KeyStore.getInstance("JKS");
+            File keyStoreFile = new File("/Users/chathuri/dev/airavata/credential-store/oa4mp/airavata.jks");
+            FileInputStream fis = new FileInputStream(keyStoreFile);
+            char[] password = "airavata".toCharArray();
+            ks.load(fis,password);
+            x509Certificates[0] = (X509Certificate) ks.getCertificate("airavata");
+            Base64 encoder = new Base64(64);
+            String cert_begin = "-----BEGIN CERTIFICATE-----\n";
+            String end_cert = "-----END CERTIFICATE-----";
+            byte[] derCert = x509Certificates[0].getEncoded();
+            String pemCertPre = new String(encoder.encode(derCert));
+            String pemCert = cert_begin + pemCertPre + end_cert;
+            certificateCredential.setX509Cert(pemCert);
+            String token = client.addCertificateCredential(certificateCredential);
+            System.out.println("Certificate Token :" + token);
+            CertificateCredential credential = client.getCertificateCredential(token, "testGateway");
+            System.out.println("certificate : " + credential.getX509Cert());
+            System.out.println("gateway name  : " + credential.getCommunityUser().getGatewayNmae());
+        }catch (TTransportException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        } catch (KeyStoreException e) {
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (CertificateException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) {
+        TestSSLClient c = new TestSSLClient();
+        c.invoke();
+
+    }
+}


[56/62] [abbrv] airavata git commit: Missed a condition. AIRAVATA-1631

Posted by la...@apache.org.
Missed a condition. AIRAVATA-1631

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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: be1c6a0d07f1c0e4c21f7c082335703e1d940b3b
Parents: 5d7a034
Author: raminder <ra...@apache.org>
Authored: Mon Mar 16 14:38:26 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Mon Mar 16 14:38:26 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/be1c6a0d/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 6b20118..cc8a899 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -395,9 +395,8 @@ public class BetterGfacImpl implements GFac,Watcher {
                 	if(objectType.getLocation().startsWith(File.separator)){
                 		filePath = objectType.getLocation() + File.separator + filePath;
                     }else{
-                    	filePath = jobExecutionContext.getOutputDir() + File.separator + filePath;
+                    	filePath = jobExecutionContext.getOutputDir() + File.separator + objectType.getLocation()+ filePath;
                     }
-                	filePath = objectType.getLocation()+ filePath;
                 }
                 objectType.setValue(filePath);
                 


[22/62] [abbrv] airavata git commit: Change to GATEWAY_ID in credential store DOA

Posted by la...@apache.org.
Change to GATEWAY_ID in credential store DOA


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9d960f76
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9d960f76
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9d960f76

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 9d960f76b0f35a2f704d2af04a5af19d9cfd2ed4
Parents: b25e0a5
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 6 10:10:57 2015 -0500
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 6 10:10:57 2015 -0500

----------------------------------------------------------------------
 .../airavata/api/airavataAPIConstants.java      |  2 +-
 .../lib/airavata/airavataAPI_constants.cpp      |  2 +-
 .../main/resources/lib/Airavata/API/Types.php   |  2 +-
 .../client/samples/CreateLaunchExperiment.java  | 68 +++++++++++++++++---
 .../airavataAPI.thrift                          |  2 +-
 .../store/store/impl/db/CommunityUserDAO.java   | 10 +--
 .../registry/jpa/impl/RegistryImpl.java         |  1 +
 .../src/main/resources/registry-derby.sql       |  2 +-
 .../src/main/resources/registry-mysql.sql       |  2 +-
 .../src/test/resources/registry-derby.sql       |  2 +-
 10 files changed, 72 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
index 3685b9f..0c82e0f 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
@@ -65,6 +65,6 @@ import org.slf4j.LoggerFactory;
    *              in a change to major/minor version numbers.
    * 
    */
-  public static final String AIRAVATA_API_VERSION = "0.14.0";
+  public static final String AIRAVATA_API_VERSION = "0.15.0";
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
index 0161d32..ddc6179 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
@@ -28,7 +28,7 @@ namespace apache { namespace airavata { namespace api {
 const airavataAPIConstants g_airavataAPI_constants;
 
 airavataAPIConstants::airavataAPIConstants() {
-  AIRAVATA_API_VERSION = "0.14.0";
+  AIRAVATA_API_VERSION = "0.15.0";
 
 }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
index cb100bc..481421f 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
@@ -17,6 +17,6 @@ use Thrift\Protocol\TBinaryProtocolAccelerated;
 use Thrift\Exception\TApplicationException;
 
 
-$GLOBALS['airavataAPI_CONSTANTS']['AIRAVATA_API_VERSION'] = "0.14.0";
+$GLOBALS['airavataAPI_CONSTANTS']['AIRAVATA_API_VERSION'] = "0.15.0";
 
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index eb1b833..3fc74eb 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -36,6 +36,7 @@ import org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission
 import org.apache.airavata.model.error.*;
 import org.apache.airavata.model.util.ExperimentModelUtil;
 import org.apache.airavata.model.util.ProjectModelUtil;
+import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.thrift.TException;
@@ -60,7 +61,7 @@ public class CreateLaunchExperiment {
     private static String echoAppId = "Echo_f828a575-7f17-4149-9d45-abe2aa9c6109";
     private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
-    private static String amberAppId = "Amber_6321b79f-3891-4421-b6c0-e294043a302e";
+    private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
     private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
     private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
     private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f";
@@ -74,21 +75,70 @@ public class CreateLaunchExperiment {
     private static String unicoreHostName = "fsd-cloud15.zam.kfa-juelich.de";
     private static String stampedeHostName = "stampede.tacc.xsede.org";
     private static String br2HostName = "bigred2.uits.iu.edu";
+
+    private static String gatewayId;
     
  // unicore service endpoint url
     private static final String unicoreEndPointURL = "https://fsd-cloud15.zam.kfa-juelich.de:7000/INTEROP1/services/BESFactory?res=default_bes_factory";
     
     
     public static void main(String[] args) throws Exception {
-                airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
-                System.out.println("API version is " + airavataClient.getAPIVersion());
-//                registerApplications(); // run this only the first time
-                createAndLaunchExp();
+        airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
+        System.out.println("API version is " + airavataClient.getAPIVersion());
+//        createGateway();
+//        getGateway("testGatewayId");
+//      registerApplications(); // run this only the first time
+      createAndLaunchExp();
     }
     
     private static String fsdResourceId;
 
 
+    public static void createGateway(){
+        try {
+            Gateway gateway = new Gateway();
+            gateway.setGatewayId("testGatewayId2");
+            gateway.setGatewayName("testGateway2");
+            gatewayId = airavataClient.addGateway(gateway);
+            System.out.println(gatewayId);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    public static void getGateway(String gatewayId){
+        try {
+            Gateway gateway = airavataClient.getGateway(gatewayId);
+            gateway.setDomain("testDomain");
+            airavataClient.updateGateway(gatewayId, gateway);
+            List<Gateway> allGateways = airavataClient.getAllGateways();
+            System.out.println(allGateways.size());
+            if (airavataClient.isGatewayExist(gatewayId)){
+                Gateway gateway1 = airavataClient.getGateway(gatewayId);
+                System.out.println(gateway1.getGatewayName());
+            }
+            boolean b = airavataClient.deleteGateway("testGatewayId2");
+            System.out.println(b);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
     public static void createAndLaunchExp() throws TException {
 //        final String expId = createEchoExperimentForFSD(airavataClient);
         try {
@@ -115,7 +165,7 @@ public class CreateLaunchExperiment {
                 System.out.println("Experiment ID : " + expId);
 //                updateExperiment(airavata, expId);
 
-//                launchExperiment(airavataClient, expId);
+                launchExperiment(airavataClient, expId);
             }
         } catch (Exception e) {
             logger.error("Error while connecting with server", e.getMessage());
@@ -1437,11 +1487,11 @@ public class CreateLaunchExperiment {
 //			}
 			for (InputDataObjectType inputDataObjectType : exInputs) {
 					if (inputDataObjectType.getName().equalsIgnoreCase("Heat_Restart_File")) {
-						inputDataObjectType.setValue("file://root@test-drive.airavata.org:/var/www/experimentData/admin101a290e6330f15a91349159553ae8b6bb1/02_Heat.rst");
+						inputDataObjectType.setValue("/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES/02_Heat.rst");
 					} else if (inputDataObjectType.getName().equalsIgnoreCase("Production_Control_File")) {
-						inputDataObjectType.setValue("file://root@test-drive.airavata.org:/var/www/experimentData/admin101a290e6330f15a91349159553ae8b6bb1/03_Prod.in");
+						inputDataObjectType.setValue("/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES/03_Prod.in");
 					} else if (inputDataObjectType.getName().equalsIgnoreCase("Parameter_Topology_File")) {
-						inputDataObjectType.setValue("file://root@test-drive.airavata.org:/var/www/experimentData/admin101a290e6330f15a91349159553ae8b6bb1/prmtop");
+						inputDataObjectType.setValue("/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES/prmtop");
 					}
 			}
 			List<OutputDataObjectType> exOut = client.getApplicationOutputs(amberAppId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
index 6caf264..95a91e6 100644
--- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
@@ -55,7 +55,7 @@ namespace js ApacheAiravataAPI
  *              in a change to major/minor version numbers.
  *
 */
-const string AIRAVATA_API_VERSION = "0.14.0"
+const string AIRAVATA_API_VERSION = "0.15.0"
 
 service Airavata {
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
index f55cd55..931580a 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
@@ -78,7 +78,7 @@ public class CommunityUserDAO extends ParentDAO {
 
     public void deleteCommunityUser(CommunityUser user, Connection connection) throws CredentialStoreException {
 
-        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
+        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND COMMUNITY_USER_NAME=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -108,7 +108,7 @@ public class CommunityUserDAO extends ParentDAO {
     public void deleteCommunityUserByToken(CommunityUser user, String token, Connection connection)
             throws CredentialStoreException {
 
-        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=? AND TOKEN_ID=?";
+        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND COMMUNITY_USER_NAME=? AND TOKEN_ID=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -144,7 +144,7 @@ public class CommunityUserDAO extends ParentDAO {
     public CommunityUser getCommunityUser(String gatewayName, String communityUserName, Connection connection)
             throws CredentialStoreException {
 
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND COMMUNITY_USER_NAME=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -181,7 +181,7 @@ public class CommunityUserDAO extends ParentDAO {
     public CommunityUser getCommunityUserByToken(String gatewayName, String tokenId, Connection connection)
             throws CredentialStoreException {
 
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND TOKEN_ID=?";
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND TOKEN_ID=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -221,7 +221,7 @@ public class CommunityUserDAO extends ParentDAO {
 
         List<CommunityUser> userList = new ArrayList<CommunityUser>();
 
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=?";
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_ID=?";
 
         PreparedStatement preparedStatement = null;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
index d2af1cd..9dcf96f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
@@ -204,6 +204,7 @@ public class RegistryImpl implements Registry {
                     break;
                 case GATEWAY:
                     gatewayRegistry.updateGateway((String)identifier, (Gateway)newObjectToUpdate);
+                    break;
                 case EXPERIMENT:
                     experimentRegistry.updateExperiment((Experiment) newObjectToUpdate, (String) identifier);
                     break;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
index 9d02c3a..b7c8a7d 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
@@ -36,7 +36,7 @@ CREATE TABLE CONFIGURATION
         PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
 );
 
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.12', CURRENT_TIMESTAMP ,'SYSTEM');
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
 
 CREATE TABLE USERS
 (

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
index ec2fb42..442a47b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
@@ -36,7 +36,7 @@ CREATE TABLE CONFIGURATION
         PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
 );
 
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.12', CURRENT_TIMESTAMP ,'SYSTEM');
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
 
 CREATE TABLE USERS
 (

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
index 9d02c3a..b7c8a7d 100644
--- a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
@@ -36,7 +36,7 @@ CREATE TABLE CONFIGURATION
         PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
 );
 
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.12', CURRENT_TIMESTAMP ,'SYSTEM');
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
 
 CREATE TABLE USERS
 (


[31/62] [abbrv] airavata git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata

Posted by la...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/565b5a3f
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/565b5a3f
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/565b5a3f

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 565b5a3f4ec2a5e34334c2a63ee428a7ca3d0085
Parents: 5ff650f 9d80cf2
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Sat Mar 7 00:37:31 2015 -0500
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Sat Mar 7 00:37:31 2015 -0500

----------------------------------------------------------------------
 .../common/utils/DatabaseTestCases.java         |   2 +-
 .../main/resources/airavata-client.properties   |   2 +-
 .../main/resources/airavata-server.properties   |   6 +-
 .../credential/store/client/TestSSLClient.java  | 140 -------------------
 .../store/store/impl/db/SSHCredentialTest.java  |   2 +-
 .../credential-store-stubs/pom.xml              |   5 +
 .../credential/store/client/TestSSLClient.java  | 140 +++++++++++++++++++
 .../main/resources/airavata-server.properties   |   4 +-
 .../src/test/resources/jdbc-authenticator.xml   |   2 +-
 .../test/resources/session-authenticator.xml    |   2 +-
 tools/registry-tool/README                      |   2 +-
 11 files changed, 156 insertions(+), 151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/565b5a3f/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/airavata/blob/565b5a3f/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
----------------------------------------------------------------------
diff --cc modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
index 0000000,cc5ebb6..1d9f4d9
mode 000000,100644..100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
@@@ -1,0 -1,140 +1,140 @@@
+ /*
+  *
+  * 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.credential.store.client;
+ 
+ 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.ServerSettings;
+ import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+ import org.apache.airavata.credential.store.datamodel.CertificateCredential;
+ import org.apache.airavata.credential.store.datamodel.CommunityUser;
+ import org.apache.airavata.credential.store.datamodel.SSHCredential;
+ import org.apache.thrift.TException;
+ import org.apache.thrift.protocol.TBinaryProtocol;
+ import org.apache.thrift.protocol.TProtocol;
+ import org.apache.thrift.transport.TSSLTransportFactory;
+ import org.apache.thrift.transport.TTransport;
+ import org.apache.thrift.transport.TTransportException;
+ 
+ import java.io.File;
+ import java.io.FileInputStream;
+ import java.io.FileNotFoundException;
+ import java.io.IOException;
+ import java.security.KeyStore;
+ import java.security.KeyStoreException;
+ import java.security.NoSuchAlgorithmException;
+ import java.security.cert.CertificateException;
+ import java.security.cert.X509Certificate;
+ import org.apache.commons.codec.binary.Base64;
+ 
+ public class TestSSLClient {
+     private void invoke() {
+         TTransport transport;
+         try {
+             AiravataUtils.setExecutionAsServer();
+             TSSLTransportFactory.TSSLTransportParameters params =
+                     new TSSLTransportFactory.TSSLTransportParameters();
+             String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
+             String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
+             params.setTrustStore(keystorePath, keystorePWD);
+             final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_PORT, "8960"));
+             final String serverHost = ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_HOST, null);
+ 
+             transport = TSSLTransportFactory.getClientSocket(serverHost, serverPort, 10000, params);
+             TProtocol protocol = new TBinaryProtocol(transport);
+ 
+             CredentialStoreService.Client client = new CredentialStoreService.Client(protocol);
 -//            testSSHCredential(client);
++            testSSHCredential(client);
+             testCertificateCredential(client);
+             transport.close();
+         } catch (TTransportException e) {
+             e.printStackTrace();
+         }catch (ApplicationSettingsException e) {
+             e.printStackTrace();
+         }
+     }
+ 
+     public static void testSSHCredential (CredentialStoreService.Client client){
+         try {
+             SSHCredential sshCredential = new SSHCredential();
+             sshCredential.setUsername("test");
+             sshCredential.setGatewayId("testGateway");
+             sshCredential.setPassphrase("mypassphrase");
+             String token = client.addSSHCredential(sshCredential);
+             System.out.println("SSH Token :" + token);
+             SSHCredential credential = client.getSSHCredential(token, "testGateway");
+             System.out.println("private key : " + credential.getPrivateKey());
+             System.out.println("public key : " + credential.getPublicKey());
+         }catch (TTransportException e) {
+             e.printStackTrace();
+         } catch (TException e) {
+             e.printStackTrace();
+         }
+     }
+ 
+     public static void testCertificateCredential (CredentialStoreService.Client client){
+         try {
+             CertificateCredential certificateCredential = new CertificateCredential();
+             CommunityUser communityUser = new CommunityUser("testGateway", "test", "test@ddsd");
+             certificateCredential.setCommunityUser(communityUser);
+             X509Certificate[] x509Certificates = new X509Certificate[1];
+             KeyStore ks = KeyStore.getInstance("JKS");
+             File keyStoreFile = new File("/Users/smarru/code/airavata-master/modules/configuration/server/src/main/resources/airavata.jks");
+             FileInputStream fis = new FileInputStream(keyStoreFile);
+             char[] password = "airavata".toCharArray();
+             ks.load(fis,password);
+             x509Certificates[0] = (X509Certificate) ks.getCertificate("airavata");
+             Base64 encoder = new Base64(64);
+             String cert_begin = "-----BEGIN CERTIFICATE-----\n";
+             String end_cert = "-----END CERTIFICATE-----";
+             byte[] derCert = x509Certificates[0].getEncoded();
+             String pemCertPre = new String(encoder.encode(derCert));
+             String pemCert = cert_begin + pemCertPre + end_cert;
+             certificateCredential.setX509Cert(pemCert);
+             String token = client.addCertificateCredential(certificateCredential);
+             System.out.println("Certificate Token :" + token);
+             CertificateCredential credential = client.getCertificateCredential(token, "testGateway");
+             System.out.println("certificate : " + credential.getX509Cert());
+             System.out.println("gateway name  : " + credential.getCommunityUser().getGatewayName());
+         }catch (TTransportException e) {
+             e.printStackTrace();
+         } catch (TException e) {
+             e.printStackTrace();
+         } catch (KeyStoreException e) {
+             e.printStackTrace();
+         } catch (FileNotFoundException e) {
+             e.printStackTrace();
+         } catch (NoSuchAlgorithmException e) {
+             e.printStackTrace();
+         } catch (CertificateException e) {
+             e.printStackTrace();
+         } catch (IOException e) {
+             e.printStackTrace();
+         }
+     }
+ 
+     public static void main(String[] args) {
+         TestSSLClient c = new TestSSLClient();
+         c.invoke();
+ 
+     }
+ }


[52/62] [abbrv] airavata git commit: fixing AIRAVATA-1630

Posted by la...@apache.org.
fixing AIRAVATA-1630


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/990d72a1
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/990d72a1
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/990d72a1

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 990d72a1f007accea95d49a756cc5e10b20d924c
Parents: 757e8a3
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 13 14:35:57 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 13 14:35:57 2015 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java     | 7 +++++++
 .../java/org/apache/airavata/gfac/core/utils/GFacUtils.java   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/990d72a1/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 420df6d..2ff0338 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -210,6 +210,7 @@ public class BetterGfacImpl implements GFac,Watcher {
             return submitJob(jobExecutionContext);
         } catch (Exception e) {
             log.error("Error inovoking the job with experiment ID: " + experimentID);
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException(e);
         }
     }
@@ -495,10 +496,13 @@ public class BetterGfacImpl implements GFac,Watcher {
             }
             return true;
         } catch (ApplicationSettingsException e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException("Error launching the Job",e);
         } catch (KeeperException e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException("Error launching the Job",e);
         } catch (InterruptedException e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException("Error launching the Job",e);
         }
     }
@@ -509,6 +513,7 @@ public class BetterGfacImpl implements GFac,Watcher {
             jobExecutionContext = createJEC(experimentID, taskID, gatewayID);
             return cancel(jobExecutionContext);
         } catch (Exception e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             log.error("Error inovoking the job with experiment ID: " + experimentID);
             throw new GFacException(e);
         }
@@ -660,6 +665,7 @@ public class BetterGfacImpl implements GFac,Watcher {
                         jobExecutionContext.getExperimentID(),
                         jobExecutionContext.getGatewayID());
 				monitorPublisher.publish(new JobStatusChangeEvent(JobState.FAILED, jobIdentity));
+                GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
 			} catch (NullPointerException e1) {
 				log.error("Error occured during updating the statuses of Experiments,tasks or Job statuses to failed, "
 						+ "NullPointerException occurred because at this point there might not have Job Created", e1, e);
@@ -671,6 +677,7 @@ public class BetterGfacImpl implements GFac,Watcher {
                         jobExecutionContext.getExperimentID(),
                         jobExecutionContext.getGatewayID());
 				monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.FAILED, taskIdentity));
+                GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
 
 			}
 			jobExecutionContext.setProperty(ERROR_SENT, "true");

http://git-wip-us.apache.org/repos/asf/airavata/blob/990d72a1/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
index cbbce48..d30816e 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
@@ -792,7 +792,7 @@ public class GFacUtils {
 			CorrectiveAction action, ErrorCategory errorCatogory)
 			throws GFacException {
 		try {
-			Registry registry = RegistryFactory.getDefaultRegistry();
+			Registry registry = jobExecutionContext.getRegistry();
 			ErrorDetails details = new ErrorDetails();
 			details.setActualErrorMessage(errorMessage);
 			details.setCorrectiveAction(action);


[61/62] [abbrv] airavata git commit: fixing AIRAVATA-1638

Posted by la...@apache.org.
fixing AIRAVATA-1638


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/73f371d8
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/73f371d8
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/73f371d8

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 73f371d81fd3a3ceecf6d015ac98b17dffc1eec9
Parents: 7d57c09
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Thu Mar 19 10:03:28 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Thu Mar 19 10:03:28 2015 -0400

----------------------------------------------------------------------
 .../registry/jpa/impl/ExperimentRegistry.java   |  4 ++++
 .../jpa/model/ExperimentConfigData.java         | 20 ++++++++++++++++++
 .../jpa/resources/ConfigDataResource.java       | 22 ++++++++++++++++++++
 .../registry/jpa/resources/Utils.java           |  3 ++-
 .../registry/jpa/resources/WorkerResource.java  |  6 +++++-
 .../jpa/utils/ThriftDataModelConversion.java    |  2 ++
 .../src/main/resources/registry-derby.sql       |  2 ++
 .../src/main/resources/registry-mysql.sql       |  2 ++
 .../src/test/resources/registry-derby.sql       |  2 ++
 9 files changed, 61 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 0da148b..113a966 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -152,6 +152,8 @@ public class ExperimentRegistry {
             configData.setAiravataAutoSchedule(configurationData.isAiravataAutoSchedule());
             configData.setOverrideManualParams(configurationData.isOverrideManualScheduledParams());
             configData.setShareExp(configurationData.isShareExperimentPublicly());
+            configData.setUserDn(configurationData.getUserDN());
+            configData.setGenerateCert(configurationData.isGenerateCert());
             configData.save();
             ComputationalResourceScheduling resourceScheduling = configurationData.getComputationalResourceScheduling();
             if (resourceScheduling != null) {
@@ -1687,6 +1689,8 @@ public class ExperimentRegistry {
             resource.setAiravataAutoSchedule(configData.isAiravataAutoSchedule());
             resource.setOverrideManualParams(configData.isOverrideManualScheduledParams());
             resource.setShareExp(configData.isShareExperimentPublicly());
+            resource.setUserDn(configData.getUserDN());
+            resource.setGenerateCert(configData.isGenerateCert());
             resource.save();
             ComputationalResourceScheduling resourceScheduling = configData.getComputationalResourceScheduling();
             if (resourceScheduling != null) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
index 6ddbff7..63e91ad 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ExperimentConfigData.java
@@ -39,6 +39,10 @@ public class ExperimentConfigData implements Serializable {
     private boolean overrideManualParams;
     @Column(name = "SHARE_EXPERIMENT")
     private boolean shareExp;
+    @Column(name = "USER_DN")
+    private String userDn;
+    @Column(name = "GENERATE_CERT")
+    private boolean generateCert;
 
     @ManyToOne(cascade= CascadeType.MERGE)
     @JoinColumn(name = "EXPERIMENT_ID")
@@ -83,4 +87,20 @@ public class ExperimentConfigData implements Serializable {
     public void setExperiment(Experiment experiment) {
         this.experiment = experiment;
     }
+
+    public String getUserDn() {
+        return userDn;
+    }
+
+    public void setUserDn(String userDn) {
+        this.userDn = userDn;
+    }
+
+    public boolean isGenerateCert() {
+        return generateCert;
+    }
+
+    public void setGenerateCert(boolean generateCert) {
+        this.generateCert = generateCert;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
index c042eb6..c45ba07 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
@@ -39,6 +39,24 @@ public class ConfigDataResource extends AbstractResource {
     private boolean airavataAutoSchedule;
     private boolean overrideManualParams;
     private boolean shareExp;
+    private String userDn;
+    private boolean generateCert;
+
+    public String getUserDn() {
+        return userDn;
+    }
+
+    public void setUserDn(String userDn) {
+        this.userDn = userDn;
+    }
+
+    public boolean isGenerateCert() {
+        return generateCert;
+    }
+
+    public void setGenerateCert(boolean generateCert) {
+        this.generateCert = generateCert;
+    }
 
     public ExperimentResource getExperimentResource() {
         return experimentResource;
@@ -113,12 +131,16 @@ public class ConfigDataResource extends AbstractResource {
             configData.setAiravataAutoSchedule(airavataAutoSchedule);
             configData.setOverrideManualParams(overrideManualParams);
             configData.setShareExp(shareExp);
+            configData.setUserDn(userDn);
+            configData.setGenerateCert(generateCert);
             if (existingConfig != null) {
                 existingConfig.setExpId(experimentResource.getExpID());
                 existingConfig.setExperiment(experiment);
                 existingConfig.setAiravataAutoSchedule(airavataAutoSchedule);
                 existingConfig.setOverrideManualParams(overrideManualParams);
                 existingConfig.setShareExp(shareExp);
+                existingConfig.setUserDn(userDn);
+                existingConfig.setGenerateCert(generateCert);
                 configData = em.merge(existingConfig);
             } else {
                 em.persist(configData);

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
index 7c4850a..7bf6cfd 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
@@ -722,8 +722,9 @@ public class Utils {
             configDataResource.setAiravataAutoSchedule(o.isAiravataAutoSchedule());
             configDataResource.setOverrideManualParams(o.isOverrideManualParams());
             configDataResource.setShareExp(o.isShareExp());
+            configDataResource.setUserDn(o.getUserDn());
+            configDataResource.setGenerateCert(o.isGenerateCert());
         }
-
         return configDataResource;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
index e732566..2654596 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
@@ -461,7 +461,9 @@ public class WorkerResource extends AbstractResource {
                     String filterVal = filters.get(field);
                     if (field.equals(ProjectConstants.USERNAME)) {
                         query += "p." + field + "= '" + filterVal + "' AND ";
-                    } else {
+                    }else if (field.equals(ProjectConstants.GATEWAY_ID)) {
+                        query += "p." + field + "= '" + filterVal + "' AND ";
+                    }else {
                         if (filterVal.contains("*")){
                             filterVal = filterVal.replaceAll("\\*", "");
                         }
@@ -505,6 +507,8 @@ public class WorkerResource extends AbstractResource {
                     String filterVal = filters.get(field);
                     if (field.equals(ExperimentConstants.EXECUTION_USER)) {
                         query += "e." + field + "= '" + filterVal + "' AND ";
+                    }else if (field.equals(ExperimentConstants.GATEWAY_ID)) {
+                        query += "e." + field + "= '" + filterVal + "' AND ";
                     } else {
                         if (filterVal.contains("*")){
                             filterVal = filterVal.replaceAll("\\*", "");

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
index 95c0e29..101f98f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
@@ -625,6 +625,8 @@ public class ThriftDataModelConversion {
             data.setAiravataAutoSchedule(resource.isAiravataAutoSchedule());
             data.setOverrideManualScheduledParams(resource.isOverrideManualParams());
             data.setShareExperimentPublicly(resource.isShareExp());
+            data.setUserDN(resource.getUserDn());
+            data.setGenerateCert(resource.isGenerateCert());
             ExperimentResource experimentResource = resource.getExperimentResource();
             String expID = experimentResource.getExpID();
             if (experimentResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, expID)){

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
index 2fd1283..9ea8c37 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
@@ -301,6 +301,8 @@ CREATE TABLE CONFIG_DATA
         AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
         OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
         SHARE_EXPERIMENT SMALLINT,
+        USER_DN VARCHAR(255),
+        GENERATE_CERT SMALLINT,
         PRIMARY KEY(EXPERIMENT_ID)
 );
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
index 750067b..33db1d5 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
@@ -300,6 +300,8 @@ CREATE TABLE CONFIG_DATA
         AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
         OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
         SHARE_EXPERIMENT SMALLINT,
+        USER_DN VARCHAR(255),
+        GENERATE_CERT SMALLINT,
         PRIMARY KEY(EXPERIMENT_ID),
         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/73f371d8/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
index 2fd1283..9ea8c37 100644
--- a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
@@ -301,6 +301,8 @@ CREATE TABLE CONFIG_DATA
         AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
         OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
         SHARE_EXPERIMENT SMALLINT,
+        USER_DN VARCHAR(255),
+        GENERATE_CERT SMALLINT,
         PRIMARY KEY(EXPERIMENT_ID)
 );
 


[13/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
deleted file mode 100644
index f6b6837..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
+++ /dev/null
@@ -1,698 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class PasswordCredential implements org.apache.thrift.TBase<PasswordCredential, PasswordCredential._Fields>, java.io.Serializable, Cloneable, Comparable<PasswordCredential> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PasswordCredential");
-
-  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)3);
-  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new PasswordCredentialStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new PasswordCredentialTupleSchemeFactory());
-  }
-
-  public String username; // required
-  public String password; // required
-  public long persistedTime; // optional
-  public String token; // optional
-
-  /** 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 {
-    USERNAME((short)1, "username"),
-    PASSWORD((short)2, "password"),
-    PERSISTED_TIME((short)3, "persistedTime"),
-    TOKEN((short)4, "token");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // USERNAME
-          return USERNAME;
-        case 2: // PASSWORD
-          return PASSWORD;
-        case 3: // PERSISTED_TIME
-          return PERSISTED_TIME;
-        case 4: // TOKEN
-          return TOKEN;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __PERSISTEDTIME_ISSET_ID = 0;
-  private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.PERSISTED_TIME,_Fields.TOKEN};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PasswordCredential.class, metaDataMap);
-  }
-
-  public PasswordCredential() {
-  }
-
-  public PasswordCredential(
-    String username,
-    String password)
-  {
-    this();
-    this.username = username;
-    this.password = password;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public PasswordCredential(PasswordCredential other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetUsername()) {
-      this.username = other.username;
-    }
-    if (other.isSetPassword()) {
-      this.password = other.password;
-    }
-    this.persistedTime = other.persistedTime;
-    if (other.isSetToken()) {
-      this.token = other.token;
-    }
-  }
-
-  public PasswordCredential deepCopy() {
-    return new PasswordCredential(this);
-  }
-
-  @Override
-  public void clear() {
-    this.username = null;
-    this.password = null;
-    setPersistedTimeIsSet(false);
-    this.persistedTime = 0;
-    this.token = null;
-  }
-
-  public String getUsername() {
-    return this.username;
-  }
-
-  public PasswordCredential setUsername(String username) {
-    this.username = username;
-    return this;
-  }
-
-  public void unsetUsername() {
-    this.username = null;
-  }
-
-  /** Returns true if field username is set (has been assigned a value) and false otherwise */
-  public boolean isSetUsername() {
-    return this.username != null;
-  }
-
-  public void setUsernameIsSet(boolean value) {
-    if (!value) {
-      this.username = null;
-    }
-  }
-
-  public String getPassword() {
-    return this.password;
-  }
-
-  public PasswordCredential setPassword(String password) {
-    this.password = password;
-    return this;
-  }
-
-  public void unsetPassword() {
-    this.password = null;
-  }
-
-  /** Returns true if field password is set (has been assigned a value) and false otherwise */
-  public boolean isSetPassword() {
-    return this.password != null;
-  }
-
-  public void setPasswordIsSet(boolean value) {
-    if (!value) {
-      this.password = null;
-    }
-  }
-
-  public long getPersistedTime() {
-    return this.persistedTime;
-  }
-
-  public PasswordCredential setPersistedTime(long persistedTime) {
-    this.persistedTime = persistedTime;
-    setPersistedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetPersistedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetPersistedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  public void setPersistedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
-  }
-
-  public String getToken() {
-    return this.token;
-  }
-
-  public PasswordCredential setToken(String token) {
-    this.token = token;
-    return this;
-  }
-
-  public void unsetToken() {
-    this.token = null;
-  }
-
-  /** Returns true if field token is set (has been assigned a value) and false otherwise */
-  public boolean isSetToken() {
-    return this.token != null;
-  }
-
-  public void setTokenIsSet(boolean value) {
-    if (!value) {
-      this.token = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case USERNAME:
-      if (value == null) {
-        unsetUsername();
-      } else {
-        setUsername((String)value);
-      }
-      break;
-
-    case PASSWORD:
-      if (value == null) {
-        unsetPassword();
-      } else {
-        setPassword((String)value);
-      }
-      break;
-
-    case PERSISTED_TIME:
-      if (value == null) {
-        unsetPersistedTime();
-      } else {
-        setPersistedTime((Long)value);
-      }
-      break;
-
-    case TOKEN:
-      if (value == null) {
-        unsetToken();
-      } else {
-        setToken((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case USERNAME:
-      return getUsername();
-
-    case PASSWORD:
-      return getPassword();
-
-    case PERSISTED_TIME:
-      return Long.valueOf(getPersistedTime());
-
-    case TOKEN:
-      return getToken();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case USERNAME:
-      return isSetUsername();
-    case PASSWORD:
-      return isSetPassword();
-    case PERSISTED_TIME:
-      return isSetPersistedTime();
-    case TOKEN:
-      return isSetToken();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof PasswordCredential)
-      return this.equals((PasswordCredential)that);
-    return false;
-  }
-
-  public boolean equals(PasswordCredential that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_username = true && this.isSetUsername();
-    boolean that_present_username = true && that.isSetUsername();
-    if (this_present_username || that_present_username) {
-      if (!(this_present_username && that_present_username))
-        return false;
-      if (!this.username.equals(that.username))
-        return false;
-    }
-
-    boolean this_present_password = true && this.isSetPassword();
-    boolean that_present_password = true && that.isSetPassword();
-    if (this_present_password || that_present_password) {
-      if (!(this_present_password && that_present_password))
-        return false;
-      if (!this.password.equals(that.password))
-        return false;
-    }
-
-    boolean this_present_persistedTime = true && this.isSetPersistedTime();
-    boolean that_present_persistedTime = true && that.isSetPersistedTime();
-    if (this_present_persistedTime || that_present_persistedTime) {
-      if (!(this_present_persistedTime && that_present_persistedTime))
-        return false;
-      if (this.persistedTime != that.persistedTime)
-        return false;
-    }
-
-    boolean this_present_token = true && this.isSetToken();
-    boolean that_present_token = true && that.isSetToken();
-    if (this_present_token || that_present_token) {
-      if (!(this_present_token && that_present_token))
-        return false;
-      if (!this.token.equals(that.token))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(PasswordCredential other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUsername()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPassword()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPersistedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetToken()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("PasswordCredential(");
-    boolean first = true;
-
-    sb.append("username:");
-    if (this.username == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.username);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("password:");
-    if (this.password == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.password);
-    }
-    first = false;
-    if (isSetPersistedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("persistedTime:");
-      sb.append(this.persistedTime);
-      first = false;
-    }
-    if (isSetToken()) {
-      if (!first) sb.append(", ");
-      sb.append("token:");
-      if (this.token == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.token);
-      }
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (username == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
-    }
-    if (password == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'password' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class PasswordCredentialStandardSchemeFactory implements SchemeFactory {
-    public PasswordCredentialStandardScheme getScheme() {
-      return new PasswordCredentialStandardScheme();
-    }
-  }
-
-  private static class PasswordCredentialStandardScheme extends StandardScheme<PasswordCredential> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, PasswordCredential struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // USERNAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.username = iprot.readString();
-              struct.setUsernameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // PASSWORD
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.password = iprot.readString();
-              struct.setPasswordIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // PERSISTED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.persistedTime = iprot.readI64();
-              struct.setPersistedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // TOKEN
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.token = iprot.readString();
-              struct.setTokenIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, PasswordCredential struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.username != null) {
-        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
-        oprot.writeString(struct.username);
-        oprot.writeFieldEnd();
-      }
-      if (struct.password != null) {
-        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
-        oprot.writeString(struct.password);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.persistedTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.token != null) {
-        if (struct.isSetToken()) {
-          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
-          oprot.writeString(struct.token);
-          oprot.writeFieldEnd();
-        }
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class PasswordCredentialTupleSchemeFactory implements SchemeFactory {
-    public PasswordCredentialTupleScheme getScheme() {
-      return new PasswordCredentialTupleScheme();
-    }
-  }
-
-  private static class PasswordCredentialTupleScheme extends TupleScheme<PasswordCredential> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.username);
-      oprot.writeString(struct.password);
-      BitSet optionals = new BitSet();
-      if (struct.isSetPersistedTime()) {
-        optionals.set(0);
-      }
-      if (struct.isSetToken()) {
-        optionals.set(1);
-      }
-      oprot.writeBitSet(optionals, 2);
-      if (struct.isSetPersistedTime()) {
-        oprot.writeI64(struct.persistedTime);
-      }
-      if (struct.isSetToken()) {
-        oprot.writeString(struct.token);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.username = iprot.readString();
-      struct.setUsernameIsSet(true);
-      struct.password = iprot.readString();
-      struct.setPasswordIsSet(true);
-      BitSet incoming = iprot.readBitSet(2);
-      if (incoming.get(0)) {
-        struct.persistedTime = iprot.readI64();
-        struct.setPersistedTimeIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.token = iprot.readString();
-        struct.setTokenIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
deleted file mode 100644
index 9fc373a..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
+++ /dev/null
@@ -1,998 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class SSHCredential implements org.apache.thrift.TBase<SSHCredential, SSHCredential._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredential> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredential");
-
-  private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField PASSPHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("passphrase", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField PUBLIC_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("publicKey", org.apache.thrift.protocol.TType.STRING, (short)4);
-  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)5);
-  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)6);
-  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)7);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new SSHCredentialStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new SSHCredentialTupleSchemeFactory());
-  }
-
-  public String gatewayId; // required
-  public String username; // required
-  public String passphrase; // required
-  public String publicKey; // optional
-  public String privateKey; // optional
-  public long persistedTime; // optional
-  public String token; // optional
-
-  /** 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 {
-    GATEWAY_ID((short)1, "gatewayId"),
-    USERNAME((short)2, "username"),
-    PASSPHRASE((short)3, "passphrase"),
-    PUBLIC_KEY((short)4, "publicKey"),
-    PRIVATE_KEY((short)5, "privateKey"),
-    PERSISTED_TIME((short)6, "persistedTime"),
-    TOKEN((short)7, "token");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // GATEWAY_ID
-          return GATEWAY_ID;
-        case 2: // USERNAME
-          return USERNAME;
-        case 3: // PASSPHRASE
-          return PASSPHRASE;
-        case 4: // PUBLIC_KEY
-          return PUBLIC_KEY;
-        case 5: // PRIVATE_KEY
-          return PRIVATE_KEY;
-        case 6: // PERSISTED_TIME
-          return PERSISTED_TIME;
-        case 7: // TOKEN
-          return TOKEN;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __PERSISTEDTIME_ISSET_ID = 0;
-  private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.PUBLIC_KEY,_Fields.PRIVATE_KEY,_Fields.PERSISTED_TIME,_Fields.TOKEN};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PASSPHRASE, new org.apache.thrift.meta_data.FieldMetaData("passphrase", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PUBLIC_KEY, new org.apache.thrift.meta_data.FieldMetaData("publicKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SSHCredential.class, metaDataMap);
-  }
-
-  public SSHCredential() {
-  }
-
-  public SSHCredential(
-    String gatewayId,
-    String username,
-    String passphrase)
-  {
-    this();
-    this.gatewayId = gatewayId;
-    this.username = username;
-    this.passphrase = passphrase;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public SSHCredential(SSHCredential other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetGatewayId()) {
-      this.gatewayId = other.gatewayId;
-    }
-    if (other.isSetUsername()) {
-      this.username = other.username;
-    }
-    if (other.isSetPassphrase()) {
-      this.passphrase = other.passphrase;
-    }
-    if (other.isSetPublicKey()) {
-      this.publicKey = other.publicKey;
-    }
-    if (other.isSetPrivateKey()) {
-      this.privateKey = other.privateKey;
-    }
-    this.persistedTime = other.persistedTime;
-    if (other.isSetToken()) {
-      this.token = other.token;
-    }
-  }
-
-  public SSHCredential deepCopy() {
-    return new SSHCredential(this);
-  }
-
-  @Override
-  public void clear() {
-    this.gatewayId = null;
-    this.username = null;
-    this.passphrase = null;
-    this.publicKey = null;
-    this.privateKey = null;
-    setPersistedTimeIsSet(false);
-    this.persistedTime = 0;
-    this.token = null;
-  }
-
-  public String getGatewayId() {
-    return this.gatewayId;
-  }
-
-  public SSHCredential setGatewayId(String gatewayId) {
-    this.gatewayId = gatewayId;
-    return this;
-  }
-
-  public void unsetGatewayId() {
-    this.gatewayId = null;
-  }
-
-  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
-  public boolean isSetGatewayId() {
-    return this.gatewayId != null;
-  }
-
-  public void setGatewayIdIsSet(boolean value) {
-    if (!value) {
-      this.gatewayId = null;
-    }
-  }
-
-  public String getUsername() {
-    return this.username;
-  }
-
-  public SSHCredential setUsername(String username) {
-    this.username = username;
-    return this;
-  }
-
-  public void unsetUsername() {
-    this.username = null;
-  }
-
-  /** Returns true if field username is set (has been assigned a value) and false otherwise */
-  public boolean isSetUsername() {
-    return this.username != null;
-  }
-
-  public void setUsernameIsSet(boolean value) {
-    if (!value) {
-      this.username = null;
-    }
-  }
-
-  public String getPassphrase() {
-    return this.passphrase;
-  }
-
-  public SSHCredential setPassphrase(String passphrase) {
-    this.passphrase = passphrase;
-    return this;
-  }
-
-  public void unsetPassphrase() {
-    this.passphrase = null;
-  }
-
-  /** Returns true if field passphrase is set (has been assigned a value) and false otherwise */
-  public boolean isSetPassphrase() {
-    return this.passphrase != null;
-  }
-
-  public void setPassphraseIsSet(boolean value) {
-    if (!value) {
-      this.passphrase = null;
-    }
-  }
-
-  public String getPublicKey() {
-    return this.publicKey;
-  }
-
-  public SSHCredential setPublicKey(String publicKey) {
-    this.publicKey = publicKey;
-    return this;
-  }
-
-  public void unsetPublicKey() {
-    this.publicKey = null;
-  }
-
-  /** Returns true if field publicKey is set (has been assigned a value) and false otherwise */
-  public boolean isSetPublicKey() {
-    return this.publicKey != null;
-  }
-
-  public void setPublicKeyIsSet(boolean value) {
-    if (!value) {
-      this.publicKey = null;
-    }
-  }
-
-  public String getPrivateKey() {
-    return this.privateKey;
-  }
-
-  public SSHCredential setPrivateKey(String privateKey) {
-    this.privateKey = privateKey;
-    return this;
-  }
-
-  public void unsetPrivateKey() {
-    this.privateKey = null;
-  }
-
-  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
-  public boolean isSetPrivateKey() {
-    return this.privateKey != null;
-  }
-
-  public void setPrivateKeyIsSet(boolean value) {
-    if (!value) {
-      this.privateKey = null;
-    }
-  }
-
-  public long getPersistedTime() {
-    return this.persistedTime;
-  }
-
-  public SSHCredential setPersistedTime(long persistedTime) {
-    this.persistedTime = persistedTime;
-    setPersistedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetPersistedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetPersistedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  public void setPersistedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
-  }
-
-  public String getToken() {
-    return this.token;
-  }
-
-  public SSHCredential setToken(String token) {
-    this.token = token;
-    return this;
-  }
-
-  public void unsetToken() {
-    this.token = null;
-  }
-
-  /** Returns true if field token is set (has been assigned a value) and false otherwise */
-  public boolean isSetToken() {
-    return this.token != null;
-  }
-
-  public void setTokenIsSet(boolean value) {
-    if (!value) {
-      this.token = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case GATEWAY_ID:
-      if (value == null) {
-        unsetGatewayId();
-      } else {
-        setGatewayId((String)value);
-      }
-      break;
-
-    case USERNAME:
-      if (value == null) {
-        unsetUsername();
-      } else {
-        setUsername((String)value);
-      }
-      break;
-
-    case PASSPHRASE:
-      if (value == null) {
-        unsetPassphrase();
-      } else {
-        setPassphrase((String)value);
-      }
-      break;
-
-    case PUBLIC_KEY:
-      if (value == null) {
-        unsetPublicKey();
-      } else {
-        setPublicKey((String)value);
-      }
-      break;
-
-    case PRIVATE_KEY:
-      if (value == null) {
-        unsetPrivateKey();
-      } else {
-        setPrivateKey((String)value);
-      }
-      break;
-
-    case PERSISTED_TIME:
-      if (value == null) {
-        unsetPersistedTime();
-      } else {
-        setPersistedTime((Long)value);
-      }
-      break;
-
-    case TOKEN:
-      if (value == null) {
-        unsetToken();
-      } else {
-        setToken((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case GATEWAY_ID:
-      return getGatewayId();
-
-    case USERNAME:
-      return getUsername();
-
-    case PASSPHRASE:
-      return getPassphrase();
-
-    case PUBLIC_KEY:
-      return getPublicKey();
-
-    case PRIVATE_KEY:
-      return getPrivateKey();
-
-    case PERSISTED_TIME:
-      return Long.valueOf(getPersistedTime());
-
-    case TOKEN:
-      return getToken();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case GATEWAY_ID:
-      return isSetGatewayId();
-    case USERNAME:
-      return isSetUsername();
-    case PASSPHRASE:
-      return isSetPassphrase();
-    case PUBLIC_KEY:
-      return isSetPublicKey();
-    case PRIVATE_KEY:
-      return isSetPrivateKey();
-    case PERSISTED_TIME:
-      return isSetPersistedTime();
-    case TOKEN:
-      return isSetToken();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof SSHCredential)
-      return this.equals((SSHCredential)that);
-    return false;
-  }
-
-  public boolean equals(SSHCredential that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_gatewayId = true && this.isSetGatewayId();
-    boolean that_present_gatewayId = true && that.isSetGatewayId();
-    if (this_present_gatewayId || that_present_gatewayId) {
-      if (!(this_present_gatewayId && that_present_gatewayId))
-        return false;
-      if (!this.gatewayId.equals(that.gatewayId))
-        return false;
-    }
-
-    boolean this_present_username = true && this.isSetUsername();
-    boolean that_present_username = true && that.isSetUsername();
-    if (this_present_username || that_present_username) {
-      if (!(this_present_username && that_present_username))
-        return false;
-      if (!this.username.equals(that.username))
-        return false;
-    }
-
-    boolean this_present_passphrase = true && this.isSetPassphrase();
-    boolean that_present_passphrase = true && that.isSetPassphrase();
-    if (this_present_passphrase || that_present_passphrase) {
-      if (!(this_present_passphrase && that_present_passphrase))
-        return false;
-      if (!this.passphrase.equals(that.passphrase))
-        return false;
-    }
-
-    boolean this_present_publicKey = true && this.isSetPublicKey();
-    boolean that_present_publicKey = true && that.isSetPublicKey();
-    if (this_present_publicKey || that_present_publicKey) {
-      if (!(this_present_publicKey && that_present_publicKey))
-        return false;
-      if (!this.publicKey.equals(that.publicKey))
-        return false;
-    }
-
-    boolean this_present_privateKey = true && this.isSetPrivateKey();
-    boolean that_present_privateKey = true && that.isSetPrivateKey();
-    if (this_present_privateKey || that_present_privateKey) {
-      if (!(this_present_privateKey && that_present_privateKey))
-        return false;
-      if (!this.privateKey.equals(that.privateKey))
-        return false;
-    }
-
-    boolean this_present_persistedTime = true && this.isSetPersistedTime();
-    boolean that_present_persistedTime = true && that.isSetPersistedTime();
-    if (this_present_persistedTime || that_present_persistedTime) {
-      if (!(this_present_persistedTime && that_present_persistedTime))
-        return false;
-      if (this.persistedTime != that.persistedTime)
-        return false;
-    }
-
-    boolean this_present_token = true && this.isSetToken();
-    boolean that_present_token = true && that.isSetToken();
-    if (this_present_token || that_present_token) {
-      if (!(this_present_token && that_present_token))
-        return false;
-      if (!this.token.equals(that.token))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(SSHCredential other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGatewayId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUsername()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPassphrase()).compareTo(other.isSetPassphrase());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPassphrase()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passphrase, other.passphrase);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPublicKey()).compareTo(other.isSetPublicKey());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPublicKey()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.publicKey, other.publicKey);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPrivateKey()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPersistedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetToken()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("SSHCredential(");
-    boolean first = true;
-
-    sb.append("gatewayId:");
-    if (this.gatewayId == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.gatewayId);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("username:");
-    if (this.username == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.username);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("passphrase:");
-    if (this.passphrase == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.passphrase);
-    }
-    first = false;
-    if (isSetPublicKey()) {
-      if (!first) sb.append(", ");
-      sb.append("publicKey:");
-      if (this.publicKey == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.publicKey);
-      }
-      first = false;
-    }
-    if (isSetPrivateKey()) {
-      if (!first) sb.append(", ");
-      sb.append("privateKey:");
-      if (this.privateKey == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.privateKey);
-      }
-      first = false;
-    }
-    if (isSetPersistedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("persistedTime:");
-      sb.append(this.persistedTime);
-      first = false;
-    }
-    if (isSetToken()) {
-      if (!first) sb.append(", ");
-      sb.append("token:");
-      if (this.token == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.token);
-      }
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (gatewayId == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
-    }
-    if (username == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
-    }
-    if (passphrase == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'passphrase' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class SSHCredentialStandardSchemeFactory implements SchemeFactory {
-    public SSHCredentialStandardScheme getScheme() {
-      return new SSHCredentialStandardScheme();
-    }
-  }
-
-  private static class SSHCredentialStandardScheme extends StandardScheme<SSHCredential> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, SSHCredential struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // GATEWAY_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.gatewayId = iprot.readString();
-              struct.setGatewayIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // USERNAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.username = iprot.readString();
-              struct.setUsernameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // PASSPHRASE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.passphrase = iprot.readString();
-              struct.setPassphraseIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // PUBLIC_KEY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.publicKey = iprot.readString();
-              struct.setPublicKeyIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // PRIVATE_KEY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.privateKey = iprot.readString();
-              struct.setPrivateKeyIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // PERSISTED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.persistedTime = iprot.readI64();
-              struct.setPersistedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 7: // TOKEN
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.token = iprot.readString();
-              struct.setTokenIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, SSHCredential struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.gatewayId != null) {
-        oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
-        oprot.writeString(struct.gatewayId);
-        oprot.writeFieldEnd();
-      }
-      if (struct.username != null) {
-        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
-        oprot.writeString(struct.username);
-        oprot.writeFieldEnd();
-      }
-      if (struct.passphrase != null) {
-        oprot.writeFieldBegin(PASSPHRASE_FIELD_DESC);
-        oprot.writeString(struct.passphrase);
-        oprot.writeFieldEnd();
-      }
-      if (struct.publicKey != null) {
-        if (struct.isSetPublicKey()) {
-          oprot.writeFieldBegin(PUBLIC_KEY_FIELD_DESC);
-          oprot.writeString(struct.publicKey);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.privateKey != null) {
-        if (struct.isSetPrivateKey()) {
-          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
-          oprot.writeString(struct.privateKey);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.persistedTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.token != null) {
-        if (struct.isSetToken()) {
-          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
-          oprot.writeString(struct.token);
-          oprot.writeFieldEnd();
-        }
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class SSHCredentialTupleSchemeFactory implements SchemeFactory {
-    public SSHCredentialTupleScheme getScheme() {
-      return new SSHCredentialTupleScheme();
-    }
-  }
-
-  private static class SSHCredentialTupleScheme extends TupleScheme<SSHCredential> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.gatewayId);
-      oprot.writeString(struct.username);
-      oprot.writeString(struct.passphrase);
-      BitSet optionals = new BitSet();
-      if (struct.isSetPublicKey()) {
-        optionals.set(0);
-      }
-      if (struct.isSetPrivateKey()) {
-        optionals.set(1);
-      }
-      if (struct.isSetPersistedTime()) {
-        optionals.set(2);
-      }
-      if (struct.isSetToken()) {
-        optionals.set(3);
-      }
-      oprot.writeBitSet(optionals, 4);
-      if (struct.isSetPublicKey()) {
-        oprot.writeString(struct.publicKey);
-      }
-      if (struct.isSetPrivateKey()) {
-        oprot.writeString(struct.privateKey);
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeI64(struct.persistedTime);
-      }
-      if (struct.isSetToken()) {
-        oprot.writeString(struct.token);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.gatewayId = iprot.readString();
-      struct.setGatewayIdIsSet(true);
-      struct.username = iprot.readString();
-      struct.setUsernameIsSet(true);
-      struct.passphrase = iprot.readString();
-      struct.setPassphraseIsSet(true);
-      BitSet incoming = iprot.readBitSet(4);
-      if (incoming.get(0)) {
-        struct.publicKey = iprot.readString();
-        struct.setPublicKeyIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.privateKey = iprot.readString();
-        struct.setPrivateKeyIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.persistedTime = iprot.readI64();
-        struct.setPersistedTimeIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.token = iprot.readString();
-        struct.setTokenIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
deleted file mode 100644
index b17513a..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
+++ /dev/null
@@ -1,55 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class csDataModelConstants {
-
-  public static final String DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS";
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
deleted file mode 100644
index 7be01da..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
+++ /dev/null
@@ -1,397 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.exception;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CredentialStoreException extends TException implements org.apache.thrift.TBase<CredentialStoreException, CredentialStoreException._Fields>, java.io.Serializable, Cloneable, Comparable<CredentialStoreException> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CredentialStoreException");
-
-  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new CredentialStoreExceptionStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new CredentialStoreExceptionTupleSchemeFactory());
-  }
-
-  public String message; // 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 {
-    MESSAGE((short)1, "message");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // MESSAGE
-          return MESSAGE;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(CredentialStoreException.class, metaDataMap);
-  }
-
-  public CredentialStoreException() {
-  }
-
-  public CredentialStoreException(
-    String message)
-  {
-    this();
-    this.message = message;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public CredentialStoreException(CredentialStoreException other) {
-    if (other.isSetMessage()) {
-      this.message = other.message;
-    }
-  }
-
-  public CredentialStoreException deepCopy() {
-    return new CredentialStoreException(this);
-  }
-
-  @Override
-  public void clear() {
-    this.message = null;
-  }
-
-  public String getMessage() {
-    return this.message;
-  }
-
-  public CredentialStoreException setMessage(String message) {
-    this.message = message;
-    return this;
-  }
-
-  public void unsetMessage() {
-    this.message = null;
-  }
-
-  /** Returns true if field message is set (has been assigned a value) and false otherwise */
-  public boolean isSetMessage() {
-    return this.message != null;
-  }
-
-  public void setMessageIsSet(boolean value) {
-    if (!value) {
-      this.message = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case MESSAGE:
-      if (value == null) {
-        unsetMessage();
-      } else {
-        setMessage((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case MESSAGE:
-      return getMessage();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case MESSAGE:
-      return isSetMessage();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof CredentialStoreException)
-      return this.equals((CredentialStoreException)that);
-    return false;
-  }
-
-  public boolean equals(CredentialStoreException that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_message = true && this.isSetMessage();
-    boolean that_present_message = true && that.isSetMessage();
-    if (this_present_message || that_present_message) {
-      if (!(this_present_message && that_present_message))
-        return false;
-      if (!this.message.equals(that.message))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(CredentialStoreException other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetMessage()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("CredentialStoreException(");
-    boolean first = true;
-
-    sb.append("message:");
-    if (this.message == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.message);
-    }
-    first = false;
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (message == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class CredentialStoreExceptionStandardSchemeFactory implements SchemeFactory {
-    public CredentialStoreExceptionStandardScheme getScheme() {
-      return new CredentialStoreExceptionStandardScheme();
-    }
-  }
-
-  private static class CredentialStoreExceptionStandardScheme extends StandardScheme<CredentialStoreException> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // MESSAGE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.message = iprot.readString();
-              struct.setMessageIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.message != null) {
-        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
-        oprot.writeString(struct.message);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class CredentialStoreExceptionTupleSchemeFactory implements SchemeFactory {
-    public CredentialStoreExceptionTupleScheme getScheme() {
-      return new CredentialStoreExceptionTupleScheme();
-    }
-  }
-
-  private static class CredentialStoreExceptionTupleScheme extends TupleScheme<CredentialStoreException> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.message);
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.message = iprot.readString();
-      struct.setMessageIsSet(true);
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java
deleted file mode 100644
index 62b6e27..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/CredentialStoreNotifier.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.airavata.credential.store.notifier;/*
- *
- * 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.
- *
- */
-
-
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-
-/**
- * This class is used to notify particular entity with expiring credentials.
- * The default implementation uses email messages.
- * User: AmilaJ (amilaj@apache.org)
- * Date: 12/3/13
- * Time: 4:17 PM
- */
-public interface CredentialStoreNotifier {
-
-    /**
-     * The specific notifier implementation needs to implement following method.
-     * This method should actually deliver message to desired entity.
-     * @param message The actual message encapsulated
-     * @throws CredentialStoreException
-     */
-    void notifyMessage(NotificationMessage message) throws CredentialStoreException;
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java
deleted file mode 100644
index 96f0bd9..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotificationMessage.java
+++ /dev/null
@@ -1,46 +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.credential.store.notifier;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 12/3/13
- * Time: 4:21 PM
- */
-
-/**
- * Encapsulates the notification message.
- * Usually says particular credential is expiring and need to renew.
- */
-public class NotificationMessage {
-
-    protected String message;
-
-    public NotificationMessage(String msg) {
-        this.message = msg;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java
deleted file mode 100644
index de84ae2..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/NotifierBootstrap.java
+++ /dev/null
@@ -1,144 +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.credential.store.notifier;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 12/27/13
- * Time: 2:22 PM
- */
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.credential.store.credential.CommunityUser;
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential;
-import org.apache.airavata.credential.store.notifier.impl.EmailNotificationMessage;
-import org.apache.airavata.credential.store.notifier.impl.EmailNotifier;
-import org.apache.airavata.credential.store.notifier.impl.EmailNotifierConfiguration;
-import org.apache.airavata.credential.store.store.CredentialReader;
-import org.apache.airavata.credential.store.store.CredentialStoreException;
-import org.apache.airavata.credential.store.store.impl.CredentialReaderImpl;
-import org.apache.airavata.credential.store.util.Utility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * This class runs a timer. Periodically it checks for expiring credentials.
- * Then if there are expiring credentials this will send an email.
- */
-public class NotifierBootstrap extends TimerTask {
-
-    private static boolean enabled = false;
-
-    private static String MESSAGE = "Credentials for community user {0} expires at {1}";
-    private static String SUBJECT = "Expiring credentials for user {0}";
-
-    private DBUtil dbUtil;
-
-    private long period;
-
-    protected static Logger log = LoggerFactory.getLogger(NotifierBootstrap.class);
-
-
-    private CredentialStoreNotifier credentialStoreNotifier;
-
-    public NotifierBootstrap(long period, DBUtil db, EmailNotifierConfiguration configuration) {
-        this.period = period;
-
-        // bootstrap
-        if (enabled) {
-            Timer timer = new Timer();
-            timer.scheduleAtFixedRate(this, 0, period);
-        }
-
-        this.dbUtil = db;
-
-        this.credentialStoreNotifier = new EmailNotifier(configuration);
-    }
-
-
-
-    public long getPeriod() {
-        return period;
-    }
-
-    public void setPeriod(long period) {
-        this.period = period;
-    }
-
-    public static boolean isEnabled() {
-        return enabled;
-    }
-
-    public static void setEnabled(boolean enabled) {
-        NotifierBootstrap.enabled = enabled;
-    }
-
-    @Override
-    public void run() {
-
-        if (!enabled)
-            return;
-
-        // retrieve OA4MP credentials
-        try {
-            CredentialReader credentialReader = new CredentialReaderImpl(this.dbUtil);
-            List<Credential> credentials = credentialReader.getAllCredentials();
-
-            for(Credential credential : credentials) {
-                if (credential instanceof CertificateCredential) {
-                    CertificateCredential certificateCredential = (CertificateCredential)credential;
-
-                    Date date = Utility.convertStringToDate(certificateCredential.getNotAfter());
-                    date.setDate(date.getDate() + 1);    // gap is 1 days
-
-                    Date currentDate = new Date();
-                    if (currentDate.after(date)) {
-                        // Send an email
-                        CommunityUser communityUser = certificateCredential.getCommunityUser();
-                        String body =
-                                String.format(MESSAGE, communityUser.getUserName(), certificateCredential.getNotAfter());
-                        String subject = String.format(SUBJECT, communityUser.getUserName());
-                        NotificationMessage notificationMessage
-                                = new EmailNotificationMessage(subject, communityUser.getUserEmail(), body);
-
-                        this.credentialStoreNotifier.notifyMessage(notificationMessage);
-
-                    }
-                }
-            }
-
-        } catch (ApplicationSettingsException e) {
-            log.error("Error configuring email senders.", e);
-        } catch (CredentialStoreException e) {
-            log.error("Error sending emails about credential expiring.", e);
-        } catch (ParseException e) {
-            log.error("Error parsing date time when sending emails", e);
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java
deleted file mode 100644
index ffd84c8..0000000
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/notifier/impl/EmailNotificationMessage.java
+++ /dev/null
@@ -1,58 +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.credential.store.notifier.impl;
-
-import org.apache.airavata.credential.store.notifier.NotificationMessage;
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 12/3/13
- * Time: 5:01 PM
- */
-
-public class EmailNotificationMessage extends NotificationMessage {
-
-    public EmailNotificationMessage(String subject, String senderEmail, String msg) {
-        super(msg);
-        this.subject = subject;
-        this.senderEmail = senderEmail;
-    }
-
-    private String subject;
-    private String senderEmail;
-
-    public String getSubject() {
-        return subject;
-    }
-
-    public void setSubject(String subject) {
-        this.subject = subject;
-    }
-
-    public String getSenderEmail() {
-        return senderEmail;
-    }
-
-    public void setSenderEmail(String senderEmail) {
-        this.senderEmail = senderEmail;
-    }
-}


[30/62] [abbrv] airavata git commit: adding lsf support with tests

Posted by la...@apache.org.
adding lsf support with tests


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/5ff650f4
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/5ff650f4
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/5ff650f4

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 5ff650f4c61a9ee7bfcf6f15ea984d74d545ec32
Parents: e9468ca
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Sat Mar 7 00:37:06 2015 -0500
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Sat Mar 7 00:37:06 2015 -0500

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  |  73 +++++-
 .../tools/RegisterSampleApplications.java       |  53 +++-
 .../server/src/main/resources/LSFTemplate.xslt  |  43 ++--
 .../server/src/main/resources/PBSTemplate.xslt  |   3 +-
 .../credential/store/client/TestSSLClient.java  |   2 +-
 .../store/store/impl/db/SSHCredentialTest.java  |   6 +-
 .../test/resources/airavata-server.properties   | 254 +++++++++++++++++++
 .../server/src/main/assembly/bin-assembly.xml   |   1 +
 .../airavata/gfac/server/GfacServerHandler.java |   1 -
 .../org/apache/airavata/gfac/RequestData.java   |   2 +
 .../gfac/gsissh/util/GFACGSISSHUtils.java       |  10 +-
 .../airavata/gfac/ssh/util/GFACSSHUtils.java    |  23 +-
 .../ssh/api/job/JobManagerConfiguration.java    |   9 +-
 .../gsi/ssh/api/job/LSFJobConfiguration.java    |  18 +-
 .../gsi/ssh/api/job/LSFOutputParser.java        |   1 +
 .../gsi/ssh/api/job/PBSJobConfiguration.java    |  15 ++
 .../gsi/ssh/api/job/SlurmJobConfiguration.java  |  15 ++
 .../gsi/ssh/impl/GSISSHAbstractCluster.java     |  10 +-
 .../airavata/gsi/ssh/impl/RawCommandInfo.java   |   8 +-
 .../impl/DefaultSSHApiTestWithMyProxyAuth.java  |  15 +-
 20 files changed, 500 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 3fc74eb..bb2ae6e 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -58,7 +58,7 @@ public class CreateLaunchExperiment {
     private static final String DEFAULT_GATEWAY = "php_reference_gateway";
     private static Airavata.Client airavataClient;
 
-    private static String echoAppId = "Echo_f828a575-7f17-4149-9d45-abe2aa9c6109";
+    private static String echoAppId = "Echo_802454e5-6358-4371-9a04-3d5d59cecbc7";
     private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
     private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
@@ -69,15 +69,15 @@ public class CreateLaunchExperiment {
     private static String trinityAppId = "Trinity_e894acf5-9bca-46e8-a1bd-7e2d5155191a";
     private static String autodockAppId = "AutoDock_43d9fdd0-c404-49f4-b913-3abf9080a8c9";
 
-
     private static String localHost = "localhost";
     private static String trestlesHostName = "trestles.sdsc.xsede.org";
     private static String unicoreHostName = "fsd-cloud15.zam.kfa-juelich.de";
     private static String stampedeHostName = "stampede.tacc.xsede.org";
     private static String br2HostName = "bigred2.uits.iu.edu";
+    private static String umassrcHostName = "ghpcc06.umassrc.org";
 
     private static String gatewayId;
-    
+
  // unicore service endpoint url
     private static final String unicoreEndPointURL = "https://fsd-cloud15.zam.kfa-juelich.de:7000/INTEROP1/services/BESFactory?res=default_bes_factory";
     
@@ -88,7 +88,7 @@ public class CreateLaunchExperiment {
 //        createGateway();
 //        getGateway("testGatewayId");
 //      registerApplications(); // run this only the first time
-      createAndLaunchExp();
+        createAndLaunchExp();
     }
     
     private static String fsdResourceId;
@@ -154,13 +154,14 @@ public class CreateLaunchExperiment {
 //                final String expId = createExperimentForBR2Amber(airavataClient);
 //                final String expId = createExperimentWRFStampede(airavataClient);
 //                final String expId = createExperimentForStampedeAmber(airavataClient);
-                final String expId = createExperimentForTrestlesAmber(airavataClient);
+//                final String expId = createExperimentForTrestlesAmber(airavataClient);
 //                final String expId = createExperimentGROMACSStampede(airavataClient);
 //                final String expId = createExperimentESPRESSOStampede(airavataClient);
 //                final String expId = createExperimentLAMMPSStampede(airavataClient);
 //                final String expId = createExperimentNWCHEMStampede(airavataClient);
 //                final String expId = createExperimentTRINITYStampede(airavataClient);
 //                final String expId = createExperimentAUTODOCKStampede(airavataClient); // this is not working , we need to register AutoDock app on stampede
+                final String expId = createExperimentForLSF(airavataClient);
 //            	  final String expId = "Ultrascan_ln_eb029947-391a-4ccf-8ace-9bafebe07cc0";
                 System.out.println("Experiment ID : " + expId);
 //                updateExperiment(airavata, expId);
@@ -185,6 +186,8 @@ public class CreateLaunchExperiment {
         //Register all compute hosts
         registerSampleApplications.registerXSEDEHosts();
 
+        registerSampleApplications.registerNonXSEDEHosts();
+
         //Register Gateway Resource Preferences
         registerSampleApplications.registerGatewayResourceProfile();
 
@@ -1343,6 +1346,63 @@ public class CreateLaunchExperiment {
         return null;
     }
 
+    public static String createExperimentForLSF(Airavata.Client client) throws TException {
+        try {
+            List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+            InputDataObjectType input = new InputDataObjectType();
+            input.setName("Input_to_Echo");
+            input.setType(DataType.STRING);
+            input.setValue("Echoed_Output=Hello World");
+            input.setRequiredToAddedToCommandLine(true);
+            exInputs.add(input);
+
+            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+            OutputDataObjectType output = new OutputDataObjectType();
+            output.setName("output_file");
+            output.setType(DataType.URI);
+            output.setValue("");
+            exOut.add(output);
+
+            Project project = ProjectModelUtil.createProject("default", "lg11w", "test project");
+            String projectId = client.createProject(DEFAULT_GATEWAY, project);
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "lg11w", "sshEchoExperiment", "StressMem", echoAppId, exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(echoAppId);
+            if (computeResources != null && computeResources.size() != 0) {
+                for (String id : computeResources.keySet()) {
+                    String resourceName = computeResources.get(id);
+                    if (resourceName.equals(umassrcHostName)) {
+                        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling(id, 10, 1, 1, "long", 60, 0, 1000, "airavata");
+                        UserConfigurationData userConfigurationData = new UserConfigurationData();
+                        userConfigurationData.setAiravataAutoSchedule(false);
+                        userConfigurationData.setOverrideManualScheduledParams(false);
+                        userConfigurationData.setComputationalResourceScheduling(scheduling);
+                        simpleExperiment.setUserConfigurationData(userConfigurationData);
+                        simpleExperiment.setEmailAddresses(Arrays.asList(new String[]{"test@umassmed.edu"}));
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
+                    }
+                }
+            }
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        } catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+        return null;
+    }
+
+
     public static String createExperimentForBR2Amber(Airavata.Client client) throws TException {
         try {
 			List<InputDataObjectType> exInputs = client.getApplicationInputs(amberAppId);
@@ -1538,8 +1598,7 @@ public class CreateLaunchExperiment {
     public static void launchExperiment(Airavata.Client client, String expId)
             throws TException {
         try {
-//        	String tokenId = "5f116091-0ad3-4ab6-9df7-6ac909f21f8b";
-        	String tokenId ="aaaaaa";
+        	String tokenId ="aa-dcdb-48e3-9cd5-ac90b710d55e";
             client.launchExperiment(expId, tokenId);
         } catch (ExperimentNotFoundException e) {
             logger.error("Error occured while launching the experiment...", e.getMessage());

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index 7f7ac1d..8ae2dd2 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -54,6 +54,8 @@ public class RegisterSampleApplications {
     private static String stampedeResourceId = "stampede.tacc.xsede.org_92ac5ed6-35a5-4910-82ef-48f128f9245a";
     private static String trestlesResourceId = "trestles.sdsc.xsede.org_db29986e-5a27-4949-ae7f-04a6012d0d35";
     private static String bigredResourceId = "bigred2.uits.iu.edu_3eae6e9d-a1a7-44ec-ac85-3796ef726ef1";
+    private static String lsfResourceId = "lsf_3eae6e9d-a1a7-44ec-ac85-3796ef726ef1";
+
     private static String fsdResourceId;
  // unicore service endpoint url
     private static final String unicoreEndPointURL = "https://fsd-cloud15.zam.kfa-juelich.de:7000/INTEROP1/services/BESFactory?res=default_bes_factory";
@@ -73,6 +75,7 @@ public class RegisterSampleApplications {
     private static final String monteXName = "TinkerMonte";
     private static final String gaussianName = "Gaussian";
     private static final String gamessName = "Gamess";
+    private static final String stressMemName = "StressMem";
 
     //Appplication Descriptions
     private static final String echoDescription = "A Simple Echo Application";
@@ -90,6 +93,7 @@ public class RegisterSampleApplications {
     private static final String gaussianDescription = "Grid Chem Gaussian Application";
     private static final String gamessDescription = "A Gamess Application";
 
+
     //App Module Id's
     private static String echoModuleId;
     private static String amberModuleId;
@@ -136,6 +140,7 @@ public class RegisterSampleApplications {
             //Register all compute hosts
             registerSampleApplications.registerXSEDEHosts();
 
+            registerSampleApplications.registerNonXSEDEHosts();
 
             //Register Gateway Resource Preferences
             registerSampleApplications.registerGatewayResourceProfile();
@@ -200,10 +205,24 @@ public class RegisterSampleApplications {
             bigredResourceId = registerComputeHost("bigred2.uits.iu.edu", "IU BigRed II Cluster",
                     ResourceJobManagerType.PBS, "push", "/opt/torque/torque-4.2.3.1/bin/", SecurityProtocol.SSH_KEYS, 22, "aprun -n");
             System.out.println("BigredII Resource Id is " + bigredResourceId);
-            
+
             fsdResourceId = registerUnicoreEndpoint("fsd-cloud15.zam.kfa-juelich.de", "interop host", JobSubmissionProtocol.UNICORE, SecurityProtocol.GSI);
             System.out.println("FSd Resource Id: "+fsdResourceId);
-            
+
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    public void registerNonXSEDEHosts() {
+        try {
+            System.out.println("\n #### Registering Non-XSEDE Computational Resources #### \n");
+
+            //Register LSF resource
+            lsfResourceId = registerComputeHost("ghpcc06.umassrc.org", "LSF Cluster",
+                    ResourceJobManagerType.LSF, "push", "source /etc/bashrc;/lsf/9.1/linux2.6-glibc2.3-x86_64/bin", SecurityProtocol.SSH_KEYS, 22, null);
+            System.out.println("LSF Resource Id is " + lsfResourceId);
 
         } catch (TException e) {
             e.printStackTrace();
@@ -317,7 +336,6 @@ public class RegisterSampleApplications {
                             gamessName, "17May13", gamessDescription));
             System.out.println("Gamess Module Id " + gamessModuleId);
 
-
         } catch (TException e) {
             e.printStackTrace();
         }
@@ -341,6 +359,7 @@ public class RegisterSampleApplications {
         //Registering FSD Apps
         registerFSDApps();
 
+        registerLSFApps();
 
     }
 
@@ -493,8 +512,8 @@ public class RegisterSampleApplications {
             e.printStackTrace();
         }
     }
-    
-    
+
+
     public void registerMPIInterface() {
         try {
             System.out.println("#### Registering MPI Interface #### \n");
@@ -1084,6 +1103,22 @@ public class RegisterSampleApplications {
         }
     }
 
+    public void registerLSFApps() {
+        try {
+            System.out.println("#### Registering Application Deployments on Trestles #### \n");
+
+            //Register Echo
+            String echoAppDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, lsfResourceId,
+                            "/home/lg11w/executables/echo.sh", ApplicationParallelismType.SERIAL,
+                            echoDescription, null, null, null));
+            System.out.println("Echo on trestles deployment Id " + echoAppDeployId);
+
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+    }
+
     public void registerBigRedApps() {
         try {
             System.out.println("#### Registering Application Deployments on BigRed II #### \n");
@@ -1127,7 +1162,7 @@ public class RegisterSampleApplications {
             e.printStackTrace();
         }
     }
-    
+
     public void registerFSDApps() {
         try {
             System.out.println("#### Registering Application Deployments on FSD #### \n");
@@ -1207,6 +1242,10 @@ public class RegisterSampleApplications {
             ComputeResourcePreference bigRedResourcePreferences = RegisterSampleApplicationsUtils.
                     createComputeResourcePreference(bigredResourceId, "TG-STA110014S", false, null, null, null,
                             "/N/dc2/scratch/cgateway/gta-work-dirs");
+
+            ComputeResourcePreference lsfResourcePreferences = RegisterSampleApplicationsUtils.
+                    createComputeResourcePreference(lsfResourceId, "airavata", false, null, null, null,
+                            "/home/lg11w/mywork");
             
             ComputeResourcePreference fsdResourcePreferences = RegisterSampleApplicationsUtils.
                     createComputeResourcePreference(fsdResourceId, null, false, null, JobSubmissionProtocol.UNICORE, DataMovementProtocol.UNICORE_STORAGE_SERVICE,null);
@@ -1217,6 +1256,7 @@ public class RegisterSampleApplications {
             gatewayResourceProfile.addToComputeResourcePreferences(trestlesResourcePreferences);
             gatewayResourceProfile.addToComputeResourcePreferences(bigRedResourcePreferences);
             gatewayResourceProfile.addToComputeResourcePreferences(fsdResourcePreferences);
+            gatewayResourceProfile.addToComputeResourcePreferences(lsfResourcePreferences);
 
             String gatewayProfile = airavataClient.registerGatewayResourceProfile(gatewayResourceProfile);
             System.out.println("Gateway Profile is registered with Id " + gatewayProfile);
@@ -1232,6 +1272,7 @@ public class RegisterSampleApplications {
             properties.setProperty("stampedeResourceId", stampedeResourceId);
             properties.setProperty("trestlesResourceId", trestlesResourceId);
             properties.setProperty("bigredResourceId", bigredResourceId);
+            properties.setProperty("lsfResourceId", lsfResourceId);
 
             properties.setProperty("echoInterfaceId", echoInterfaceId);
             properties.setProperty("amberInterfaceId", amberInterfaceId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/configuration/server/src/main/resources/LSFTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/LSFTemplate.xslt b/modules/configuration/server/src/main/resources/LSFTemplate.xslt
index ab9fbbd..7081260 100644
--- a/modules/configuration/server/src/main/resources/LSFTemplate.xslt
+++ b/modules/configuration/server/src/main/resources/LSFTemplate.xslt
@@ -9,47 +9,61 @@
     <xsl:output method="text" />
     <xsl:template match="/ns:JobDescriptor">
         <xsl:param name="quote">"</xsl:param>
-        #! /bin/bash
-        # LSF batch job submission script generated by Apache Airavata
-        #
+#! /bin/bash
+# LSF batch job submission script generated by Apache Airavata
+#
+        <xsl:choose>
+            <xsl:when test="ns:shellName">
+#BSUB -L <xsl:value-of select="ns:shellName"/>
+            </xsl:when></xsl:choose>
         <xsl:choose>
             <xsl:when test="ns:queueName">
-                #BSUB -n <xsl:value-of select="ns:queueName"/>
+#BSUB -q <xsl:value-of select="ns:queueName"/>
+            </xsl:when>
+        </xsl:choose>
+        <xsl:choose>
+            <xsl:when test="ns:nodes">
+#BSUB -n <xsl:value-of select="ns:nodes"/>
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
             <xsl:when test="ns:mailAddress">
-                #BSUB -u <xsl:value-of select="ns:mailAddress"/>
+#BSUB -u <xsl:value-of select="ns:mailAddress"/>
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
             <xsl:when test="ns:jobName">
-                #BSUB -J <xsl:value-of select="ns:jobName"/>
+#BSUB -J <xsl:value-of select="ns:jobName"/>
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
-        <xsl:when test="ns:acountString">
-            #BSUB -P <xsl:value-of select="ns:acountString"/>
-        </xsl:when>
-       </xsl:choose>
+            <xsl:when test="ns:acountString">
+#BSUB -P <xsl:value-of select="ns:acountString"/>
+            </xsl:when>
+        </xsl:choose>
         <xsl:choose>
             <xsl:when test="ns:maxWallTime">
-                #BSUB -W<xsl:value-of select="ns:maxWallTime"/>
+#BSUB -W <xsl:value-of select="ns:maxWallTime"/>
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
             <xsl:when test="ns:standardOutFile">
-                #BSUB -o <xsl:value-of select="ns:standardOutFile"/>
+#BSUB -o "<xsl:value-of select="ns:standardOutFile"/>"
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
             <xsl:when test="ns:standardOutFile">
-                #BSUB -e <xsl:value-of select="ns:standardErrorFile"/>
+#BSUB -e "<xsl:value-of select="ns:standardErrorFile"/>"
+            </xsl:when>
+        </xsl:choose>
+        <xsl:choose>
+            <xsl:when test="ns:chassisName">
+#BSUB -m c<xsl:value-of select="ns:chassisName"/>
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
             <xsl:when test="ns:usedMem">
-                #BSUB -R rusage[mem=<xsl:value-of select="ns:usedMem"/>]
+#BSUB -R rusage[mem=<xsl:value-of select="ns:usedMem"/>]
             </xsl:when>
         </xsl:choose>
 
@@ -74,7 +88,6 @@
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
         </xsl:for-each>
         <xsl:text>&#xa;</xsl:text>
-        ~/rabbitmq-java-client-bin-3.3.5/runjava.sh com.rabbitmq.examples.SimpleProducer amqp://<xsl:value-of select="ns:callBackIp"/><xsl:text> </xsl:text><xsl:value-of select="ns:userName"/>,<xsl:value-of select="ns:jobName"/><xsl:text> </xsl:text><xsl:value-of select="$quote"/><xsl:value-of select="$quote"/><xsl:text> </xsl:text><xsl:value-of select="ns:callBackPort"/>
     </xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/configuration/server/src/main/resources/PBSTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/PBSTemplate.xslt b/modules/configuration/server/src/main/resources/PBSTemplate.xslt
index aa3cccc..7676883 100644
--- a/modules/configuration/server/src/main/resources/PBSTemplate.xslt
+++ b/modules/configuration/server/src/main/resources/PBSTemplate.xslt
@@ -96,7 +96,6 @@ cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text
       <xsl:value-of select="."/><xsl:text>   </xsl:text>
 </xsl:for-each>
     <xsl:text>&#xa;</xsl:text>
-~/rabbitmq-java-client-bin-3.3.5/runjava.sh com.rabbitmq.examples.SimpleProducer amqp://<xsl:value-of select="ns:callBackIp"/><xsl:text> </xsl:text><xsl:value-of select="ns:userName"/>,<xsl:value-of select="ns:jobName"/><xsl:text> </xsl:text><xsl:value-of select="$quote"/><xsl:value-of select="$quote"/><xsl:text> </xsl:text><xsl:value-of select="ns:callBackPort"/>
-</xsl:template>
+R</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
index cc5ebb6..1d9f4d9 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/client/TestSSLClient.java
@@ -63,7 +63,7 @@ public class TestSSLClient {
             TProtocol protocol = new TBinaryProtocol(transport);
 
             CredentialStoreService.Client client = new CredentialStoreService.Client(protocol);
-//            testSSHCredential(client);
+            testSSHCredential(client);
             testCertificateCredential(client);
             transport.close();
         } catch (TTransportException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
index 7f44125..4f72b46 100644
--- a/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
+++ b/modules/credential-store/credential-store-service/src/test/java/org/apache/airavata/credential/store/store/impl/db/SSHCredentialTest.java
@@ -43,8 +43,8 @@ public class SSHCredentialTest {
         String userName = "airavata";
         String password = "airavata";
         String gatewayId = "default";
-        String privateKeyPath = "/Users/chathuri/.ssh/id_dsa";
-        String pubKeyPath = "/Users/chathuri/.ssh/id_dsa.pub";
+        String privateKeyPath = "/Users/lginnali/.ssh/id_dsa";
+        String pubKeyPath = "/Users/lginnali/.ssh/id_dsa.pub";
 
         try {
             AiravataUtils.setExecutionAsServer();
@@ -67,7 +67,7 @@ public class SSHCredentialTest {
             pubKeyStream.close();
             sshCredential.setPrivateKey(bFilePub);
             sshCredential.setPublicKey(bFilePub);
-            sshCredential.setPassphrase("test");
+            sshCredential.setPassphrase("gjtlmiJdas7wph");
             writer.writeCredentials(sshCredential);
             System.out.println(token);
         } catch (ClassNotFoundException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties b/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
new file mode 100644
index 0000000..9bdce87
--- /dev/null
+++ b/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
@@ -0,0 +1,254 @@
+#
+#
+# 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.
+#
+
+###########################################################################
+#
+#  This properties file provides configuration for all Airavata Services:
+#  API Server, Registry, Workflow Interpreter, GFac, Orchestrator
+#
+###########################################################################
+
+###########################################################################
+#  API Server Registry Configuration
+###########################################################################
+
+#for derby [AiravataJPARegistry]
+registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+# MySql database configuration
+#registry.jdbc.driver=com.mysql.jdbc.Driver
+#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
+registry.jdbc.user=airavata
+registry.jdbc.password=airavata
+start.derby.server.mode=true
+validationQuery=SELECT 1 from CONFIGURATION
+jpa.cache.size=5000
+#jpa.connection.properties=MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000,testWhileIdle=true,testOnBorrow=true
+
+# Properties for default user mode
+default.registry.user=admin
+default.registry.password=admin
+default.registry.password.hash.method=SHA
+default.registry.gateway=php_reference_gateway
+
+#ip=127.0.0.1
+
+###########################################################################
+#  Application Catalog DB Configuration
+###########################################################################
+#for derby [AiravataJPARegistry]
+appcatalog.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+appcatalog.jdbc.url=jdbc:derby://localhost:1527/app_catalog;create=true;user=airavata;password=airavata
+# MySql database configuration
+#appcatalog.jdbc.driver=com.mysql.jdbc.Driver
+#appcatalog.jdbc.url=jdbc:mysql://localhost:3306/app_catalog
+appcatalog.jdbc.user=airavata
+appcatalog.jdbc.password=airavata
+appcatalog.validationQuery=SELECT 1 from CONFIGURATION
+
+###########################################################################
+#  Server module Configuration
+###########################################################################
+
+servers=apiserver,orchestrator,gfac,credentialstore
+#shutdown.trategy=NONE
+shutdown.trategy=SELF_TERMINATE
+
+
+apiserver.server.host=localhost
+apiserver.server.port=8930
+apiserver.server.min.threads=50
+orchestrator.server.host=localhost
+orchestrator.server.port=8940
+gfac.server.host=localhost
+gfac.server.port=8950
+orchestrator.server.min.threads=50
+
+###########################################################################
+#  Job Scheduler can send informative email messages to you about the status of your job.
+# Specify a string which consists of either the single character "n" (no mail), or one or more
+#  of the characters "a" (send mail when job is aborted), "b" (send mail when job begins),
+# and "e" (send mail when job terminates).  The default is "a" if not specified.
+###########################################################################
+
+job.notification.enable=true
+#Provide comma separated email ids as a string if more than one
+job.notification.emailids=
+job.notification.flags=abe
+
+###########################################################################
+# Credential Store module Configuration
+###########################################################################
+start.credential.store=false
+credential.store.keystore.url=/Users/lginnali/Downloads/airavata_sym.jks
+credential.store.keystore.alias=airavata
+credential.store.keystore.password=airavata
+credential.store.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+credential.store.jdbc.user=airavata
+credential.store.jdbc.password=airavata
+credential.store.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+credential.store.server.host=localhost
+credential.store.server.port=8960
+credentialstore=org.apache.airavata.credential.store.server.CredentialStoreServer
+credential.store.thrift.server.keystore=/Users/chathuri/dev/airavata/credential-store/oa4mp/airavata.jks
+credential.store.thrift.server.keystore.password=airavata
+
+notifier.enabled=false
+#period in milliseconds
+notifier.duration=5000
+
+email.server=smtp.googlemail.com
+email.server.port=465
+email.user=airavata
+email.password=xxx
+email.ssl=true
+email.from=airavata@apache.org
+
+###########################################################################
+# Airavata GFac MyProxy GSI credentials to access Grid Resources.
+###########################################################################
+#
+# Security Configuration used by Airavata Generic Factory Service
+#  to interact with Computational Resources.
+#
+gfac.thread.pool.size=50
+airavata.server.thread.pool.size=50
+gfac=org.apache.airavata.gfac.server.GfacServer
+myproxy.server=myproxy.teragrid.org
+myproxy.username=ogce
+myproxy.password=
+myproxy.life=3600
+# XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz
+trusted.cert.location=/Users/lahirugunathilake/Downloads/certificates
+gfac.passive=true
+# SSH PKI key pair or ssh password can be used SSH based authentication is used.
+# if user specify both password authentication gets the higher preference
+
+################# ---------- For ssh key pair authentication ------------------- ################
+#public.ssh.key=/path to public key for ssh
+#private.ssh.key=/path to private key file for ssh
+#ssh.keypass=passphrase for the private key
+#ssh.username=username for ssh connection
+### Incase of password authentication.
+#ssh.password=Password for ssh connection
+
+
+
+###########################################################################
+# Airavata Workflow Interpreter Configurations
+###########################################################################
+
+#runInThread=true
+#provenance=true
+#provenanceWriterThreadPoolSize=20
+#gfac.embedded=true
+#workflowserver=org.apache.airavata.api.server.WorkflowServer
+
+
+###########################################################################
+# API Server module Configuration
+###########################################################################
+apiserver=org.apache.airavata.api.server.AiravataAPIServer
+
+###########################################################################
+# Workflow Server module Configuration
+###########################################################################
+
+workflowserver=org.apache.airavata.api.server.WorkflowServer
+
+###########################################################################
+# Advance configuration to change service implementations
+###########################################################################
+# If false, disables two phase commit when submitting jobs
+TwoPhase=true
+#
+# Class which implemented HostScheduler interface. It will determine the which host to submit the request
+#
+host.scheduler=org.apache.airavata.gfac.core.scheduler.impl.SimpleHostScheduler
+
+###########################################################################
+# Monitoring module Configuration
+###########################################################################
+
+#This will be the primary monitoring tool which runs in airavata, in future there will be multiple monitoring
+#mechanisms and one would be able to start a monitor
+monitors=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor,org.apache.airavata.gfac.monitor.impl.LocalJobMonitor
+
+
+###########################################################################
+# AMQP Notification Configuration
+###########################################################################
+
+
+amqp.notification.enable=1
+
+amqp.broker.host=localhost
+amqp.broker.port=5672
+amqp.broker.username=guest
+amqp.broker.password=guest
+
+amqp.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPSenderImpl
+amqp.topic.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPTopicSenderImpl
+amqp.broadcast.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPBroadcastSenderImpl
+
+#,org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor
+#This is the amqp related configuration and this lists down the Rabbitmq host, this is an xsede specific configuration
+amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
+proxy.file.path=/Users/lahirugunathilake/Downloads/x509up_u503876
+connection.name=xsede
+#publisher
+activity.listeners=org.apache.airavata.gfac.core.monitor.AiravataJobStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataTaskStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataWorkflowNodeStatusUpdator,org.apache.airavata.api.server.listener.AiravataExperimentStatusUpdator,org.apache.airavata.gfac.core.monitor.GfacInternalStatusUpdator,org.apache.airavata.workflow.engine.util.ProxyMonitorPublisher
+publish.rabbitmq=false
+status.publisher=org.apache.airavata.messaging.core.impl.RabbitMQStatusPublisher
+task.launch.publisher=org.apache.airavata.messaging.core.impl.RabbitMQTaskLaunchPublisher
+rabbitmq.broker.url=amqp://localhost:5672
+rabbitmq.status.exchange.name=airavata_rabbitmq_exchange
+rabbitmq.task.launch.exchange.name=airavata_task_launch_rabbitmq_exchange
+
+
+###########################################################################
+# Orchestrator module Configuration
+###########################################################################
+
+#job.submitter=org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter
+job.submitter=org.apache.airavata.orchestrator.core.impl.GFACPassiveJobSubmitter
+#job.submitter=org.apache.airavata.orchestrator.core.impl.GFACRPCJobSubmitter
+job.validators=org.apache.airavata.orchestrator.core.validator.impl.SimpleAppDataValidator,org.apache.airavata.orchestrator.core.validator.impl.ExperimentStatusValidator
+submitter.interval=10000
+threadpool.size=10
+start.submitter=true
+embedded.mode=true
+enable.validation=true
+orchestrator=org.apache.airavata.orchestrator.server.OrchestratorServer
+
+###########################################################################
+# Zookeeper Server Configuration
+###########################################################################
+
+embedded.zk=false
+zookeeper.server.host=localhost
+zookeeper.server.port=2181
+airavata-server=/api-server
+orchestrator-server=/orchestrator-server
+gfac-server=/gfac-server
+gfac-experiments=/gfac-experiments
+gfac-server-name=gfac-node0
+orchestrator-server-name=orch-node0
+airavata-server-name=api-node0

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/distribution/server/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/server/src/main/assembly/bin-assembly.xml b/modules/distribution/server/src/main/assembly/bin-assembly.xml
index 4f061e4..18ccad6 100644
--- a/modules/distribution/server/src/main/assembly/bin-assembly.xml
+++ b/modules/distribution/server/src/main/assembly/bin-assembly.xml
@@ -127,6 +127,7 @@
 				<include>gfac-config.xml</include>
 				<include>PBSTemplate.xslt</include>
 				<include>SLURMTemplate.xslt</include>
+				<include>LSFTemplate.xslt</include>
 				<include>SGETemplate.xslt</include>
 				<include>gsissh.properties</include>
 			</includes>

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
index 583ec07..1687462 100644
--- a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
+++ b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
@@ -31,7 +31,6 @@ import org.apache.airavata.common.utils.AiravataZKUtils;
 import org.apache.airavata.common.utils.Constants;
 import org.apache.airavata.common.utils.MonitorPublisher;
 import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.core.cpi.BetterGfacImpl;
 import org.apache.airavata.gfac.core.cpi.GFac;
 import org.apache.airavata.gfac.core.utils.GFacThreadPoolExecutor;

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/RequestData.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/RequestData.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/RequestData.java
index 9f45ce6..000ea7d 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/RequestData.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/RequestData.java
@@ -49,6 +49,8 @@ public class RequestData {
     private int myProxyLifeTime = DEFAULT_LIFE_TIME;
 
 
+
+
     public RequestData() {
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/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 7a432e8..631f59c 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
@@ -60,6 +60,8 @@ public class GFACGSISSHUtils {
     public static final String PBS_JOB_MANAGER = "pbs";
     public static final String SLURM_JOB_MANAGER = "slurm";
     public static final String SUN_GRID_ENGINE_JOB_MANAGER = "UGE";
+    public static final String LSF_JOB_MANAGER = "lsf";
+
     public static int maxClusterCount = 5;
     public static Map<String, List<Cluster>> clusters = new HashMap<String, List<Cluster>>();
 
@@ -138,6 +140,8 @@ public class GFACGSISSHUtils {
                                 jConfig = CommonUtils.getSLURMJobManager(installedParentPath);
                             } else if (SUN_GRID_ENGINE_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                                 jConfig = CommonUtils.getSGEJobManager(installedParentPath);
+                            }else if(LSF_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
+                                jConfig = CommonUtils.getLSFJobManager(installedParentPath);
                             }
                         }
                         pbsCluster = new PBSCluster(serverInfo, tokenizedMyProxyAuthInfo, jConfig);
@@ -177,7 +181,7 @@ public class GFACGSISSHUtils {
 			if(ServerSettings.getSetting(ServerSettings.JOB_NOTIFICATION_ENABLE).equalsIgnoreCase("true")){
 				jobDescriptor.setMailOptions(ServerSettings.getSetting(ServerSettings.JOB_NOTIFICATION_FLAGS));
 				String emailids = ServerSettings.getSetting(ServerSettings.JOB_NOTIFICATION_EMAILIDS);
-			
+
 				if(jobExecutionContext.getTaskData().isSetEmailAddresses()){
 					List<String> emailList = jobExecutionContext.getTaskData().getEmailAddresses();
 					String elist = GFacUtils.listToCsv(emailList, ',');
@@ -204,6 +208,7 @@ public class GFACGSISSHUtils {
         jobDescriptor.setStandardOutFile(jobExecutionContext.getStandardOutput());
         jobDescriptor.setStandardErrorFile(jobExecutionContext.getStandardError());
         String computationalProjectAccount = taskData.getTaskScheduling().getComputationalProjectAccount();
+        taskData.getEmailAddresses();
         if (computationalProjectAccount == null){
             ComputeResourcePreference computeResourcePreference = jobExecutionContext.getApplicationContext().getComputeResourcePreference();
             if (computeResourcePreference != null) {
@@ -311,6 +316,9 @@ public class GFACGSISSHUtils {
             }
             if (taskScheduling.getWallTimeLimit() > 0) {
                 jobDescriptor.setMaxWallTime(String.valueOf(taskScheduling.getWallTimeLimit()));
+                if(resourceJobManager.getResourceJobManagerType().equals(ResourceJobManagerType.LSF)){
+                    jobDescriptor.setMaxWallTimeForLSF(String.valueOf(taskScheduling.getWallTimeLimit()));
+                }
             }
 
             if (taskScheduling.getTotalPhysicalMemory() > 0) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/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 a9e08d3..c4d25f5 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
@@ -25,6 +25,7 @@ import org.airavata.appcatalog.cpi.AppCatalogException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 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.gfac.core.context.JobExecutionContext;
@@ -41,6 +42,7 @@ import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
 import org.apache.airavata.gsi.ssh.api.job.JobManagerConfiguration;
 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.util.CommonUtils;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import org.apache.airavata.model.appcatalog.appinterface.DataType;
@@ -96,15 +98,21 @@ public class GFACSSHUtils {
 
                     Cluster pbsCluster = null;
                     try {
-                        TokenizedSSHAuthInfo tokenizedSSHAuthInfo = new TokenizedSSHAuthInfo(requestData);
+                        AuthenticationInfo tokenizedSSHAuthInfo = new TokenizedSSHAuthInfo(requestData);
                         String installedParentPath = jobExecutionContext.getResourceJobManager().getJobManagerBinPath();
                         if (installedParentPath == null) {
                             installedParentPath = "/";
                         }
 
-                        SSHCredential credentials = tokenizedSSHAuthInfo.getCredentials();// this is just a call to get and set credentials in to this object,data will be used
+                        SSHCredential credentials =((TokenizedSSHAuthInfo)tokenizedSSHAuthInfo).getCredentials();// this is just a call to get and set credentials in to this object,data will be used
+                        if(credentials.getPrivateKey()==null || credentials.getPublicKey()==null){
+                            // now we fall back to username password authentication
+                            Properties configurationProperties = ServerSettings.getProperties();
+                            tokenizedSSHAuthInfo = new DefaultPasswordAuthenticationInfo(configurationProperties.getProperty(Constants.SSH_PASSWORD));
+                        }
                         serverInfo.setUserName(credentials.getPortalUserName());
                         jobExecutionContext.getExperiment().setUserName(credentials.getPortalUserName());
+
                         // inside the pbsCluser object
 
                         String key = credentials.getPortalUserName() + jobExecutionContext.getHostName() + serverInfo.getPort();
@@ -147,8 +155,11 @@ public class GFACSSHUtils {
                                          jConfig = CommonUtils.getSLURMJobManager(installedParentPath);
                                      } else if (SUN_GRID_ENGINE_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                                          jConfig = CommonUtils.getSGEJobManager(installedParentPath);
+                                     } else if (LSF_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
+                                         jConfig = CommonUtils.getLSFJobManager(installedParentPath);
                                      }
                                  }
+
                                 pbsCluster = new PBSCluster(serverInfo, tokenizedSSHAuthInfo,jConfig);
                                 List<Cluster> pbsClusters = null;
                                 if (!(clusters.containsKey(key))) {
@@ -322,7 +333,7 @@ public class GFACSSHUtils {
         List<String> inputValues = new ArrayList<String>();
         MessageContext input = jobExecutionContext.getInMessageContext();
 
-        // sort the inputs first and then build the command List
+        // sort the inputs first and then build the command ListR
         Comparator<InputDataObjectType> inputOrderComparator = new Comparator<InputDataObjectType>() {
             @Override
             public int compare(InputDataObjectType inputDataObjectType, InputDataObjectType t1) {
@@ -411,6 +422,12 @@ public class GFACSSHUtils {
             }
             if (taskScheduling.getWallTimeLimit() > 0) {
                 jobDescriptor.setMaxWallTime(String.valueOf(taskScheduling.getWallTimeLimit()));
+                if(resourceJobManager.getResourceJobManagerType().equals(ResourceJobManagerType.LSF)){
+                    jobDescriptor.setMaxWallTimeForLSF(String.valueOf(taskScheduling.getWallTimeLimit()));
+                }
+            }
+            if (taskScheduling.getTotalPhysicalMemory() > 0) {
+                jobDescriptor.setUsedMemory(taskScheduling.getTotalPhysicalMemory() + "");
             }
         } else {
             logger.error("Task scheduling cannot be null at this point..");

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
index f68ba29..85a843e 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
@@ -37,6 +37,13 @@ public interface JobManagerConfiguration {
 	public RawCommandInfo getSubmitCommand(String workingDirectory, String pbsFilePath);
 
 	public OutputParser getParser();
-	
+
 	public String getInstalledPath();
+
+	public String getBaseCancelCommand();
+
+	public String getBaseMonitorCommand();
+
+	public String getBaseSubmitCommand();
+
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java
index 018d49d..46fe9ad 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java
@@ -80,7 +80,7 @@ public class LSFJobConfiguration implements JobManagerConfiguration {
 
     @Override
     public RawCommandInfo getSubmitCommand(String workingDirectory, String pbsFilePath) {
-        return new RawCommandInfo(this.installedPath + "bsub <" +
+        return new RawCommandInfo(this.installedPath + "bsub < " +
                 workingDirectory + File.separator + FilenameUtils.getName(pbsFilePath));
     }
 
@@ -97,4 +97,20 @@ public class LSFJobConfiguration implements JobManagerConfiguration {
     public String getInstalledPath() {
         return installedPath;
     }
+
+
+    @Override
+    public String getBaseCancelCommand() {
+        return "bkill";
+    }
+
+    @Override
+    public String getBaseMonitorCommand() {
+        return "bjobs";
+    }
+
+    @Override
+    public String getBaseSubmitCommand() {
+        return "bsub";
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
index 5490ff6..bd02e37 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java
@@ -57,6 +57,7 @@ public class LSFOutputParser implements OutputParser {
     @Override
     public void parseJobStatuses(String userName, Map<String, JobStatus> statusMap, String rawOutput) throws SSHApiException {
         logger.debug(rawOutput);
+
         String[]    info = rawOutput.split("\n");
 //        int lastStop = 0;
         for (String jobID : statusMap.keySet()) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSJobConfiguration.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSJobConfiguration.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSJobConfiguration.java
index 18ea772..e935dfb 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSJobConfiguration.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSJobConfiguration.java
@@ -95,4 +95,19 @@ public class PBSJobConfiguration implements JobManagerConfiguration {
     public RawCommandInfo getUserBasedMonitorCommand(String userName) {
         return new RawCommandInfo(this.installedPath + "qstat -u " + userName);
     }
+
+    @Override
+    public String  getBaseCancelCommand() {
+        return "qdel";
+    }
+
+    @Override
+    public String  getBaseMonitorCommand() {
+        return "qstat";
+    }
+
+    @Override
+    public String getBaseSubmitCommand() {
+        return "qsub ";
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmJobConfiguration.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmJobConfiguration.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmJobConfiguration.java
index 0b774ed..807ac42 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmJobConfiguration.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmJobConfiguration.java
@@ -94,4 +94,19 @@ public class SlurmJobConfiguration implements JobManagerConfiguration{
     public RawCommandInfo getUserBasedMonitorCommand(String userName) {
         return new RawCommandInfo(this.installedPath + "squeue -u " + userName);
     }
+
+    @Override
+    public String getBaseCancelCommand() {
+        return "scancel";
+    }
+
+    @Override
+    public String getBaseMonitorCommand() {
+        return "squeue";
+    }
+
+    @Override
+    public String getBaseSubmitCommand() {
+        return "sbatch";
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
index dd7f2d9..0420cff 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
@@ -241,7 +241,7 @@ public class GSISSHAbstractCluster implements Cluster {
 
         StandardOutReader stdOutReader = new StandardOutReader();
         CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader);
-        String outputifAvailable = getOutputifAvailable(stdOutReader, "Error reading output of job submission",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
+        String outputifAvailable = getOutputifAvailable(stdOutReader, "Error reading output of job submission",jobManagerConfiguration.getBaseCancelCommand());
         // this might not be the case for all teh resources, if so Cluster implementation can override this method
         // because here after cancelling we try to get the job description and return it back
         try {
@@ -274,7 +274,7 @@ public class GSISSHAbstractCluster implements Cluster {
         //Check whether pbs submission is successful or not, if it failed throw and exception in submitJob method
         // with the error thrown in qsub command
         //
-        String outputifAvailable = getOutputifAvailable(standardOutReader,"Error reading output of job submission",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
+        String outputifAvailable = getOutputifAvailable(standardOutReader,"Error reading output of job submission",jobManagerConfiguration.getBaseSubmitCommand());
         OutputParser outputParser = jobManagerConfiguration.getParser();
         return  outputParser.parseJobSubmission(outputifAvailable);
     }
@@ -411,7 +411,7 @@ public class GSISSHAbstractCluster implements Cluster {
         RawCommandInfo rawCommandInfo = jobManagerConfiguration.getMonitorCommand(jobID);
         StandardOutReader stdOutReader = new StandardOutReader();
         CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader);
-        String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
+        String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !",jobManagerConfiguration.getBaseMonitorCommand());
         JobDescriptor jobDescriptor = new JobDescriptor();
         jobManagerConfiguration.getParser().parseSingleJob(jobDescriptor, result);
         return jobDescriptor;
@@ -421,7 +421,7 @@ public class GSISSHAbstractCluster implements Cluster {
         RawCommandInfo rawCommandInfo = jobManagerConfiguration.getMonitorCommand(jobID);
         StandardOutReader stdOutReader = new StandardOutReader();
         CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader);
-        String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
+        String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", jobManagerConfiguration.getBaseMonitorCommand());
         return jobManagerConfiguration.getParser().parseJobStatus(jobID, result);
     }
 
@@ -638,7 +638,7 @@ public class GSISSHAbstractCluster implements Cluster {
                 }
             }
         }
-        String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
+        String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", jobManagerConfiguration.getBaseMonitorCommand());
         jobManagerConfiguration.getParser().parseJobStatuses(userName, jobIDs, result);
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
index ac88fe7..0e9d16e 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
@@ -48,13 +48,7 @@ public class RawCommandInfo implements CommandInfo {
     public String getRawCommand() {
         return rawCommand;
     }
-    /*
-     * To get command without the path and other parameters. This is required to read errors 
-     */
-    public String getBaseCommand(String installPath) {
-        return rawCommand.substring(rawCommand.lastIndexOf(installPath)+1, rawCommand.indexOf(" "));
-    }
-    
+
     public void setRawCommand(String rawCommand) {
         this.rawCommand = rawCommand;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/5ff650f4/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
index 5a12723..0ca7546 100644
--- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
+++ b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTestWithMyProxyAuth.java
@@ -26,6 +26,7 @@ import org.apache.airavata.gsi.ssh.api.*;
 import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
 import org.apache.airavata.gsi.ssh.config.ConfigReader;
+import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.util.CommonUtils;
 import org.slf4j.Logger;
@@ -49,17 +50,13 @@ public class DefaultSSHApiTestWithMyProxyAuth {
 
 
     public static void main(String[]ars){
-         String myProxyUserName = "ogce";
-         String myProxyPassword = "OGCE@xsede14";
-         String certificateLocation = "/Users/raminder/.globus/certificates";
+         String myProxyUserName = "lg11w";
 
-
-        GSIAuthenticationInfo authenticationInfo
-                = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
-                7512, 17280000, certificateLocation);
+        DefaultPasswordAuthenticationInfo authenticationInfo
+                = new DefaultPasswordAuthenticationInfo("");
 
         // Create command
-        CommandInfo commandInfo = new RawCommandInfo("/bin/ls");
+        CommandInfo commandInfo = new RawCommandInfo("source /etc/bashrc; bsub </home/lg11w/mywork/sshEchoExperiment_9d267072-ca65-4ca8-847a-cd3d130f6050/366787899.lsf");
 
         // Server info
         //Stampede
@@ -68,7 +65,7 @@ public class DefaultSSHApiTestWithMyProxyAuth {
 //        ServerInfo serverInfo = new ServerInfo(myProxyUserName, "trestles.sdsc.xsede.org", 22);
         
         //Lonestar
-         ServerInfo serverInfo = new ServerInfo(myProxyUserName, "lonestar.tacc.utexas.edu", 22);
+         ServerInfo serverInfo = new ServerInfo(myProxyUserName, "ghpcc06.umassrc.org", 22);
         // Output
         CommandOutput commandOutput = new SystemCommandOutput();
 


[18/62] [abbrv] airavata git commit: Reorganizing duplicate generated classed and instead using the stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
deleted file mode 100644
index 9fc373a..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
+++ /dev/null
@@ -1,998 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class SSHCredential implements org.apache.thrift.TBase<SSHCredential, SSHCredential._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredential> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredential");
-
-  private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField PASSPHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("passphrase", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField PUBLIC_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("publicKey", org.apache.thrift.protocol.TType.STRING, (short)4);
-  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)5);
-  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)6);
-  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)7);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new SSHCredentialStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new SSHCredentialTupleSchemeFactory());
-  }
-
-  public String gatewayId; // required
-  public String username; // required
-  public String passphrase; // required
-  public String publicKey; // optional
-  public String privateKey; // optional
-  public long persistedTime; // optional
-  public String token; // optional
-
-  /** 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 {
-    GATEWAY_ID((short)1, "gatewayId"),
-    USERNAME((short)2, "username"),
-    PASSPHRASE((short)3, "passphrase"),
-    PUBLIC_KEY((short)4, "publicKey"),
-    PRIVATE_KEY((short)5, "privateKey"),
-    PERSISTED_TIME((short)6, "persistedTime"),
-    TOKEN((short)7, "token");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // GATEWAY_ID
-          return GATEWAY_ID;
-        case 2: // USERNAME
-          return USERNAME;
-        case 3: // PASSPHRASE
-          return PASSPHRASE;
-        case 4: // PUBLIC_KEY
-          return PUBLIC_KEY;
-        case 5: // PRIVATE_KEY
-          return PRIVATE_KEY;
-        case 6: // PERSISTED_TIME
-          return PERSISTED_TIME;
-        case 7: // TOKEN
-          return TOKEN;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __PERSISTEDTIME_ISSET_ID = 0;
-  private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.PUBLIC_KEY,_Fields.PRIVATE_KEY,_Fields.PERSISTED_TIME,_Fields.TOKEN};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PASSPHRASE, new org.apache.thrift.meta_data.FieldMetaData("passphrase", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PUBLIC_KEY, new org.apache.thrift.meta_data.FieldMetaData("publicKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SSHCredential.class, metaDataMap);
-  }
-
-  public SSHCredential() {
-  }
-
-  public SSHCredential(
-    String gatewayId,
-    String username,
-    String passphrase)
-  {
-    this();
-    this.gatewayId = gatewayId;
-    this.username = username;
-    this.passphrase = passphrase;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public SSHCredential(SSHCredential other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetGatewayId()) {
-      this.gatewayId = other.gatewayId;
-    }
-    if (other.isSetUsername()) {
-      this.username = other.username;
-    }
-    if (other.isSetPassphrase()) {
-      this.passphrase = other.passphrase;
-    }
-    if (other.isSetPublicKey()) {
-      this.publicKey = other.publicKey;
-    }
-    if (other.isSetPrivateKey()) {
-      this.privateKey = other.privateKey;
-    }
-    this.persistedTime = other.persistedTime;
-    if (other.isSetToken()) {
-      this.token = other.token;
-    }
-  }
-
-  public SSHCredential deepCopy() {
-    return new SSHCredential(this);
-  }
-
-  @Override
-  public void clear() {
-    this.gatewayId = null;
-    this.username = null;
-    this.passphrase = null;
-    this.publicKey = null;
-    this.privateKey = null;
-    setPersistedTimeIsSet(false);
-    this.persistedTime = 0;
-    this.token = null;
-  }
-
-  public String getGatewayId() {
-    return this.gatewayId;
-  }
-
-  public SSHCredential setGatewayId(String gatewayId) {
-    this.gatewayId = gatewayId;
-    return this;
-  }
-
-  public void unsetGatewayId() {
-    this.gatewayId = null;
-  }
-
-  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
-  public boolean isSetGatewayId() {
-    return this.gatewayId != null;
-  }
-
-  public void setGatewayIdIsSet(boolean value) {
-    if (!value) {
-      this.gatewayId = null;
-    }
-  }
-
-  public String getUsername() {
-    return this.username;
-  }
-
-  public SSHCredential setUsername(String username) {
-    this.username = username;
-    return this;
-  }
-
-  public void unsetUsername() {
-    this.username = null;
-  }
-
-  /** Returns true if field username is set (has been assigned a value) and false otherwise */
-  public boolean isSetUsername() {
-    return this.username != null;
-  }
-
-  public void setUsernameIsSet(boolean value) {
-    if (!value) {
-      this.username = null;
-    }
-  }
-
-  public String getPassphrase() {
-    return this.passphrase;
-  }
-
-  public SSHCredential setPassphrase(String passphrase) {
-    this.passphrase = passphrase;
-    return this;
-  }
-
-  public void unsetPassphrase() {
-    this.passphrase = null;
-  }
-
-  /** Returns true if field passphrase is set (has been assigned a value) and false otherwise */
-  public boolean isSetPassphrase() {
-    return this.passphrase != null;
-  }
-
-  public void setPassphraseIsSet(boolean value) {
-    if (!value) {
-      this.passphrase = null;
-    }
-  }
-
-  public String getPublicKey() {
-    return this.publicKey;
-  }
-
-  public SSHCredential setPublicKey(String publicKey) {
-    this.publicKey = publicKey;
-    return this;
-  }
-
-  public void unsetPublicKey() {
-    this.publicKey = null;
-  }
-
-  /** Returns true if field publicKey is set (has been assigned a value) and false otherwise */
-  public boolean isSetPublicKey() {
-    return this.publicKey != null;
-  }
-
-  public void setPublicKeyIsSet(boolean value) {
-    if (!value) {
-      this.publicKey = null;
-    }
-  }
-
-  public String getPrivateKey() {
-    return this.privateKey;
-  }
-
-  public SSHCredential setPrivateKey(String privateKey) {
-    this.privateKey = privateKey;
-    return this;
-  }
-
-  public void unsetPrivateKey() {
-    this.privateKey = null;
-  }
-
-  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
-  public boolean isSetPrivateKey() {
-    return this.privateKey != null;
-  }
-
-  public void setPrivateKeyIsSet(boolean value) {
-    if (!value) {
-      this.privateKey = null;
-    }
-  }
-
-  public long getPersistedTime() {
-    return this.persistedTime;
-  }
-
-  public SSHCredential setPersistedTime(long persistedTime) {
-    this.persistedTime = persistedTime;
-    setPersistedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetPersistedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetPersistedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
-  }
-
-  public void setPersistedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
-  }
-
-  public String getToken() {
-    return this.token;
-  }
-
-  public SSHCredential setToken(String token) {
-    this.token = token;
-    return this;
-  }
-
-  public void unsetToken() {
-    this.token = null;
-  }
-
-  /** Returns true if field token is set (has been assigned a value) and false otherwise */
-  public boolean isSetToken() {
-    return this.token != null;
-  }
-
-  public void setTokenIsSet(boolean value) {
-    if (!value) {
-      this.token = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case GATEWAY_ID:
-      if (value == null) {
-        unsetGatewayId();
-      } else {
-        setGatewayId((String)value);
-      }
-      break;
-
-    case USERNAME:
-      if (value == null) {
-        unsetUsername();
-      } else {
-        setUsername((String)value);
-      }
-      break;
-
-    case PASSPHRASE:
-      if (value == null) {
-        unsetPassphrase();
-      } else {
-        setPassphrase((String)value);
-      }
-      break;
-
-    case PUBLIC_KEY:
-      if (value == null) {
-        unsetPublicKey();
-      } else {
-        setPublicKey((String)value);
-      }
-      break;
-
-    case PRIVATE_KEY:
-      if (value == null) {
-        unsetPrivateKey();
-      } else {
-        setPrivateKey((String)value);
-      }
-      break;
-
-    case PERSISTED_TIME:
-      if (value == null) {
-        unsetPersistedTime();
-      } else {
-        setPersistedTime((Long)value);
-      }
-      break;
-
-    case TOKEN:
-      if (value == null) {
-        unsetToken();
-      } else {
-        setToken((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case GATEWAY_ID:
-      return getGatewayId();
-
-    case USERNAME:
-      return getUsername();
-
-    case PASSPHRASE:
-      return getPassphrase();
-
-    case PUBLIC_KEY:
-      return getPublicKey();
-
-    case PRIVATE_KEY:
-      return getPrivateKey();
-
-    case PERSISTED_TIME:
-      return Long.valueOf(getPersistedTime());
-
-    case TOKEN:
-      return getToken();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case GATEWAY_ID:
-      return isSetGatewayId();
-    case USERNAME:
-      return isSetUsername();
-    case PASSPHRASE:
-      return isSetPassphrase();
-    case PUBLIC_KEY:
-      return isSetPublicKey();
-    case PRIVATE_KEY:
-      return isSetPrivateKey();
-    case PERSISTED_TIME:
-      return isSetPersistedTime();
-    case TOKEN:
-      return isSetToken();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof SSHCredential)
-      return this.equals((SSHCredential)that);
-    return false;
-  }
-
-  public boolean equals(SSHCredential that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_gatewayId = true && this.isSetGatewayId();
-    boolean that_present_gatewayId = true && that.isSetGatewayId();
-    if (this_present_gatewayId || that_present_gatewayId) {
-      if (!(this_present_gatewayId && that_present_gatewayId))
-        return false;
-      if (!this.gatewayId.equals(that.gatewayId))
-        return false;
-    }
-
-    boolean this_present_username = true && this.isSetUsername();
-    boolean that_present_username = true && that.isSetUsername();
-    if (this_present_username || that_present_username) {
-      if (!(this_present_username && that_present_username))
-        return false;
-      if (!this.username.equals(that.username))
-        return false;
-    }
-
-    boolean this_present_passphrase = true && this.isSetPassphrase();
-    boolean that_present_passphrase = true && that.isSetPassphrase();
-    if (this_present_passphrase || that_present_passphrase) {
-      if (!(this_present_passphrase && that_present_passphrase))
-        return false;
-      if (!this.passphrase.equals(that.passphrase))
-        return false;
-    }
-
-    boolean this_present_publicKey = true && this.isSetPublicKey();
-    boolean that_present_publicKey = true && that.isSetPublicKey();
-    if (this_present_publicKey || that_present_publicKey) {
-      if (!(this_present_publicKey && that_present_publicKey))
-        return false;
-      if (!this.publicKey.equals(that.publicKey))
-        return false;
-    }
-
-    boolean this_present_privateKey = true && this.isSetPrivateKey();
-    boolean that_present_privateKey = true && that.isSetPrivateKey();
-    if (this_present_privateKey || that_present_privateKey) {
-      if (!(this_present_privateKey && that_present_privateKey))
-        return false;
-      if (!this.privateKey.equals(that.privateKey))
-        return false;
-    }
-
-    boolean this_present_persistedTime = true && this.isSetPersistedTime();
-    boolean that_present_persistedTime = true && that.isSetPersistedTime();
-    if (this_present_persistedTime || that_present_persistedTime) {
-      if (!(this_present_persistedTime && that_present_persistedTime))
-        return false;
-      if (this.persistedTime != that.persistedTime)
-        return false;
-    }
-
-    boolean this_present_token = true && this.isSetToken();
-    boolean that_present_token = true && that.isSetToken();
-    if (this_present_token || that_present_token) {
-      if (!(this_present_token && that_present_token))
-        return false;
-      if (!this.token.equals(that.token))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(SSHCredential other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGatewayId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUsername()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPassphrase()).compareTo(other.isSetPassphrase());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPassphrase()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passphrase, other.passphrase);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPublicKey()).compareTo(other.isSetPublicKey());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPublicKey()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.publicKey, other.publicKey);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPrivateKey()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPersistedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetToken()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("SSHCredential(");
-    boolean first = true;
-
-    sb.append("gatewayId:");
-    if (this.gatewayId == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.gatewayId);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("username:");
-    if (this.username == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.username);
-    }
-    first = false;
-    if (!first) sb.append(", ");
-    sb.append("passphrase:");
-    if (this.passphrase == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.passphrase);
-    }
-    first = false;
-    if (isSetPublicKey()) {
-      if (!first) sb.append(", ");
-      sb.append("publicKey:");
-      if (this.publicKey == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.publicKey);
-      }
-      first = false;
-    }
-    if (isSetPrivateKey()) {
-      if (!first) sb.append(", ");
-      sb.append("privateKey:");
-      if (this.privateKey == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.privateKey);
-      }
-      first = false;
-    }
-    if (isSetPersistedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("persistedTime:");
-      sb.append(this.persistedTime);
-      first = false;
-    }
-    if (isSetToken()) {
-      if (!first) sb.append(", ");
-      sb.append("token:");
-      if (this.token == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.token);
-      }
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (gatewayId == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
-    }
-    if (username == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
-    }
-    if (passphrase == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'passphrase' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class SSHCredentialStandardSchemeFactory implements SchemeFactory {
-    public SSHCredentialStandardScheme getScheme() {
-      return new SSHCredentialStandardScheme();
-    }
-  }
-
-  private static class SSHCredentialStandardScheme extends StandardScheme<SSHCredential> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, SSHCredential struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // GATEWAY_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.gatewayId = iprot.readString();
-              struct.setGatewayIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // USERNAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.username = iprot.readString();
-              struct.setUsernameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // PASSPHRASE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.passphrase = iprot.readString();
-              struct.setPassphraseIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // PUBLIC_KEY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.publicKey = iprot.readString();
-              struct.setPublicKeyIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // PRIVATE_KEY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.privateKey = iprot.readString();
-              struct.setPrivateKeyIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // PERSISTED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.persistedTime = iprot.readI64();
-              struct.setPersistedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 7: // TOKEN
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.token = iprot.readString();
-              struct.setTokenIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, SSHCredential struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.gatewayId != null) {
-        oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
-        oprot.writeString(struct.gatewayId);
-        oprot.writeFieldEnd();
-      }
-      if (struct.username != null) {
-        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
-        oprot.writeString(struct.username);
-        oprot.writeFieldEnd();
-      }
-      if (struct.passphrase != null) {
-        oprot.writeFieldBegin(PASSPHRASE_FIELD_DESC);
-        oprot.writeString(struct.passphrase);
-        oprot.writeFieldEnd();
-      }
-      if (struct.publicKey != null) {
-        if (struct.isSetPublicKey()) {
-          oprot.writeFieldBegin(PUBLIC_KEY_FIELD_DESC);
-          oprot.writeString(struct.publicKey);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.privateKey != null) {
-        if (struct.isSetPrivateKey()) {
-          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
-          oprot.writeString(struct.privateKey);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.persistedTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.token != null) {
-        if (struct.isSetToken()) {
-          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
-          oprot.writeString(struct.token);
-          oprot.writeFieldEnd();
-        }
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class SSHCredentialTupleSchemeFactory implements SchemeFactory {
-    public SSHCredentialTupleScheme getScheme() {
-      return new SSHCredentialTupleScheme();
-    }
-  }
-
-  private static class SSHCredentialTupleScheme extends TupleScheme<SSHCredential> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.gatewayId);
-      oprot.writeString(struct.username);
-      oprot.writeString(struct.passphrase);
-      BitSet optionals = new BitSet();
-      if (struct.isSetPublicKey()) {
-        optionals.set(0);
-      }
-      if (struct.isSetPrivateKey()) {
-        optionals.set(1);
-      }
-      if (struct.isSetPersistedTime()) {
-        optionals.set(2);
-      }
-      if (struct.isSetToken()) {
-        optionals.set(3);
-      }
-      oprot.writeBitSet(optionals, 4);
-      if (struct.isSetPublicKey()) {
-        oprot.writeString(struct.publicKey);
-      }
-      if (struct.isSetPrivateKey()) {
-        oprot.writeString(struct.privateKey);
-      }
-      if (struct.isSetPersistedTime()) {
-        oprot.writeI64(struct.persistedTime);
-      }
-      if (struct.isSetToken()) {
-        oprot.writeString(struct.token);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.gatewayId = iprot.readString();
-      struct.setGatewayIdIsSet(true);
-      struct.username = iprot.readString();
-      struct.setUsernameIsSet(true);
-      struct.passphrase = iprot.readString();
-      struct.setPassphraseIsSet(true);
-      BitSet incoming = iprot.readBitSet(4);
-      if (incoming.get(0)) {
-        struct.publicKey = iprot.readString();
-        struct.setPublicKeyIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.privateKey = iprot.readString();
-        struct.setPrivateKeyIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.persistedTime = iprot.readI64();
-        struct.setPersistedTimeIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.token = iprot.readString();
-        struct.setTokenIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
deleted file mode 100644
index b17513a..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
+++ /dev/null
@@ -1,55 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.datamodel;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class csDataModelConstants {
-
-  public static final String DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS";
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
deleted file mode 100644
index 7be01da..0000000
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
+++ /dev/null
@@ -1,397 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.credential.store.exception;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class CredentialStoreException extends TException implements org.apache.thrift.TBase<CredentialStoreException, CredentialStoreException._Fields>, java.io.Serializable, Cloneable, Comparable<CredentialStoreException> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CredentialStoreException");
-
-  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new CredentialStoreExceptionStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new CredentialStoreExceptionTupleSchemeFactory());
-  }
-
-  public String message; // 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 {
-    MESSAGE((short)1, "message");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // MESSAGE
-          return MESSAGE;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-  static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(CredentialStoreException.class, metaDataMap);
-  }
-
-  public CredentialStoreException() {
-  }
-
-  public CredentialStoreException(
-    String message)
-  {
-    this();
-    this.message = message;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public CredentialStoreException(CredentialStoreException other) {
-    if (other.isSetMessage()) {
-      this.message = other.message;
-    }
-  }
-
-  public CredentialStoreException deepCopy() {
-    return new CredentialStoreException(this);
-  }
-
-  @Override
-  public void clear() {
-    this.message = null;
-  }
-
-  public String getMessage() {
-    return this.message;
-  }
-
-  public CredentialStoreException setMessage(String message) {
-    this.message = message;
-    return this;
-  }
-
-  public void unsetMessage() {
-    this.message = null;
-  }
-
-  /** Returns true if field message is set (has been assigned a value) and false otherwise */
-  public boolean isSetMessage() {
-    return this.message != null;
-  }
-
-  public void setMessageIsSet(boolean value) {
-    if (!value) {
-      this.message = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case MESSAGE:
-      if (value == null) {
-        unsetMessage();
-      } else {
-        setMessage((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case MESSAGE:
-      return getMessage();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case MESSAGE:
-      return isSetMessage();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof CredentialStoreException)
-      return this.equals((CredentialStoreException)that);
-    return false;
-  }
-
-  public boolean equals(CredentialStoreException that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_message = true && this.isSetMessage();
-    boolean that_present_message = true && that.isSetMessage();
-    if (this_present_message || that_present_message) {
-      if (!(this_present_message && that_present_message))
-        return false;
-      if (!this.message.equals(that.message))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(CredentialStoreException other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetMessage()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("CredentialStoreException(");
-    boolean first = true;
-
-    sb.append("message:");
-    if (this.message == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.message);
-    }
-    first = false;
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (message == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class CredentialStoreExceptionStandardSchemeFactory implements SchemeFactory {
-    public CredentialStoreExceptionStandardScheme getScheme() {
-      return new CredentialStoreExceptionStandardScheme();
-    }
-  }
-
-  private static class CredentialStoreExceptionStandardScheme extends StandardScheme<CredentialStoreException> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // MESSAGE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.message = iprot.readString();
-              struct.setMessageIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.message != null) {
-        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
-        oprot.writeString(struct.message);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class CredentialStoreExceptionTupleSchemeFactory implements SchemeFactory {
-    public CredentialStoreExceptionTupleScheme getScheme() {
-      return new CredentialStoreExceptionTupleScheme();
-    }
-  }
-
-  private static class CredentialStoreExceptionTupleScheme extends TupleScheme<CredentialStoreException> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.message);
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.message = iprot.readString();
-      struct.setMessageIsSet(true);
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
index f0e14d5..ebed9a1 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
@@ -67,8 +67,8 @@ public class CredentialStoreServer  implements IServer {
                         new TSSLTransportFactory.TSSLTransportParameters();
                 String keystorePath = ServerSettings.getCredentialStoreThriftServerKeyStorePath();
                 String keystorePWD = ServerSettings.getCredentialStoreThriftServerKeyStorePassword();
-                final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_PORT, "8960"));
-                final String serverHost = ServerSettings.getSetting(Constants.CREDNETIAL_SERVER_HOST, null);
+                final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_PORT, "8960"));
+                final String serverHost = ServerSettings.getSetting(Constants.CREDENTIAL_SERVER_HOST, null);
                 params.setKeyStore(keystorePath, keystorePWD);
 
                 TServerSocket serverTransport = TSSLTransportFactory.getServerSocket(serverPort, 100, InetAddress.getByName(serverHost), params);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b25e0a5d/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
index b5b1ac0..8205a22 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
@@ -24,7 +24,7 @@ import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.DBUtil;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.credential.store.cpi.CredentialStoreService;
-import org.apache.airavata.credential.store.cpi.cs_cpi_serviceConstants;
+import org.apache.airavata.credential.store.cpi.credentialStoreCPIConstants;
 import org.apache.airavata.credential.store.credential.CommunityUser;
 import org.apache.airavata.credential.store.credential.Credential;
 import org.apache.airavata.credential.store.datamodel.CertificateCredential;
@@ -69,7 +69,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
 
     @Override
     public String getCSServiceVersion() throws TException {
-        return cs_cpi_serviceConstants.CS_CPI_VERSION;
+        return credentialStoreCPIConstants.CS_CPI_VERSION;
     }
 
     @Override
@@ -107,9 +107,9 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
         try {
             org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential credential = new org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential();
             credential.setPortalUserName(certificateCredential.getCommunityUser().getUsername());
-            credential.setCommunityUser(new CommunityUser(certificateCredential.getCommunityUser().getGatewayNmae(),
+            credential.setCommunityUser(new CommunityUser(certificateCredential.getCommunityUser().getGatewayName(),
                     certificateCredential.getCommunityUser().getUsername(), certificateCredential.getCommunityUser().getUserEmail()));
-            String token = TokenGenerator.generateToken(certificateCredential.getCommunityUser().getGatewayNmae(), null);
+            String token = TokenGenerator.generateToken(certificateCredential.getCommunityUser().getGatewayName(), null);
             credential.setToken(token);
             Base64 encoder = new Base64(64);
             byte [] decoded = encoder.decode(certificateCredential.getX509Cert().replaceAll(X509Factory.BEGIN_CERT, "").replaceAll(X509Factory.END_CERT, ""));
@@ -168,7 +168,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
                 org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential credential1 = (org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential) credential;
                 CertificateCredential certificateCredential = new CertificateCredential();
                 org.apache.airavata.credential.store.datamodel.CommunityUser communityUser = new org.apache.airavata.credential.store.datamodel.CommunityUser();
-                communityUser.setGatewayNmae(credential1.getCommunityUser().getGatewayName());
+                communityUser.setGatewayName(credential1.getCommunityUser().getGatewayName());
                 communityUser.setUsername(credential1.getCommunityUser().getUserName());
                 communityUser.setUserEmail(credential1.getCommunityUser().getUserEmail());
                 certificateCredential.setCommunityUser(communityUser);


[59/62] [abbrv] airavata git commit: fixing AIRAVATA-1634

Posted by la...@apache.org.
fixing AIRAVATA-1634


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: f708304446dae8aa02244a9baa05cba13242a166
Parents: d09957b
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Tue Mar 17 11:26:42 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Tue Mar 17 11:26:42 2015 -0400

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java       | 4 ++++
 .../apache/airavata/client/tools/RegisterSampleApplications.java | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f7083044/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index a2bd3c7..fd1dfd7 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -1361,6 +1361,10 @@ public class AiravataServerHandler implements Airavata.Iface {
             Experiment existingExperiment = (Experiment)registry.get(RegistryModelType.EXPERIMENT, existingExperimentID);
             String gatewayId = (String)registry.getValue(RegistryModelType.EXPERIMENT, existingExperimentID, Constants.FieldConstants.ExperimentConstants.GATEWAY);
             existingExperiment.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
+            if (existingExperiment.getApplicationId() != null){
+                List<OutputDataObjectType> applicationOutputs = getApplicationOutputs(existingExperiment.getApplicationId());
+                existingExperiment.setExperimentOutputs(applicationOutputs);
+            }
             if (validateString(newExperiementName)){
                 existingExperiment.setName(newExperiementName);
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f7083044/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index b562eb0..e10dde2 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -257,7 +257,7 @@ public class RegisterSampleApplications {
 		UnicoreJobSubmission ucrJobSubmission = new UnicoreJobSubmission();
 		ucrJobSubmission.setSecurityProtocol(securityProtocol);
 		ucrJobSubmission.setUnicoreEndPointURL(unicoreEndPointURL);
-		ucrJobSubmission.setAuthenticationMode(AuthenticationMode.MYPROXY_ISSUED);
+//		ucrJobSubmission.setAuthenticationMode(AuthenticationMode.MYPROXY_ISSUED);
 		jobSubmission.setJobSubmissionProtocol(JobSubmissionProtocol.UNICORE);
 		
 		airavataClient.addUNICOREJobSubmissionDetails(fsdResourceId, 0, ucrJobSubmission);


[55/62] [abbrv] airavata git commit: Fixed AIRAVATA-1631.

Posted by la...@apache.org.
Fixed AIRAVATA-1631.

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/5d7a0341
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/5d7a0341
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/5d7a0341

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 5d7a034155f0acb48c15f1420c3ab452523f40ad
Parents: a4fb489
Author: raminder <ra...@apache.org>
Authored: Mon Mar 16 14:22:50 2015 -0400
Committer: raminder <ra...@apache.org>
Committed: Mon Mar 16 14:22:50 2015 -0400

----------------------------------------------------------------------
 .../airavata/gfac/core/cpi/BetterGfacImpl.java    | 18 +++++++++++++++---
 .../airavata/gfac/ssh/util/HandleOutputs.java     |  5 +----
 2 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/5d7a0341/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 2ff0338..6b20118 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -385,10 +385,22 @@ public class BetterGfacImpl implements GFac,Watcher {
 
         for (OutputDataObjectType objectType : taskOutputs){
             if (objectType.getType() == DataType.URI && objectType.getValue() != null){
-                // this should be also the relatvie path : in case of clone, this will contain full path
+                // this should be also the relative path : in case of clone, this will contain full path
                 String filePath = objectType.getValue();
-                filePath = filePath.substring(filePath.lastIndexOf(File.separatorChar) + 1, filePath.length());
-                objectType.setValue(jobExecutionContext.getOutputDir() + File.separator + filePath);
+                if(objectType.getLocation() == null && objectType.getLocation().isEmpty() && filePath.contains(File.separator)){
+                filePath = jobExecutionContext.getOutputDir() + File.separator + filePath.substring(filePath.lastIndexOf(File.separatorChar) + 1, filePath.length());
+                }
+                //output is not in working folder
+                if (objectType.getLocation() != null && !objectType.getLocation().isEmpty()) {
+                	if(objectType.getLocation().startsWith(File.separator)){
+                		filePath = objectType.getLocation() + File.separator + filePath;
+                    }else{
+                    	filePath = jobExecutionContext.getOutputDir() + File.separator + filePath;
+                    }
+                	filePath = objectType.getLocation()+ filePath;
+                }
+                objectType.setValue(filePath);
+                
             }
             if (objectType.getType() == DataType.STDOUT){
                 objectType.setValue(jobExecutionContext.getOutputDir() + File.separator + jobExecutionContext.getApplicationName() + ".stdout");

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d7a0341/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/HandleOutputs.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/HandleOutputs.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/HandleOutputs.java
index e64b0be..ddab0f4 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/HandleOutputs.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/HandleOutputs.java
@@ -37,12 +37,9 @@ public class HandleOutputs {
 					String outputFile = output.getValue();
 					String fileName = outputFile.substring(outputFile.lastIndexOf(File.separatorChar) + 1, outputFile.length());
 
-					if (!outputList.contains(fileName) && output.isIsRequired()) {
+					if (output.getLocation() == null && !outputList.contains(fileName) && output.isIsRequired()) {
 						missingOutput = true;
 					} else {
-						if (output.getLocation() != null && !output.getLocation().isEmpty()) {
-							outputFile = output.getLocation()+ fileName;
-						}
 						cluster.scpFrom(outputFile, outputDataDir);
 						String localFile = outputDataDir + File.separator + fileName;
 						jobExecutionContext.addOutputFile(localFile);


[02/62] [abbrv] airavata git commit: Reorganizing credential store to create a light weight stubs artifact - AIRAVATA-1621

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
new file mode 100644
index 0000000..9fc373a
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
@@ -0,0 +1,998 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class SSHCredential implements org.apache.thrift.TBase<SSHCredential, SSHCredential._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredential");
+
+  private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField PASSPHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("passphrase", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField PUBLIC_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("publicKey", org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)5);
+  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)6);
+  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)7);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new SSHCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new SSHCredentialTupleSchemeFactory());
+  }
+
+  public String gatewayId; // required
+  public String username; // required
+  public String passphrase; // required
+  public String publicKey; // optional
+  public String privateKey; // optional
+  public long persistedTime; // optional
+  public String token; // optional
+
+  /** 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 {
+    GATEWAY_ID((short)1, "gatewayId"),
+    USERNAME((short)2, "username"),
+    PASSPHRASE((short)3, "passphrase"),
+    PUBLIC_KEY((short)4, "publicKey"),
+    PRIVATE_KEY((short)5, "privateKey"),
+    PERSISTED_TIME((short)6, "persistedTime"),
+    TOKEN((short)7, "token");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // GATEWAY_ID
+          return GATEWAY_ID;
+        case 2: // USERNAME
+          return USERNAME;
+        case 3: // PASSPHRASE
+          return PASSPHRASE;
+        case 4: // PUBLIC_KEY
+          return PUBLIC_KEY;
+        case 5: // PRIVATE_KEY
+          return PRIVATE_KEY;
+        case 6: // PERSISTED_TIME
+          return PERSISTED_TIME;
+        case 7: // TOKEN
+          return TOKEN;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __PERSISTEDTIME_ISSET_ID = 0;
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.PUBLIC_KEY,_Fields.PRIVATE_KEY,_Fields.PERSISTED_TIME,_Fields.TOKEN};
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PASSPHRASE, new org.apache.thrift.meta_data.FieldMetaData("passphrase", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PUBLIC_KEY, new org.apache.thrift.meta_data.FieldMetaData("publicKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SSHCredential.class, metaDataMap);
+  }
+
+  public SSHCredential() {
+  }
+
+  public SSHCredential(
+    String gatewayId,
+    String username,
+    String passphrase)
+  {
+    this();
+    this.gatewayId = gatewayId;
+    this.username = username;
+    this.passphrase = passphrase;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public SSHCredential(SSHCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetGatewayId()) {
+      this.gatewayId = other.gatewayId;
+    }
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetPassphrase()) {
+      this.passphrase = other.passphrase;
+    }
+    if (other.isSetPublicKey()) {
+      this.publicKey = other.publicKey;
+    }
+    if (other.isSetPrivateKey()) {
+      this.privateKey = other.privateKey;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public SSHCredential deepCopy() {
+    return new SSHCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.gatewayId = null;
+    this.username = null;
+    this.passphrase = null;
+    this.publicKey = null;
+    this.privateKey = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public String getGatewayId() {
+    return this.gatewayId;
+  }
+
+  public SSHCredential setGatewayId(String gatewayId) {
+    this.gatewayId = gatewayId;
+    return this;
+  }
+
+  public void unsetGatewayId() {
+    this.gatewayId = null;
+  }
+
+  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+  public boolean isSetGatewayId() {
+    return this.gatewayId != null;
+  }
+
+  public void setGatewayIdIsSet(boolean value) {
+    if (!value) {
+      this.gatewayId = null;
+    }
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public SSHCredential setUsername(String username) {
+    this.username = username;
+    return this;
+  }
+
+  public void unsetUsername() {
+    this.username = null;
+  }
+
+  /** Returns true if field username is set (has been assigned a value) and false otherwise */
+  public boolean isSetUsername() {
+    return this.username != null;
+  }
+
+  public void setUsernameIsSet(boolean value) {
+    if (!value) {
+      this.username = null;
+    }
+  }
+
+  public String getPassphrase() {
+    return this.passphrase;
+  }
+
+  public SSHCredential setPassphrase(String passphrase) {
+    this.passphrase = passphrase;
+    return this;
+  }
+
+  public void unsetPassphrase() {
+    this.passphrase = null;
+  }
+
+  /** Returns true if field passphrase is set (has been assigned a value) and false otherwise */
+  public boolean isSetPassphrase() {
+    return this.passphrase != null;
+  }
+
+  public void setPassphraseIsSet(boolean value) {
+    if (!value) {
+      this.passphrase = null;
+    }
+  }
+
+  public String getPublicKey() {
+    return this.publicKey;
+  }
+
+  public SSHCredential setPublicKey(String publicKey) {
+    this.publicKey = publicKey;
+    return this;
+  }
+
+  public void unsetPublicKey() {
+    this.publicKey = null;
+  }
+
+  /** Returns true if field publicKey is set (has been assigned a value) and false otherwise */
+  public boolean isSetPublicKey() {
+    return this.publicKey != null;
+  }
+
+  public void setPublicKeyIsSet(boolean value) {
+    if (!value) {
+      this.publicKey = null;
+    }
+  }
+
+  public String getPrivateKey() {
+    return this.privateKey;
+  }
+
+  public SSHCredential setPrivateKey(String privateKey) {
+    this.privateKey = privateKey;
+    return this;
+  }
+
+  public void unsetPrivateKey() {
+    this.privateKey = null;
+  }
+
+  /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */
+  public boolean isSetPrivateKey() {
+    return this.privateKey != null;
+  }
+
+  public void setPrivateKeyIsSet(boolean value) {
+    if (!value) {
+      this.privateKey = null;
+    }
+  }
+
+  public long getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public SSHCredential setPersistedTime(long persistedTime) {
+    this.persistedTime = persistedTime;
+    setPersistedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetPersistedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetPersistedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID);
+  }
+
+  public void setPersistedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value);
+  }
+
+  public String getToken() {
+    return this.token;
+  }
+
+  public SSHCredential setToken(String token) {
+    this.token = token;
+    return this;
+  }
+
+  public void unsetToken() {
+    this.token = null;
+  }
+
+  /** Returns true if field token is set (has been assigned a value) and false otherwise */
+  public boolean isSetToken() {
+    return this.token != null;
+  }
+
+  public void setTokenIsSet(boolean value) {
+    if (!value) {
+      this.token = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case GATEWAY_ID:
+      if (value == null) {
+        unsetGatewayId();
+      } else {
+        setGatewayId((String)value);
+      }
+      break;
+
+    case USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case PASSPHRASE:
+      if (value == null) {
+        unsetPassphrase();
+      } else {
+        setPassphrase((String)value);
+      }
+      break;
+
+    case PUBLIC_KEY:
+      if (value == null) {
+        unsetPublicKey();
+      } else {
+        setPublicKey((String)value);
+      }
+      break;
+
+    case PRIVATE_KEY:
+      if (value == null) {
+        unsetPrivateKey();
+      } else {
+        setPrivateKey((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Long)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case GATEWAY_ID:
+      return getGatewayId();
+
+    case USERNAME:
+      return getUsername();
+
+    case PASSPHRASE:
+      return getPassphrase();
+
+    case PUBLIC_KEY:
+      return getPublicKey();
+
+    case PRIVATE_KEY:
+      return getPrivateKey();
+
+    case PERSISTED_TIME:
+      return Long.valueOf(getPersistedTime());
+
+    case TOKEN:
+      return getToken();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case GATEWAY_ID:
+      return isSetGatewayId();
+    case USERNAME:
+      return isSetUsername();
+    case PASSPHRASE:
+      return isSetPassphrase();
+    case PUBLIC_KEY:
+      return isSetPublicKey();
+    case PRIVATE_KEY:
+      return isSetPrivateKey();
+    case PERSISTED_TIME:
+      return isSetPersistedTime();
+    case TOKEN:
+      return isSetToken();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof SSHCredential)
+      return this.equals((SSHCredential)that);
+    return false;
+  }
+
+  public boolean equals(SSHCredential that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_gatewayId = true && this.isSetGatewayId();
+    boolean that_present_gatewayId = true && that.isSetGatewayId();
+    if (this_present_gatewayId || that_present_gatewayId) {
+      if (!(this_present_gatewayId && that_present_gatewayId))
+        return false;
+      if (!this.gatewayId.equals(that.gatewayId))
+        return false;
+    }
+
+    boolean this_present_username = true && this.isSetUsername();
+    boolean that_present_username = true && that.isSetUsername();
+    if (this_present_username || that_present_username) {
+      if (!(this_present_username && that_present_username))
+        return false;
+      if (!this.username.equals(that.username))
+        return false;
+    }
+
+    boolean this_present_passphrase = true && this.isSetPassphrase();
+    boolean that_present_passphrase = true && that.isSetPassphrase();
+    if (this_present_passphrase || that_present_passphrase) {
+      if (!(this_present_passphrase && that_present_passphrase))
+        return false;
+      if (!this.passphrase.equals(that.passphrase))
+        return false;
+    }
+
+    boolean this_present_publicKey = true && this.isSetPublicKey();
+    boolean that_present_publicKey = true && that.isSetPublicKey();
+    if (this_present_publicKey || that_present_publicKey) {
+      if (!(this_present_publicKey && that_present_publicKey))
+        return false;
+      if (!this.publicKey.equals(that.publicKey))
+        return false;
+    }
+
+    boolean this_present_privateKey = true && this.isSetPrivateKey();
+    boolean that_present_privateKey = true && that.isSetPrivateKey();
+    if (this_present_privateKey || that_present_privateKey) {
+      if (!(this_present_privateKey && that_present_privateKey))
+        return false;
+      if (!this.privateKey.equals(that.privateKey))
+        return false;
+    }
+
+    boolean this_present_persistedTime = true && this.isSetPersistedTime();
+    boolean that_present_persistedTime = true && that.isSetPersistedTime();
+    if (this_present_persistedTime || that_present_persistedTime) {
+      if (!(this_present_persistedTime && that_present_persistedTime))
+        return false;
+      if (this.persistedTime != that.persistedTime)
+        return false;
+    }
+
+    boolean this_present_token = true && this.isSetToken();
+    boolean that_present_token = true && that.isSetToken();
+    if (this_present_token || that_present_token) {
+      if (!(this_present_token && that_present_token))
+        return false;
+      if (!this.token.equals(that.token))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(SSHCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGatewayId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUsername()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPassphrase()).compareTo(other.isSetPassphrase());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPassphrase()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passphrase, other.passphrase);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPublicKey()).compareTo(other.isSetPublicKey());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPublicKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.publicKey, other.publicKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPrivateKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPersistedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetToken()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("SSHCredential(");
+    boolean first = true;
+
+    sb.append("gatewayId:");
+    if (this.gatewayId == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.gatewayId);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("passphrase:");
+    if (this.passphrase == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.passphrase);
+    }
+    first = false;
+    if (isSetPublicKey()) {
+      if (!first) sb.append(", ");
+      sb.append("publicKey:");
+      if (this.publicKey == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.publicKey);
+      }
+      first = false;
+    }
+    if (isSetPrivateKey()) {
+      if (!first) sb.append(", ");
+      sb.append("privateKey:");
+      if (this.privateKey == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.privateKey);
+      }
+      first = false;
+    }
+    if (isSetPersistedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("persistedTime:");
+      sb.append(this.persistedTime);
+      first = false;
+    }
+    if (isSetToken()) {
+      if (!first) sb.append(", ");
+      sb.append("token:");
+      if (this.token == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.token);
+      }
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (gatewayId == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
+    }
+    if (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+    }
+    if (passphrase == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'passphrase' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class SSHCredentialStandardSchemeFactory implements SchemeFactory {
+    public SSHCredentialStandardScheme getScheme() {
+      return new SSHCredentialStandardScheme();
+    }
+  }
+
+  private static class SSHCredentialStandardScheme extends StandardScheme<SSHCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, SSHCredential struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // GATEWAY_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.gatewayId = iprot.readString();
+              struct.setGatewayIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // USERNAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.username = iprot.readString();
+              struct.setUsernameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // PASSPHRASE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.passphrase = iprot.readString();
+              struct.setPassphraseIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // PUBLIC_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.publicKey = iprot.readString();
+              struct.setPublicKeyIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // PRIVATE_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.privateKey = iprot.readString();
+              struct.setPrivateKeyIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.persistedTime = iprot.readI64();
+              struct.setPersistedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // TOKEN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.token = iprot.readString();
+              struct.setTokenIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, SSHCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.gatewayId != null) {
+        oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+        oprot.writeString(struct.gatewayId);
+        oprot.writeFieldEnd();
+      }
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.passphrase != null) {
+        oprot.writeFieldBegin(PASSPHRASE_FIELD_DESC);
+        oprot.writeString(struct.passphrase);
+        oprot.writeFieldEnd();
+      }
+      if (struct.publicKey != null) {
+        if (struct.isSetPublicKey()) {
+          oprot.writeFieldBegin(PUBLIC_KEY_FIELD_DESC);
+          oprot.writeString(struct.publicKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.privateKey != null) {
+        if (struct.isSetPrivateKey()) {
+          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
+          oprot.writeString(struct.privateKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.persistedTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.token != null) {
+        if (struct.isSetToken()) {
+          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
+          oprot.writeString(struct.token);
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class SSHCredentialTupleSchemeFactory implements SchemeFactory {
+    public SSHCredentialTupleScheme getScheme() {
+      return new SSHCredentialTupleScheme();
+    }
+  }
+
+  private static class SSHCredentialTupleScheme extends TupleScheme<SSHCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.gatewayId);
+      oprot.writeString(struct.username);
+      oprot.writeString(struct.passphrase);
+      BitSet optionals = new BitSet();
+      if (struct.isSetPublicKey()) {
+        optionals.set(0);
+      }
+      if (struct.isSetPrivateKey()) {
+        optionals.set(1);
+      }
+      if (struct.isSetPersistedTime()) {
+        optionals.set(2);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(3);
+      }
+      oprot.writeBitSet(optionals, 4);
+      if (struct.isSetPublicKey()) {
+        oprot.writeString(struct.publicKey);
+      }
+      if (struct.isSetPrivateKey()) {
+        oprot.writeString(struct.privateKey);
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI64(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.gatewayId = iprot.readString();
+      struct.setGatewayIdIsSet(true);
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      struct.passphrase = iprot.readString();
+      struct.setPassphraseIsSet(true);
+      BitSet incoming = iprot.readBitSet(4);
+      if (incoming.get(0)) {
+        struct.publicKey = iprot.readString();
+        struct.setPublicKeyIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.privateKey = iprot.readString();
+        struct.setPrivateKeyIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.persistedTime = iprot.readI64();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/credentialStoreDataModelConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/credentialStoreDataModelConstants.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/credentialStoreDataModelConstants.java
new file mode 100644
index 0000000..975210d
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/credentialStoreDataModelConstants.java
@@ -0,0 +1,55 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.datamodel;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class credentialStoreDataModelConstants {
+
+  public static final String DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS";
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
new file mode 100644
index 0000000..7be01da
--- /dev/null
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
@@ -0,0 +1,397 @@
+    /*
+     * 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.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.exception;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CredentialStoreException extends TException implements org.apache.thrift.TBase<CredentialStoreException, CredentialStoreException._Fields>, java.io.Serializable, Cloneable, Comparable<CredentialStoreException> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CredentialStoreException");
+
+  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new CredentialStoreExceptionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new CredentialStoreExceptionTupleSchemeFactory());
+  }
+
+  public String message; // 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 {
+    MESSAGE((short)1, "message");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // MESSAGE
+          return MESSAGE;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(CredentialStoreException.class, metaDataMap);
+  }
+
+  public CredentialStoreException() {
+  }
+
+  public CredentialStoreException(
+    String message)
+  {
+    this();
+    this.message = message;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CredentialStoreException(CredentialStoreException other) {
+    if (other.isSetMessage()) {
+      this.message = other.message;
+    }
+  }
+
+  public CredentialStoreException deepCopy() {
+    return new CredentialStoreException(this);
+  }
+
+  @Override
+  public void clear() {
+    this.message = null;
+  }
+
+  public String getMessage() {
+    return this.message;
+  }
+
+  public CredentialStoreException setMessage(String message) {
+    this.message = message;
+    return this;
+  }
+
+  public void unsetMessage() {
+    this.message = null;
+  }
+
+  /** Returns true if field message is set (has been assigned a value) and false otherwise */
+  public boolean isSetMessage() {
+    return this.message != null;
+  }
+
+  public void setMessageIsSet(boolean value) {
+    if (!value) {
+      this.message = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case MESSAGE:
+      if (value == null) {
+        unsetMessage();
+      } else {
+        setMessage((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case MESSAGE:
+      return getMessage();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case MESSAGE:
+      return isSetMessage();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof CredentialStoreException)
+      return this.equals((CredentialStoreException)that);
+    return false;
+  }
+
+  public boolean equals(CredentialStoreException that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_message = true && this.isSetMessage();
+    boolean that_present_message = true && that.isSetMessage();
+    if (this_present_message || that_present_message) {
+      if (!(this_present_message && that_present_message))
+        return false;
+      if (!this.message.equals(that.message))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CredentialStoreException other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMessage()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("CredentialStoreException(");
+    boolean first = true;
+
+    sb.append("message:");
+    if (this.message == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.message);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (message == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class CredentialStoreExceptionStandardSchemeFactory implements SchemeFactory {
+    public CredentialStoreExceptionStandardScheme getScheme() {
+      return new CredentialStoreExceptionStandardScheme();
+    }
+  }
+
+  private static class CredentialStoreExceptionStandardScheme extends StandardScheme<CredentialStoreException> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // MESSAGE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.message = iprot.readString();
+              struct.setMessageIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.message != null) {
+        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+        oprot.writeString(struct.message);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class CredentialStoreExceptionTupleSchemeFactory implements SchemeFactory {
+    public CredentialStoreExceptionTupleScheme getScheme() {
+      return new CredentialStoreExceptionTupleScheme();
+    }
+  }
+
+  private static class CredentialStoreExceptionTupleScheme extends TupleScheme<CredentialStoreException> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.message);
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, CredentialStoreException struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.message = iprot.readString();
+      struct.setMessageIsSet(true);
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/pom.xml b/modules/credential-store/credential-store-webapp/pom.xml
new file mode 100644
index 0000000..e326fe8
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/pom.xml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>credential-store</artifactId>
+        <version>0.15-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>airavata-credential-store-webapp</artifactId>
+    <packaging>war</packaging>
+    <name>airavata-credential-store-webapp</name>
+    <build>
+        <finalName>credential-store</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.cargo</groupId>
+                <artifactId>cargo-maven2-plugin</artifactId>
+                <version>${cargo.version}</version>
+                <configuration>
+                    <wait>true</wait>
+                    <configuration>
+                        <properties>
+                            <cargo.servlet.port>8443</cargo.servlet.port>
+                            <cargo.protocol>https</cargo.protocol>
+                            <cargo.tomcat.connector.clientAuth>false</cargo.tomcat.connector.clientAuth>
+                            <cargo.tomcat.connector.sslProtocol>TLS</cargo.tomcat.connector.sslProtocol>
+                            <cargo.tomcat.connector.keystoreFile>/Users/chathuri/dev/airavata/credential-store/oa4mp/airavata_sym.jks</cargo.tomcat.connector.keystoreFile>
+                            <cargo.tomcat.connector.keystorePass>airavata</cargo.tomcat.connector.keystorePass>
+                            <cargo.tomcat.ajp.port>9009</cargo.tomcat.ajp.port>
+                            <cargo.rmi.port>9099</cargo.rmi.port>
+                            <cargo.jvmargs>
+                                <![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend} -noverify ${javaagent}]]>
+                            </cargo.jvmargs>
+                            <cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable>
+                        </properties>
+                        <home>${project.build.directory}/tomcat6x</home>
+                        <deployables>
+                            <deployable>
+                                <groupId>org.apache.airavata</groupId>
+                                <artifactId>airavata-credential-store-webapp</artifactId>
+                                <type>war</type>
+                                <properties>
+                                    <context>/acs</context>
+                                </properties>
+                            </deployable>
+                        </deployables>
+                    </configuration>
+                    <container>
+                        <containerId>tomcat6x</containerId>
+                        <timeout>180000</timeout>
+                        <zipUrlInstaller>
+                            <url>
+                                http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
+                            </url>
+                        </zipUrlInstaller>
+                        <systemProperties>
+
+                        </systemProperties>
+                    </container>
+                </configuration>
+            </plugin>
+        </plugins>
+
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <version>${derby.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-credential-store</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>net.oauth.core</groupId>
+            <artifactId>oauth-httpclient4</artifactId>
+            <version>20090617</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-security</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.6</version>
+        </dependency>
+        <!-- <dependency>
+            <groupId>edu.uiuc.ncsa.myproxy</groupId>
+            <artifactId>oa4mp-client-oauth1</artifactId>
+            <version>${oa4mp.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>mysql</groupId>
+                    <artifactId>mysql-connector-java</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>postgresql</groupId>
+                    <artifactId>postgresql</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency> -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${org.slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>${org.slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>${org.slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${org.slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ebaysf.web</groupId>
+            <artifactId>cors-filter</artifactId>
+            <version>${ebay.cors.filter}</version>
+        </dependency>
+    </dependencies>
+    <properties>
+        <cargo.version>1.2.1</cargo.version>
+        <cargo.debug.address>8000</cargo.debug.address>
+        <cargo.debug.suspend>y</cargo.debug.suspend>
+        <javaagent />
+    </properties>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java
new file mode 100644
index 0000000..c34cb1b
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/basic/BasicAccessAuthenticator.java
@@ -0,0 +1,226 @@
+/*
+ * 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.credentialstore.basic;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.credentialstore.session.ServletRequestHelper;
+import org.apache.airavata.security.AbstractAuthenticator;
+import org.apache.airavata.security.AuthenticationException;
+import org.apache.airavata.security.UserStoreException;
+import org.w3c.dom.Node;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+/**
+ * This authenticator handles basic access authentication requests. In basic access authentication
+ * we get user name and password as HTTP headers. The password is encoded with base64.
+ * More information @link{http://en.wikipedia.org/wiki/Basic_access_authentication}
+ */
+public class BasicAccessAuthenticator extends AbstractAuthenticator {
+
+
+    private static final String AUTHENTICATOR_NAME = "BasicAccessAuthenticator";
+
+    private ServletRequestHelper servletRequestHelper = new ServletRequestHelper();
+
+    public BasicAccessAuthenticator() {
+        super(AUTHENTICATOR_NAME);
+    }
+
+
+    /**
+     * Returns user name and password as an array. The first element is user name and second is password.
+     *
+     * @param httpServletRequest The servlet request.
+     * @return User name password pair as an array.
+     * @throws AuthenticationException If an error occurred while extracting user name and password.
+     */
+    private String[] getUserNamePassword(HttpServletRequest httpServletRequest) throws AuthenticationException {
+
+        String basicHeader = httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME);
+
+        if (basicHeader == null) {
+            throw new AuthenticationException("Authorization Required");
+        }
+
+        String[] userNamePasswordArray = basicHeader.split(" ");
+
+        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
+            throw new AuthenticationException("Authorization Required");
+        }
+
+        String decodedString = servletRequestHelper.decode(userNamePasswordArray[1]);
+
+        String[] array = decodedString.split(":");
+
+        if (array == null || array.length != 2) {
+            throw new AuthenticationException("Authorization Required");
+        }
+
+        return array;
+
+    }
+
+    @Override
+    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
+        if (this.getUserStore() == null) {
+            throw new AuthenticationException("Authenticator is not initialized. Error processing request.");
+        }
+
+        if (credentials == null)
+            return false;
+
+        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
+
+        String[] array = getUserNamePassword(httpServletRequest);
+
+        String userName = array[0];
+        String password = array[1];
+
+        try {
+            return this.getUserStore().authenticate(userName, password);
+
+        } catch (UserStoreException e) {
+            throw new AuthenticationException("Error querying database for session information.", e);
+        }
+    }
+
+
+
+    @Override
+    public void onSuccessfulAuthentication(Object authenticationInfo) {
+
+        HttpServletRequest httpServletRequest = (HttpServletRequest) authenticationInfo;
+
+        try {
+            String[] array = getUserNamePassword(httpServletRequest);
+
+            StringBuilder stringBuilder = new StringBuilder("User : ");
+
+            if (array != null) {
+
+                servletRequestHelper.addUserToSession(array[0], httpServletRequest);
+
+                stringBuilder.append(array[0]).append(" successfully logged into system at ").append(getCurrentTime());
+                log.debug(stringBuilder.toString());
+
+            } else {
+                log.error("System error occurred while extracting user name after authentication. " +
+                        "Couldn't extract user name from the request.");
+            }
+        } catch (AuthenticationException e) {
+            log.error("System error occurred while extracting user name after authentication.", e);
+        }
+
+    }
+
+    @Override
+    public void onFailedAuthentication(Object authenticationInfo) {
+
+        HttpServletRequest httpServletRequest = (HttpServletRequest) authenticationInfo;
+
+        try {
+            String[] array = getUserNamePassword(httpServletRequest);
+
+            StringBuilder stringBuilder = new StringBuilder("User : ");
+
+            if (array != null) {
+
+                stringBuilder.append(array[0]).append(" Failed login attempt to system at ").append(getCurrentTime());
+                log.warn(stringBuilder.toString());
+
+            } else {
+                stringBuilder.append("Failed login attempt to system at ").append(getCurrentTime()).append( ". User unknown.");
+                log.warn(stringBuilder.toString());
+            }
+        } catch (AuthenticationException e) {
+            log.error("System error occurred while extracting user name after authentication.", e);
+        }
+    }
+
+    @Override
+    public boolean isAuthenticated(Object credentials) {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
+
+        HttpSession httpSession = httpServletRequest.getSession();
+
+        boolean seenInSession = false;
+
+        if (httpSession != null) {
+        	 String user = null;
+        	 String gateway = null;
+        	try{
+             user = (String)httpSession.getAttribute(Constants.USER_IN_SESSION);
+             gateway = (String)httpSession.getAttribute(ServerSettings.getDefaultUserGateway());
+             }
+            catch (ApplicationSettingsException e1) {
+    			// TODO Auto-generated catch block
+    			e1.printStackTrace();
+    		}
+            if (user != null && gateway != null) {
+                servletRequestHelper.addToContext(user, gateway);
+                seenInSession = true;
+            }
+        }
+
+        return seenInSession;
+
+    }
+
+    @Override
+    public boolean canProcess(Object credentials) {
+
+        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
+
+        return (httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME) != null);
+    }
+
+
+
+    @Override
+    public void configure(Node node) throws RuntimeException {
+
+        /**
+         <specificConfigurations>
+         <database>
+         <jdbcUrl></jdbcUrl>
+         <databaseDriver></databaseDriver>
+         <userName></userName>
+         <password></password>
+         <userTableName></userTableName>
+         <userNameColumnName></userNameColumnName>
+         <passwordColumnName></passwordColumnName>
+         </database>
+         </specificConfigurations>
+         */
+
+        try {
+            this.getUserStore().configure(node);
+        } catch (UserStoreException e) {
+            throw new RuntimeException("Error while configuring authenticator user store", e);
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java
new file mode 100644
index 0000000..0a2ca83
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/local/LocalUserStore.java
@@ -0,0 +1,339 @@
+/*
+ *
+ * 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.credentialstore.local;
+
+import java.security.NoSuchAlgorithmException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.common.utils.SecurityUtil;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * User store to maintain internal DB database.
+ */
+public class LocalUserStore {
+
+    protected static Logger log = LoggerFactory.getLogger(LocalUserStore.class);
+
+    private DBUtil dbUtil;
+
+    private String hashMethod;
+
+    public LocalUserStore(ServletContext servletContext) throws Exception {
+        // Properties properties = WebAppUtil.getAiravataProperties(servletContext);
+
+        hashMethod = ServerSettings.getSetting("default.registry.password.hash.method");
+
+        dbUtil = new DBUtil(ServerSettings.getSetting("registry.jdbc.url"),
+                ServerSettings.getSetting("registry.jdbc.user"),
+                ServerSettings.getSetting("registry.jdbc.password"),
+                ServerSettings.getSetting("registry.jdbc.driver"));
+
+    }
+
+    public LocalUserStore(DBUtil db) {
+        dbUtil = db;
+    }
+
+    public void addUser(String userName, String password) {
+
+        String sql = "insert into Users values (?, ?)";
+
+        Connection connection = null;
+        PreparedStatement preparedStatement = null;
+
+        try {
+            connection = dbUtil.getConnection();
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, userName);
+            preparedStatement.setString(2, SecurityUtil.digestString(password, hashMethod));
+
+            preparedStatement.executeUpdate();
+
+            connection.commit();
+
+            log.debug("User " + userName + " successfully added.");
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error persisting user information.");
+            stringBuilder.append(" user - ").append(userName);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new RuntimeException(stringBuilder.toString(), e);
+        } catch (NoSuchAlgorithmException e) {
+            String stringBuilder = "Error creating hash value for password.";
+            log.error(stringBuilder, e);
+
+            throw new RuntimeException(stringBuilder, e);
+        } finally {
+
+            dbUtil.cleanup(preparedStatement, connection);
+        }
+
+    }
+
+    protected String getPassword(String userName, Connection connection) {
+
+        String sql = "select password from Users where user_name = ?";
+
+        PreparedStatement preparedStatement = null;
+        ResultSet resultSet = null;
+
+        try {
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, userName);
+
+            resultSet = preparedStatement.executeQuery();
+
+            if (resultSet.next()) {
+                return resultSet.getString("password");
+            }
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error retrieving credentials for user.");
+            stringBuilder.append("name - ").append(userName);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new RuntimeException(stringBuilder.toString(), e);
+        } finally {
+
+            if (resultSet != null) {
+                try {
+                    resultSet.close();
+                } catch (SQLException e) {
+                    log.error("Error closing result set", e);
+                }
+            }
+
+            if (preparedStatement != null) {
+                try {
+                    preparedStatement.close();
+                } catch (SQLException e) {
+                    log.error("Error closing prepared statement", e);
+                }
+            }
+        }
+
+        return null;
+    }
+
+    public void changePassword(String userName, String oldPassword, String newPassword) {
+
+        Connection connection = null;
+        PreparedStatement preparedStatement = null;
+
+        try {
+            connection = dbUtil.getConnection();
+
+            String storedPassword = getPassword(userName, connection);
+
+            String oldDigestedPassword = SecurityUtil.digestString(oldPassword, hashMethod);
+
+            if (storedPassword != null) {
+                if (!storedPassword.equals(oldDigestedPassword)) {
+                    throw new RuntimeException("Previous password did not match correctly. Please specify old password"
+                            + " correctly.");
+                }
+            }
+
+            String sql = "update Users set password = ? where user_name = ?";
+
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, SecurityUtil.digestString(newPassword, hashMethod));
+            preparedStatement.setString(2, userName);
+
+            preparedStatement.executeUpdate();
+
+            connection.commit();
+
+            log.debug("Password changed for user " + userName);
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
+            stringBuilder.append(" user - ").append(userName);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new RuntimeException(stringBuilder.toString(), e);
+        } catch (NoSuchAlgorithmException e) {
+            String stringBuilder = "Error creating hash value for password.";
+            log.error(stringBuilder, e);
+
+            throw new RuntimeException(stringBuilder, e);
+        } finally {
+
+            dbUtil.cleanup(preparedStatement, connection);
+        }
+
+    }
+
+    public void changePasswordByAdmin(String userName, String newPassword) {
+
+        Connection connection = null;
+        PreparedStatement preparedStatement = null;
+
+        try {
+            connection = dbUtil.getConnection();
+
+            String sql = "update Users set password = ? where user_name = ?";
+
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, SecurityUtil.digestString(newPassword, hashMethod));
+            preparedStatement.setString(2, userName);
+
+            preparedStatement.executeUpdate();
+
+            connection.commit();
+
+            log.debug("Admin changed password of user " + userName);
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
+            stringBuilder.append(" user - ").append(userName);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new RuntimeException(stringBuilder.toString(), e);
+        } catch (NoSuchAlgorithmException e) {
+            String stringBuilder = "Error creating hash value for password.";
+            log.error(stringBuilder, e);
+
+            throw new RuntimeException(stringBuilder, e);
+        } finally {
+
+            dbUtil.cleanup(preparedStatement, connection);
+        }
+
+    }
+
+    public void deleteUser(String userName) {
+
+        String sql = "delete from Users where user_name=?";
+
+        Connection connection = null;
+        PreparedStatement preparedStatement = null;
+
+        try {
+            connection = dbUtil.getConnection();
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, userName);
+
+            preparedStatement.executeUpdate();
+
+            connection.commit();
+
+            log.debug("User " + userName + " deleted.");
+
+        } catch (SQLException e) {
+            StringBuilder stringBuilder = new StringBuilder("Error deleting user.");
+            stringBuilder.append("user - ").append(userName);
+
+            log.error(stringBuilder.toString(), e);
+
+            throw new RuntimeException(stringBuilder.toString(), e);
+        } finally {
+            dbUtil.cleanup(preparedStatement, connection);
+        }
+
+    }
+
+    public List<String> getUsers() {
+
+        List<String> userList = new ArrayList<String>();
+
+        String sql = "select user_name from Users";
+
+        PreparedStatement preparedStatement = null;
+        ResultSet resultSet = null;
+        Connection connection = null;
+
+        try {
+
+            connection = dbUtil.getConnection();
+            preparedStatement = connection.prepareStatement(sql);
+
+            resultSet = preparedStatement.executeQuery();
+
+            while (resultSet.next()) {
+                userList.add(resultSet.getString("user_name"));
+            }
+
+        } catch (SQLException e) {
+            String errorString = "Error retrieving Users.";
+            log.error(errorString, e);
+
+            throw new RuntimeException(errorString, e);
+        } finally {
+
+            if (resultSet != null) {
+                try {
+                    resultSet.close();
+                } catch (SQLException e) {
+                    log.error("Error closing result set", e);
+                }
+            }
+
+            if (preparedStatement != null) {
+                try {
+                    preparedStatement.close();
+                } catch (SQLException e) {
+                    log.error("Error closing prepared statement", e);
+                }
+            }
+
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (SQLException e) {
+                    log.error("Error closing connection", e);
+                }
+            }
+        }
+
+        Collections.sort(userList);
+
+        return userList;
+
+    }
+
+    public static String getPasswordRegularExpression() {
+        return "'^[a-zA-Z0-9_-]{6,15}$'";
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/58c58cf2/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java
new file mode 100644
index 0000000..0847d54
--- /dev/null
+++ b/modules/credential-store/credential-store-webapp/src/main/java/org/apache/airavata/credentialstore/session/HttpAuthenticatorFilter.java
@@ -0,0 +1,191 @@
+/*
+ * 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.credentialstore.session;
+
+import org.apache.airavata.security.AuthenticationException;
+import org.apache.airavata.security.Authenticator;
+import org.apache.airavata.security.configurations.AuthenticatorConfigurationReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.SAXException;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Calendar;
+import java.util.List;
+
+/**
+ * A servlet filter class which intercepts the request and do authentication.
+ */
+public class HttpAuthenticatorFilter implements Filter {
+
+    private List<Authenticator> authenticatorList;
+
+    private static Logger log = LoggerFactory.getLogger(HttpAuthenticatorFilter.class);
+
+    private ServletRequestHelper servletRequestHelper = new ServletRequestHelper();
+
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+        String authenticatorConfiguration = filterConfig.getInitParameter("authenticatorConfigurations");
+
+        //TODO make this able to read from a file as well
+
+
+        InputStream configurationFileStream = HttpAuthenticatorFilter.class.getClassLoader().
+                getResourceAsStream(authenticatorConfiguration);
+
+        if (configurationFileStream == null) {
+            String msg = "Invalid authenticator configuration. Cannot read file - ".concat(authenticatorConfiguration);
+            log.error(msg);
+            throw new ServletException(msg);
+        }
+
+        AuthenticatorConfigurationReader authenticatorConfigurationReader
+                = new AuthenticatorConfigurationReader();
+        try {
+            authenticatorConfigurationReader.init(configurationFileStream);
+        } catch (IOException e) {
+            String msg = "Error reading authenticator configurations.";
+
+            log.error(msg, e);
+            throw new ServletException(msg, e);
+        } catch (ParserConfigurationException e) {
+            String msg = "Error parsing authenticator configurations.";
+
+            log.error(msg, e);
+            throw new ServletException(msg, e);
+        } catch (SAXException e) {
+            String msg = "Error parsing authenticator configurations.";
+
+            log.error(msg, e);
+            throw new ServletException(msg, e);
+        } finally {
+            try {
+                configurationFileStream.close();
+            } catch (IOException e) {
+                log.error("Error closing authenticator file stream.", e);
+            }
+        }
+
+        this.authenticatorList = authenticatorConfigurationReader.getAuthenticatorList();
+
+        if (this.authenticatorList.isEmpty()) {
+            String msg = "No authenticators registered in the system. System cannot function without authenticators";
+            log.error(msg);
+            throw new ServletException(msg);
+        }
+
+    }
+
+    @Override
+    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+
+        // Firs check whether authenticators are disabled
+        if (! AuthenticatorConfigurationReader.isAuthenticationEnabled()) {
+
+            // Extract user id and gateway id
+            try {
+                servletRequestHelper.addIdentityInformationToSession((HttpServletRequest) servletRequest);
+            } catch (AuthenticationException e) {
+                log.warn("Error adding identity information to session.", e);
+                populateUnauthorisedData(servletResponse, "Error adding identity information to session.");
+
+            }
+
+            filterChain.doFilter(servletRequest, servletResponse);
+            return;
+        }
+
+        HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
+
+        Authenticator authenticator = getAuthenticator(httpServletRequest);
+
+        if (authenticator == null) {
+            //sendUnauthorisedError(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
+            populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
+        } else {
+            if (authenticator.isAuthenticated(httpServletRequest)) {
+                // Allow request to flow
+                filterChain.doFilter(servletRequest, servletResponse);
+            } else {
+                try {
+                    if (!authenticator.authenticate(httpServletRequest)) {
+                        //sendUnauthorisedError(servletResponse, "Unauthorised : Provided credentials are not valid.");
+                        populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
+                    } else {
+                        // Allow request to flow
+                        filterChain.doFilter(servletRequest, servletResponse);
+                    }
+                } catch (AuthenticationException e) {
+                    String msg = "An error occurred while authenticating request.";
+                    log.error(msg, e);
+                    //sendUnauthorisedError(servletResponse, e.getMessage());
+                    populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
+                }
+            }
+        }
+    }
+
+    public static void sendUnauthorisedError(ServletResponse servletResponse, String message) throws IOException {
+        HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
+        httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, message);
+    }
+
+    @Override
+    public void destroy() {
+
+        this.authenticatorList = null;
+    }
+
+    private Authenticator getAuthenticator(HttpServletRequest httpServletRequest) {
+
+        for (Authenticator authenticator : authenticatorList) {
+            if (authenticator.canProcess(httpServletRequest)) {
+                return authenticator;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * This method will create a 401 unauthorized response to be sent.
+     *
+     * @param servletResponse The HTTP response.
+     */
+    public static void populateUnauthorisedData(ServletResponse servletResponse, String message) {
+
+        HttpServletResponse httpServletResponse = (HttpServletResponse)servletResponse;
+
+        httpServletResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
+        httpServletResponse.addHeader("Server", "Airavata Server");
+        httpServletResponse.addHeader("Description", message);
+        httpServletResponse.addDateHeader("Date", Calendar.getInstance().getTimeInMillis());
+        httpServletResponse.addHeader("WWW-Authenticate", "Basic realm=Airavata");
+        httpServletResponse.setContentType("text/html");
+
+    }
+}