airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: registry startup while airavata server starts
Date Wed, 26 Feb 2014 18:33:26 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 82be00b22 -> 548c2ebf8


registry startup while airavata server starts


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

Branch: refs/heads/master
Commit: 548c2ebf8b468ea668c4b7cc8f30f30737fe8274
Parents: 82be00b
Author: sgg <sgg@sgg-OptiPlex-990>
Authored: Wed Feb 26 13:33:05 2014 -0500
Committer: sgg <sgg@sgg-OptiPlex-990>
Committed: Wed Feb 26 13:33:05 2014 -0500

----------------------------------------------------------------------
 .../airavata/api/server/AiravataServer.java     |   2 +
 .../api/server/util/DatabaseCreator.java        |   4 +-
 .../api/server/util/RegistryInitUtil.java       |  22 +-
 .../main/resources/airavata-registry-derby.sql  | 325 ----------------
 .../main/resources/airavata-registry-mysql.sql  | 327 ----------------
 .../src/main/resources/registry-derby.sql       | 380 ++++++++++++++++++
 .../src/main/resources/registry-mysql.sql       | 384 +++++++++++++++++++
 .../persistance/registry/jpa/ResourceUtils.java |  11 +
 modules/registry/pom.xml                        |   2 +-
 9 files changed, 790 insertions(+), 667 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataServer.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataServer.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataServer.java
index 7833ebb..4b30ae3 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataServer.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataServer.java
@@ -26,6 +26,7 @@ import org.apache.airavata.api.error.AiravataErrorType;
 import org.apache.airavata.api.error.AiravataSystemException;
 import org.apache.airavata.api.server.handler.AiravataServerHandler;
 import org.apache.airavata.api.server.util.RegistryInitUtil;
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.thrift.server.TServer;
 import org.apache.thrift.server.TSimpleServer;
 import org.apache.thrift.transport.TServerSocket;
@@ -44,6 +45,7 @@ public class AiravataServer {
 
     public static void StartAiravataServer(Airavata.Processor<AiravataServerHandler> mockAiravataServer) throws AiravataSystemException {
         try {
+            AiravataUtils.setExecutionAsServer();
             RegistryInitUtil.initializeDB();
             TServerTransport serverTransport = new TServerSocket(THRIFT_SERVER_PORT);
             TServer server = new TSimpleServer(

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/DatabaseCreator.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/DatabaseCreator.java
index 4666b5a..f716c1d 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/DatabaseCreator.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/DatabaseCreator.java
@@ -59,7 +59,7 @@ public class DatabaseCreator {
      * @throws Exception
      */
     public static void createRegistryDatabase(Connection conn) throws Exception {
-        createDatabase("airavata-registry", conn);
+        createDatabase("registry", conn);
     }
 
 
@@ -223,7 +223,7 @@ public class DatabaseCreator {
     private static String getScriptLocation(String prefix, DatabaseType databaseType) {
         String scriptName = prefix + "-" + databaseType + ".sql";
         log.debug("Loading database script from :" + scriptName);
-        return "database_scripts" + File.separator + scriptName;
+        return  scriptName;
     }
 
     private static void createDatabase(String prefix, Connection conn) throws Exception {

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/RegistryInitUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/RegistryInitUtil.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/RegistryInitUtil.java
index dfcc2e2..5d45e3c 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/RegistryInitUtil.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/RegistryInitUtil.java
@@ -29,7 +29,9 @@ import java.sql.SQLException;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
 import org.apache.airavata.persistance.registry.jpa.resources.ProjectResource;
 import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
@@ -83,26 +85,22 @@ public class RegistryInitUtil {
                 logger.info("Database already created for Registry!");
             }
             try{
-                GatewayResource gatewayResource = new GatewayResource();
-                gatewayResource.setGatewayName(ServerSettings.getSystemUserGateway());
-                gatewayResource.setOwner(ServerSettings.getSystemUser());
-                gatewayResource.save();
-                UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
-                userResource.setUserName(ServerSettings.getSystemUser());
-                userResource.setPassword(ServerSettings.getSystemUserPassword());
-                userResource.save();
-                WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
-                workerResource.setUser(userResource.getUserName());
+                GatewayResource gateway = (GatewayResource)ResourceUtils.createGateway(ServerSettings.getSystemUserGateway());
+                gateway.save();
+                UserResource user = ResourceUtils.createUser(ServerSettings.getSystemUser(), ServerSettings.getSystemUserPassword());
+                user.save();
+                WorkerResource workerResource = (WorkerResource)gateway.create(ResourceType.GATEWAY_WORKER);
+                workerResource.setUser(user.getUserName());
                 workerResource.save();
                 ProjectResource projectResource = workerResource.createProject(DEFAULT_PROJECT_NAME);
-                projectResource.setGateway(gatewayResource);
+                projectResource.setGateway(gateway);
                 projectResource.save();
             } catch (ApplicationSettingsException e) {
                 logger.error("Unable to read airavata-server properties...", e.getMessage());
             }
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            throw new RuntimeException("Database failure");
+            throw new RuntimeException("Database failure", e);
         } finally {
             db.closeConnection(conn);
             try {

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/airavata-api/airavata-api-server/src/main/resources/airavata-registry-derby.sql
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/resources/airavata-registry-derby.sql b/airavata-api/airavata-api-server/src/main/resources/airavata-registry-derby.sql
deleted file mode 100644
index 04e25c0..0000000
--- a/airavata-api/airavata-api-server/src/main/resources/airavata-registry-derby.sql
+++ /dev/null
@@ -1,325 +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 GATEWAY
-(
-        GATEWAY_NAME VARCHAR(255),
-	      OWNER VARCHAR(255),
-        PRIMARY KEY (GATEWAY_NAME)
-);
-
-CREATE TABLE CONFIGURATION
-(
-        CONFIG_KEY VARCHAR(255),
-        CONFIG_VAL VARCHAR(255),
-        EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        CATEGORY_ID VARCHAR (255),
-        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');
-
-CREATE TABLE USERS
-(
-        USER_NAME VARCHAR(255),
-        PASSWORD VARCHAR(255),
-        PRIMARY KEY(USER_NAME)
-);
-
-CREATE TABLE GATEWAY_WORKER
-(
-        GATEWAY_NAME VARCHAR(255),
-        USER_NAME VARCHAR(255),
-        PRIMARY KEY (GATEWAY_NAME, USER_NAME),
-        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-        FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PROJECT
-(
-         GATEWAY_NAME VARCHAR(255),
-         USER_NAME VARCHAR(255),
-         PROJECT_NAME VARCHAR(255),
-         PRIMARY KEY (PROJECT_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PUBLISHED_WORKFLOW
-(
-         GATEWAY_NAME VARCHAR(255),
-         CREATED_USER VARCHAR(255),
-         PUBLISH_WORKFLOW_NAME VARCHAR(255),
-         VERSION VARCHAR(255),
-         PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-         PATH VARCHAR (255),
-         WORKFLOW_CONTENT BLOB,
-         PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE USER_WORKFLOW
-(
-         GATEWAY_NAME VARCHAR(255),
-         OWNER VARCHAR(255),
-         TEMPLATE_NAME VARCHAR(255),
-         LAST_UPDATED_TIME TIMESTAMP DEFAULT CURRENT TIMESTAMP,
-         PATH VARCHAR (255),
-         WORKFLOW_GRAPH BLOB,
-         PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE HOST_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         HOST_DESCRIPTOR_ID VARCHAR(255),
-         HOST_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME, HOST_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE SERVICE_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         SERVICE_DESCRIPTOR_ID VARCHAR(255),
-         SERVICE_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME,SERVICE_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE APPLICATION_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         APPLICATION_DESCRIPTOR_ID VARCHAR(255),
-         HOST_DESCRIPTOR_ID VARCHAR(255),
-         SERVICE_DESCRIPTOR_ID VARCHAR(255),
-         APPLICATION_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME,APPLICATION_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_METADATA
-(
-          EXPERIMENT_ID VARCHAR(255) NOT NULL,
-          EXPERIMENT_NAME VARCHAR(255) NOT NULL,
-          DESCRIPTION VARCHAR(255),
-          SUBMITTED_DATE TIMESTAMP DEFAULT CURRENT TIMESTAMP,
-          EXECUTION_USER VARCHAR(255),
-          GATEWAY_NAME VARCHAR(255),
-          PROJECT_NAME VARCHAR(255),
-          SHARE_EXPERIMENT SMALLINT,
-          PRIMARY KEY (EXPERIMENT_ID),
-          FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-          FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_SUMMARY
-(
-          EXPERIMENT_ID VARCHAR(255) NOT NULL,
-          STATUS VARCHAR(255),
-          LAST_UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-          PRIMARY KEY(EXPERIMENT_ID),
-          FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_CONFIGURATION_DATA
-(
-          EXPERIMENT_ID VARCHAR(255) NOT NULL,
-          APPLICATION_ID VARCHAR(255),
-          APPLICATION_VERSION VARCHAR(255),
-          WORKFLOW_TEMPLATE_ID VARCHAR(255),
-          WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
-          RESOURCE_HOST_ID VARCHAR (255),
-          TOTAL_CPU_COUNT INTEGER,
-          NODE_COUNT INTEGER,
-          NUMBER_OF_THREADS INTEGER,
-          QUEUE_NAME VARCHAR (255),
-          WALLTIME_LIMIT INTEGER,
-          JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-          TOTAL_PHYSICAL_MEMORY INTEGER,
-          COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
-          AIRAVATA_AUTO_SCHEDULE SMALLINT,
-          OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT,
-          WORKING_DIR_PARENT VARCHAR(255),
-          UNIQUE_WORKING_DIR VARCHAR(255),
-          STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
-          OUTPUT_DATA_DIR VARCHAR(255),
-          DATA_REG_URL VARCHAR (255),
-          PERSIST_OUTPUT_DATA SMALLINT,
-          CLEAN_AFTER_JOB SMALLINT,
-          START_EXECUTION_AT VARCHAR(255),
-          EXECUTE_BEFORE VARCHAR(255),
-          NUMBER_OF_RETRIES INTEGER,
-          EXPERIMENT_CONFIG_DATA BLOB,
-          PRIMARY KEY (EXPERIMENT_ID),
-          FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_INPUT
-(
-        EXPERIMENT_ID VARCHAR(255) NOT NULL,
-        EX_KEY VARCHAR (255) NOT NULL,
-        VALUE VARCHAR (255),
-        PRIMARY KEY (EXPERIMENT_ID, EX_KEY),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_OUTPUT
-(
-        EXPERIMENT_ID VARCHAR(255) NOT NULL,
-        EX_KEY VARCHAR (255) NOT NULL,
-        VALUE VARCHAR (255),
-        PRIMARY KEY (EXPERIMENT_ID, EX_KEY),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE WORKFLOW_DATA
-(
-       EXPERIMENT_ID VARCHAR(255),
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       TEMPLATE_NAME VARCHAR(255),
-       STATUS VARCHAR(255),
-       START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       LAST_UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-       PRIMARY KEY(WORKFLOW_INSTANCE_ID),
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE NODE_DATA
-(
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       NODE_TYPE VARCHAR(255),
-       INPUTS BLOB,
-       OUTPUTS BLOB,
-       STATUS VARCHAR(255),
-       START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       LAST_UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-       EXECUTION_INDEX INTEGER NOT NULL,
-       PRIMARY KEY(WORKFLOW_INSTANCE_ID, NODE_ID, EXECUTION_INDEX),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE
-);
-
--- need to remove this in future
-CREATE TABLE GRAM_DATA
-(
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       RSL BLOB,
-       INVOKED_HOST VARCHAR(255),
-       LOCAL_JOB_ID VARCHAR(255),
-       PRIMARY KEY(WORKFLOW_INSTANCE_ID, NODE_ID),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GFAC_JOB_DATA
-(
-       EXPERIMENT_ID VARCHAR(255),
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       APPLICATION_DESC_ID VARCHAR(255),
-       HOST_DESC_ID VARCHAR(255),
-       SERVICE_DESC_ID VARCHAR(255),
-       JOB_DATA CLOB,
-       LOCAL_JOB_ID VARCHAR(255) NOT NULL,
-       SUBMITTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       STATUS VARCHAR(255),
-       METADATA CLOB,
-       PRIMARY KEY(LOCAL_JOB_ID),
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID)
-);
-
-CREATE TABLE GFAC_JOB_STATUS
-(
-       LOCAL_JOB_ID VARCHAR(255) NOT NULL,
-       STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       STATUS VARCHAR(255),
-       FOREIGN KEY (LOCAL_JOB_ID) REFERENCES GFAC_JOB_DATA(LOCAL_JOB_ID)
-);
-
-
-CREATE TABLE COMMUNITY_USER
-(
-        GATEWAY_NAME VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
-        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-
-
-CREATE TABLE CREDENTIALS
-(
-        GATEWAY_ID VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        CREDENTIAL BLOB NOT NULL,
-        PORTAL_USER_ID VARCHAR(256) NOT NULL,
-        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
-);
-
-CREATE TABLE EXECUTION_ERROR
-(
-       ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-       EXPERIMENT_ID VARCHAR(255),
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       GFAC_JOB_ID VARCHAR(255),
-       SOURCE_TYPE VARCHAR(255),
-       ERROR_DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-       ERROR_MSG CLOB,
-       ERROR_DESC CLOB,
-       ERROR_CODE VARCHAR(255),
-       ERROR_REPORTER VARCHAR(255),
-       ERROR_LOCATION VARCHAR(255),
-       ACTION_TAKEN VARCHAR(255),
-       ERROR_REFERENCE INTEGER,
-       PRIMARY KEY(ERROR_ID),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE,
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ORCHESTRATOR
-(
-        EXPERIMENT_ID VARCHAR(255) NOT NULL,
-        USERNAME VARCHAR(255),
-        STATUS VARCHAR(255),
-        STATE VARCHAR(255),
-        GFAC_EPR VARCHAR(255),
-        APPLICATION_NAME VARCHAR(255),
-        JOBREQUEST CLOB,
-        SUBMITTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        PRIMARY KEY (EXPERIMENT_ID),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/airavata-api/airavata-api-server/src/main/resources/airavata-registry-mysql.sql
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/resources/airavata-registry-mysql.sql b/airavata-api/airavata-api-server/src/main/resources/airavata-registry-mysql.sql
deleted file mode 100644
index ac38407..0000000
--- a/airavata-api/airavata-api-server/src/main/resources/airavata-registry-mysql.sql
+++ /dev/null
@@ -1,327 +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 GATEWAY
-(
-        GATEWAY_NAME VARCHAR(255),
-	      OWNER VARCHAR(255),
-        PRIMARY KEY (GATEWAY_NAME)
-);
-
-
-CREATE TABLE CONFIGURATION
-(
-        CONFIG_KEY VARCHAR(255),
-        CONFIG_VAL VARCHAR(255),
-        EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        CATEGORY_ID VARCHAR (255),
-        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');
-
-CREATE TABLE USERS
-(
-        USER_NAME VARCHAR(255),
-        PASSWORD VARCHAR(255),
-        PRIMARY KEY(USER_NAME)
-);
-
-CREATE TABLE GATEWAY_WORKER
-(
-        GATEWAY_NAME VARCHAR(255),
-        USER_NAME VARCHAR(255),
-        PRIMARY KEY (GATEWAY_NAME, USER_NAME),
-        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-        FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PROJECT
-(
-         GATEWAY_NAME VARCHAR(255),
-         USER_NAME VARCHAR(255),
-         PROJECT_NAME VARCHAR(255),
-         PRIMARY KEY (PROJECT_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PUBLISHED_WORKFLOW
-(
-         GATEWAY_NAME VARCHAR(255),
-         CREATED_USER VARCHAR(255),
-         PUBLISH_WORKFLOW_NAME VARCHAR(255),
-         VERSION VARCHAR(255),
-         PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-         PATH VARCHAR (255),
-         WORKFLOW_CONTENT BLOB,
-         PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE USER_WORKFLOW
-(
-         GATEWAY_NAME VARCHAR(255),
-         OWNER VARCHAR(255),
-         TEMPLATE_NAME VARCHAR(255),
-         LAST_UPDATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
-         PATH VARCHAR (255),
-         WORKFLOW_GRAPH BLOB,
-         PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE HOST_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         HOST_DESCRIPTOR_ID VARCHAR(255),
-         HOST_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME, HOST_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE SERVICE_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         SERVICE_DESCRIPTOR_ID VARCHAR(255),
-         SERVICE_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME,SERVICE_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE APPLICATION_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         APPLICATION_DESCRIPTOR_ID VARCHAR(255),
-         HOST_DESCRIPTOR_ID VARCHAR(255),
-         SERVICE_DESCRIPTOR_ID VARCHAR(255),
-         APPLICATION_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME,APPLICATION_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_METADATA
-(
-          EXPERIMENT_ID VARCHAR(255) NOT NULL,
-          EXPERIMENT_NAME VARCHAR(255) NOT NULL,
-          DESCRIPTION VARCHAR(255),
-          SUBMITTED_DATE TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
-          EXECUTION_USER VARCHAR(255),
-          GATEWAY_NAME VARCHAR(255),
-          SHARE_EXPERIMENT SMALLINT,
-          PROJECT_NAME VARCHAR(255),
-          PRIMARY KEY (EXPERIMENT_ID),
-          FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-          FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
-          FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_SUMMARY
-(
-          EXPERIMENT_ID VARCHAR(255) NOT NULL,
-          STATUS VARCHAR(255),
-          LAST_UPDATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
-          PRIMARY KEY(EXPERIMENT_ID),
-          FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_CONFIGURATION_DATA
-(
-          EXPERIMENT_ID VARCHAR(255) NOT NULL,
-          APPLICATION_ID VARCHAR(255),
-          APPLICATION_VERSION VARCHAR(255),
-          WORKFLOW_TEMPLATE_ID VARCHAR(255),
-          WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
-          RESOURCE_HOST_ID VARCHAR (255),
-          TOTAL_CPU_COUNT INT(11),
-          NODE_COUNT INT(11),
-          NUMBER_OF_THREADS INT(11),
-          QUEUE_NAME VARCHAR (255),
-          WALLTIME_LIMIT INT(11),
-          JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-          TOTAL_PHYSICAL_MEMORY INT(11),
-          COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
-          AIRAVATA_AUTO_SCHEDULE SMALLINT,
-          OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT,
-          WORKING_DIR_PARENT VARCHAR(255),
-          UNIQUE_WORKING_DIR VARCHAR(255),
-          STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
-          OUTPUT_DATA_DIR VARCHAR(255),
-          DATA_REG_URL VARCHAR (255),
-          PERSIST_OUTPUT_DATA SMALLINT,
-          CLEAN_AFTER_JOB SMALLINT,
-          START_EXECUTION_AT VARCHAR(255),
-          EXECUTE_BEFORE VARCHAR(255),
-          NUMBER_OF_RETRIES INTEGER,
-          EXPERIMENT_CONFIG_DATA BLOB,
-          PRIMARY KEY (EXPERIMENT_ID),
-          FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_INPUT
-(
-        EXPERIMENT_ID VARCHAR(255) NOT NULL,
-        EX_KEY VARCHAR(255) NOT NULL,
-        VALUE VARCHAR(255),
-        PRIMARY KEY (EXPERIMENT_ID, EX_KEY),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_OUTPUT
-(
-        EXPERIMENT_ID VARCHAR(255) NOT NULL,
-        EX_KEY VARCHAR (255) NOT NULL,
-        VALUE VARCHAR (255),
-        PRIMARY KEY (EXPERIMENT_ID, EX_KEY),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE WORKFLOW_DATA
-(
-       EXPERIMENT_ID VARCHAR(255),
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       TEMPLATE_NAME VARCHAR(255),
-       STATUS VARCHAR(255),
-       START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       LAST_UPDATE_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
-       PRIMARY KEY(WORKFLOW_INSTANCE_ID),
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE NODE_DATA
-(
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       NODE_TYPE VARCHAR(255),
-       INPUTS BLOB,
-       OUTPUTS BLOB,
-       STATUS VARCHAR(255),
-       START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       LAST_UPDATE_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
-       EXECUTION_INDEX INT(11) NOT NULL,
-       PRIMARY KEY(WORKFLOW_INSTANCE_ID, NODE_ID, EXECUTION_INDEX),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE
-);
-
--- need to remove this in future
-CREATE TABLE GRAM_DATA
-(
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       RSL BLOB,
-       INVOKED_HOST VARCHAR(255),
-       LOCAL_JOB_ID VARCHAR(255),
-       PRIMARY KEY(WORKFLOW_INSTANCE_ID, NODE_ID),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GFAC_JOB_DATA
-(
-       EXPERIMENT_ID VARCHAR(255),
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       APPLICATION_DESC_ID VARCHAR(255),
-       HOST_DESC_ID VARCHAR(255),
-       SERVICE_DESC_ID VARCHAR(255),
-       JOB_DATA LONGTEXT,
-       LOCAL_JOB_ID VARCHAR(255) NOT NULL,
-       SUBMITTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       STATUS VARCHAR(255),
-       METADATA LONGTEXT,
-       PRIMARY KEY(LOCAL_JOB_ID),
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID)
-);
-
-CREATE TABLE GFAC_JOB_STATUS
-(
-       LOCAL_JOB_ID VARCHAR(255) NOT NULL,
-       STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-       STATUS VARCHAR(255),
-       FOREIGN KEY (LOCAL_JOB_ID) REFERENCES GFAC_JOB_DATA(LOCAL_JOB_ID)
-);
-
-
-CREATE TABLE COMMUNITY_USER
-(
-        GATEWAY_NAME VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
-        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-
-
-CREATE TABLE CREDENTIALS
-(
-        GATEWAY_ID VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        CREDENTIAL BLOB NOT NULL,
-        PORTAL_USER_ID VARCHAR(256) NOT NULL,
-        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
-);
-
-CREATE TABLE EXECUTION_ERROR
-(
-       ERROR_ID INT(11) NOT NULL AUTO_INCREMENT,
-       EXPERIMENT_ID VARCHAR(255),
-       WORKFLOW_INSTANCE_ID VARCHAR(255),
-       NODE_ID VARCHAR(255),
-       GFAC_JOB_ID VARCHAR(255),
-       SOURCE_TYPE VARCHAR(255),
-       ERROR_DATE TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
-       ERROR_MSG LONGTEXT,
-       ERROR_DESC LONGTEXT,
-       ERROR_CODE VARCHAR(255),
-       ERROR_REPORTER VARCHAR(255),
-       ERROR_LOCATION VARCHAR(255),
-       ACTION_TAKEN VARCHAR(255),
-       ERROR_REFERENCE INT,
-       PRIMARY KEY(ERROR_ID),
-       FOREIGN KEY (WORKFLOW_INSTANCE_ID) REFERENCES WORKFLOW_DATA(WORKFLOW_INSTANCE_ID) ON DELETE CASCADE,
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ORCHESTRATOR
-(
-        EXPERIMENT_ID VARCHAR(255) NOT NULL,
-        USERNAME VARCHAR(255),
-        STATUS VARCHAR(255),
-        STATE VARCHAR(255),
-        GFAC_EPR VARCHAR(255),
-        APPLICATION_NAME VARCHAR(255),
-        JOBREQUEST LONGTEXT,
-        SUBMITTED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        PRIMARY KEY (EXPERIMENT_ID),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT_METADATA(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql b/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql
new file mode 100644
index 0000000..7b8fb39
--- /dev/null
+++ b/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql
@@ -0,0 +1,380 @@
+/*
+ *
+ * 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 GATEWAY
+(
+        GATEWAY_NAME VARCHAR(255),
+	    OWNER VARCHAR(255),
+        PRIMARY KEY (GATEWAY_NAME)
+);
+
+CREATE TABLE CONFIGURATION
+(
+        CONFIG_KEY VARCHAR(255),
+        CONFIG_VAL VARCHAR(255),
+        EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        CATEGORY_ID VARCHAR (255),
+        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');
+
+CREATE TABLE USERS
+(
+        USER_NAME VARCHAR(255),
+        PASSWORD VARCHAR(255),
+        PRIMARY KEY(USER_NAME)
+);
+
+CREATE TABLE GATEWAY_WORKER
+(
+        GATEWAY_NAME VARCHAR(255),
+        USER_NAME VARCHAR(255),
+        PRIMARY KEY (GATEWAY_NAME, USER_NAME),
+        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+        FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PROJECT
+(
+         GATEWAY_NAME VARCHAR(255),
+         USER_NAME VARCHAR(255),
+         PROJECT_NAME VARCHAR(255),
+         PRIMARY KEY (PROJECT_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PUBLISHED_WORKFLOW
+(
+         GATEWAY_NAME VARCHAR(255),
+         CREATED_USER VARCHAR(255),
+         PUBLISH_WORKFLOW_NAME VARCHAR(255),
+         VERSION VARCHAR(255),
+         PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+         PATH VARCHAR (255),
+         WORKFLOW_CONTENT BLOB,
+         PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE USER_WORKFLOW
+(
+         GATEWAY_NAME VARCHAR(255),
+         OWNER VARCHAR(255),
+         TEMPLATE_NAME VARCHAR(255),
+         LAST_UPDATED_TIME TIMESTAMP DEFAULT CURRENT TIMESTAMP,
+         PATH VARCHAR (255),
+         WORKFLOW_GRAPH BLOB,
+         PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE HOST_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         HOST_DESCRIPTOR_ID VARCHAR(255),
+         HOST_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME, HOST_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE SERVICE_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         SERVICE_DESCRIPTOR_ID VARCHAR(255),
+         SERVICE_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME,SERVICE_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         APPLICATION_DESCRIPTOR_ID VARCHAR(255),
+         HOST_DESCRIPTOR_ID VARCHAR(255),
+         SERVICE_DESCRIPTOR_ID VARCHAR(255),
+         APPLICATION_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME,APPLICATION_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        GATEWAY_NAME VARCHAR(255),
+        EXECUTION_USER VARCHAR(255),
+        PROJECT_NAME VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        EXPERIMENT_NAME VARCHAR(255),
+        EXPERIMENT_DESCRIPTION VARCHAR(255),
+        APPLICATION_ID VARCHAR(255),
+        APPLICATION_VERSION VARCHAR(255),
+        WORKFLOW_TEMPLATE_ID VARCHAR(255),
+        WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
+        WORKFLOW_EXECUTION_ID VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID),
+        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+        FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_INPUT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        INPUT_KEY VARCHAR(255),
+        INPUT_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_OUTPUT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        OUTPUT_KEY VARCHAR(255),
+        OUTPUT_KEY_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+
+CREATE TABLE WORKFLOW_NODE_DETAIL
+(
+        EXPERIMENT_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        NODE_NAME VARCHAR(255),
+        PRIMARY KEY(NODE_INSTANCE_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE TASK_DETAIL
+(
+        TASK_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        APPLICATION_ID VARCHAR(255),
+        APPLICATION_VERSION VARCHAR(255),
+        PRIMARY KEY(TASK_ID),
+        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ERROR_DETAIL
+(
+         ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+         EXPERIMENT_ID VARCHAR(255),
+         TASK_ID VARCHAR(255),
+         NODE_INSTANCE_ID VARCHAR(255),
+         JOB_ID VARCHAR(255),
+         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+         ACTUAL_ERROR_MESSAGE CLOB,
+         USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
+         TRANSIENT_OR_PERSISTENT SMALLINT,
+         ERROR_CATEGORY VARCHAR(255),
+         CORRECTIVE_ACTION VARCHAR(255),
+         ACTIONABLE_GROUP VARCHAR(255),
+         PRIMARY KEY(ERROR_ID),
+         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+         FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+         FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_INPUT
+(
+        TASK_ID VARCHAR(255),
+        INPUT_KEY VARCHAR(255),
+        INPUT_KEY_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(TASK_ID,INPUT_KEY),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_OUTPUT
+(
+        TASK_ID VARCHAR(255),
+        OUTPUT_KEY VARCHAR(255),
+        OUTPUT_KEY_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(TASK_ID,OUTPUT_KEY),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_INPUT
+(
+       NODE_INSTANCE_ID VARCHAR(255),
+       INPUT_KEY VARCHAR(255),
+       INPUT_KEY_TYPE VARCHAR(255),
+       METADATA VARCHAR(255),
+       VALUE VARCHAR(255),
+       PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
+       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_OUTPUT
+(
+       NODE_INSTANCE_ID VARCHAR(255),
+       OUTPUT_KEY VARCHAR(255),
+       OUTPUT_KEY_TYPE VARCHAR(255),
+       METADATA VARCHAR(255),
+       VALUE VARCHAR(255),
+       PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
+       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE JOB_DETAIL
+(
+        JOB_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        JOB_DESCRIPTION VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
+        PRIMARY KEY (TASK_ID, JOB_ID),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE DATA_TRANSFER_DETAIL
+(
+        TRANSFER_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        TRANSFER_DESC VARCHAR(255),
+        PRIMARY KEY(TRANSFER_ID),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE STATUS
+(
+        STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        EXPERIMENT_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        TRANSFER_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        JOB_ID VARCHAR(255),
+        STATE VARCHAR(255),
+        STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        STATUS_TYPE VARCHAR(255),
+        PRIMARY KEY(STATUS_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE CONFIG_DATA
+(
+        EXPERIMENT_ID VARCHAR(255),
+        AIRAVATA_AUTO_SCHEDULE SMALLINT,
+        OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT,
+        SHARE_EXPERIMENT SMALLINT,
+        PRIMARY KEY(EXPERIMENT_ID)
+);
+
+CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
+(
+        RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        EXPERIMENT_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        RESOURCE_HOST_ID VARCHAR(255),
+        CPU_COUNT INTEGER,
+        NODE_COUNT INTEGER,
+        NO_OF_THREADS INTEGER,
+        QUEUE_NAME VARCHAR(255),
+        WALLTIME_LIMIT INTEGER,
+        JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        TOTAL_PHYSICAL_MEMORY INTEGER,
+        COMPUTATIONAL_PROJECT_ACCOUNT 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
+);
+
+CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
+(
+       INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+       EXPERIMENT_ID VARCHAR(255),
+       TASK_ID VARCHAR(255),
+       WORKING_DIR_PARENT VARCHAR(255),
+       UNIQUE_WORKING_DIR VARCHAR(255),
+       STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
+       CLEAN_AFTER_JOB SMALLINT,
+       PRIMARY KEY(INPUT_DATA_HANDLING_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
+(
+       OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+       EXPERIMENT_ID VARCHAR(255),
+       TASK_ID VARCHAR(255),
+       OUTPUT_DATA_DIR VARCHAR(255),
+       DATA_REG_URL VARCHAR (255),
+       PERSIST_OUTPUT_DATA SMALLINT,
+       PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE QOS_PARAM
+(
+        QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        EXPERIMENT_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        START_EXECUTION_AT VARCHAR(255),
+        EXECUTE_BEFORE VARCHAR(255),
+        NO_OF_RETRIES INTEGER,
+        PRIMARY KEY(QOS_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE COMMUNITY_USER
+(
+        GATEWAY_NAME VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
+);
+
+CREATE TABLE CREDENTIALS
+(
+        GATEWAY_ID VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        CREDENTIAL BLOB NOT NULL,
+        PORTAL_USER_ID VARCHAR(256) NOT NULL,
+        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+);
+
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql b/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql
new file mode 100644
index 0000000..1b2039c
--- /dev/null
+++ b/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql
@@ -0,0 +1,384 @@
+/*
+ *
+ * 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 GATEWAY
+(
+        GATEWAY_NAME VARCHAR(255),
+	    OWNER VARCHAR(255),
+        PRIMARY KEY (GATEWAY_NAME)
+);
+
+CREATE TABLE CONFIGURATION
+(
+        CONFIG_KEY VARCHAR(255),
+        CONFIG_VAL VARCHAR(255),
+        EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        CATEGORY_ID VARCHAR (255),
+        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');
+
+CREATE TABLE USERS
+(
+        USER_NAME VARCHAR(255),
+        PASSWORD VARCHAR(255),
+        PRIMARY KEY(USER_NAME)
+);
+
+CREATE TABLE GATEWAY_WORKER
+(
+        GATEWAY_NAME VARCHAR(255),
+        USER_NAME VARCHAR(255),
+        PRIMARY KEY (GATEWAY_NAME, USER_NAME),
+        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+        FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PROJECT
+(
+         GATEWAY_NAME VARCHAR(255),
+         USER_NAME VARCHAR(255),
+         PROJECT_NAME VARCHAR(255),
+         PRIMARY KEY (PROJECT_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PUBLISHED_WORKFLOW
+(
+         GATEWAY_NAME VARCHAR(255),
+         CREATED_USER VARCHAR(255),
+         PUBLISH_WORKFLOW_NAME VARCHAR(255),
+         VERSION VARCHAR(255),
+         PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+         PATH VARCHAR (255),
+         WORKFLOW_CONTENT BLOB,
+         PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE USER_WORKFLOW
+(
+         GATEWAY_NAME VARCHAR(255),
+         OWNER VARCHAR(255),
+         TEMPLATE_NAME VARCHAR(255),
+         LAST_UPDATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+         PATH VARCHAR (255),
+         WORKFLOW_GRAPH BLOB,
+         PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE HOST_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         HOST_DESCRIPTOR_ID VARCHAR(255),
+         HOST_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME, HOST_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE SERVICE_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         SERVICE_DESCRIPTOR_ID VARCHAR(255),
+         SERVICE_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME,SERVICE_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_DESCRIPTOR
+(
+         GATEWAY_NAME VARCHAR(255),
+         UPDATED_USER VARCHAR(255),
+         APPLICATION_DESCRIPTOR_ID VARCHAR(255),
+         HOST_DESCRIPTOR_ID VARCHAR(255),
+         SERVICE_DESCRIPTOR_ID VARCHAR(255),
+         APPLICATION_DESCRIPTOR_XML BLOB,
+         PRIMARY KEY(GATEWAY_NAME,APPLICATION_DESCRIPTOR_ID),
+         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        GATEWAY_NAME VARCHAR(255),
+        EXECUTION_USER VARCHAR(255),
+        PROJECT_NAME VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT NOW(),
+        EXPERIMENT_NAME VARCHAR(255),
+        EXPERIMENT_DESCRIPTION VARCHAR(255),
+        APPLICATION_ID VARCHAR(255),
+        APPLICATION_VERSION VARCHAR(255),
+        WORKFLOW_TEMPLATE_ID VARCHAR(255),
+        WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
+        WORKFLOW_EXECUTION_ID VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID),
+        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+        FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(EXECUTION_USER) ON DELETE CASCADE,
+        FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_INPUT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        INPUT_KEY VARCHAR(255),
+        INPUT_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_OUTPUT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        OUTPUT_KEY VARCHAR(255),
+        OUTPUT_KEY_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE WORKFLOW_NODE_DETAIL
+(
+        EXPERIMENT_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT NOW(),
+        NODE_NAME VARCHAR(255),
+        PRIMARY KEY(NODE_INSTANCE_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE TASK_DETAIL
+(
+        TASK_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT NOW(),
+        APPLICATION_ID VARCHAR(255),
+        APPLICATION_VERSION VARCHAR(255),
+        PRIMARY KEY(TASK_ID),
+        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+
+
+CREATE TABLE APPLICATION_INPUT
+(
+        TASK_ID VARCHAR(255),
+        INPUT_KEY VARCHAR(255),
+        INPUT_KEY_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(TASK_ID,INPUT_KEY),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_OUTPUT
+(
+        TASK_ID VARCHAR(255),
+        OUTPUT_KEY VARCHAR(255),
+        OUTPUT_KEY_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        VALUE VARCHAR(255),
+        PRIMARY KEY(TASK_ID,OUTPUT_KEY),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_INPUT
+(
+       NODE_INSTANCE_ID VARCHAR(255),
+       INPUT_KEY VARCHAR(255),
+       INPUT_KEY_TYPE VARCHAR(255),
+       METADATA VARCHAR(255),
+       VALUE VARCHAR(255),
+       PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
+       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_OUTPUT
+(
+       NODE_INSTANCE_ID VARCHAR(255),
+       OUTPUT_KEY VARCHAR(255),
+       OUTPUT_KEY_TYPE VARCHAR(255),
+       METADATA VARCHAR(255),
+       VALUE VARCHAR(255),
+       PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
+       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE JOB_DETAIL
+(
+        JOB_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        JOB_DESCRIPTION VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT NOW(),
+        COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
+        PRIMARY KEY (TASK_ID, JOB_ID),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE DATA_TRANSFER_DETAIL
+(
+        TRANSFER_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT NOW(),
+        TRANSFER_DESC VARCHAR(255),
+        PRIMARY KEY(TRANSFER_ID),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ERROR_DETAIL
+(
+         ERROR_ID INTEGER NOT NULL AUTO_INCREMENT,
+         EXPERIMENT_ID VARCHAR(255),
+         TASK_ID VARCHAR(255),
+         NODE_INSTANCE_ID VARCHAR(255),
+         JOB_ID VARCHAR(255),
+         CREATION_TIME TIMESTAMP DEFAULT NOW(),
+         ACTUAL_ERROR_MESSAGE LONGTEXT,
+         USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
+         TRANSIENT_OR_PERSISTENT SMALLINT,
+         ERROR_CATEGORY VARCHAR(255),
+         CORRECTIVE_ACTION VARCHAR(255),
+         ACTIONABLE_GROUP VARCHAR(255),
+         PRIMARY KEY(ERROR_ID),
+         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+         FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+         FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE STATUS
+(
+        STATUS_ID INTEGER NOT NULL AUTO_INCREMENT,
+        EXPERIMENT_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        TRANSFER_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        JOB_ID VARCHAR(255),
+        STATE VARCHAR(255),
+        STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        STATUS_TYPE VARCHAR(255),
+        PRIMARY KEY(STATUS_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE CONFIG_DATA
+(
+        EXPERIMENT_ID VARCHAR(255),
+        AIRAVATA_AUTO_SCHEDULE SMALLINT,
+        OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT,
+        SHARE_EXPERIMENT SMALLINT,
+        PRIMARY KEY(EXPERIMENT_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+
+);
+
+CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
+(
+        RESOURCE_SCHEDULING_ID INTEGER NOT NULL AUTO_INCREMENT,
+        EXPERIMENT_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        RESOURCE_HOST_ID VARCHAR(255),
+        CPU_COUNT INTEGER,
+        NODE_COUNT INTEGER,
+        NO_OF_THREADS INTEGER,
+        QUEUE_NAME VARCHAR(255),
+        WALLTIME_LIMIT INTEGER,
+        JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        TOTAL_PHYSICAL_MEMORY INTEGER,
+        COMPUTATIONAL_PROJECT_ACCOUNT 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
+);
+
+CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
+(
+       INPUT_DATA_HANDLING_ID INTEGER NOT NULL AUTO_INCREMENT,
+       EXPERIMENT_ID VARCHAR(255),
+       TASK_ID VARCHAR(255),
+       WORKING_DIR_PARENT VARCHAR(255),
+       UNIQUE_WORKING_DIR VARCHAR(255),
+       STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
+       CLEAN_AFTER_JOB SMALLINT,
+       PRIMARY KEY(INPUT_DATA_HANDLING_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
+(
+       OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL AUTO_INCREMENT,
+       EXPERIMENT_ID VARCHAR(255),
+       TASK_ID VARCHAR(255),
+       OUTPUT_DATA_DIR VARCHAR(255),
+       DATA_REG_URL VARCHAR (255),
+       PERSIST_OUTPUT_DATA SMALLINT,
+       PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE QOS_PARAM
+(
+        QOS_ID INTEGER NOT NULL AUTO_INCREMENT,
+        EXPERIMENT_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        START_EXECUTION_AT VARCHAR(255),
+        EXECUTE_BEFORE VARCHAR(255),
+        NO_OF_RETRIES INTEGER,
+        PRIMARY KEY(QOS_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE COMMUNITY_USER
+(
+        GATEWAY_NAME VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
+);
+
+CREATE TABLE CREDENTIALS
+(
+        GATEWAY_ID VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        CREDENTIAL BLOB NOT NULL,
+        PORTAL_USER_ID VARCHAR(256) NOT NULL,
+        TIME_PERSISTED TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+);
+
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
index 18a7e90..4c4dd20 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
@@ -91,6 +91,17 @@ public class ResourceUtils {
 
     }
 
+    public static UserResource createUser(String username, String password){
+        if (!isUserExist(username)) {
+            UserResource userResource = new UserResource();
+            userResource.setUserName(username);
+            userResource.setPassword(password);
+            return userResource;
+        }
+        return null;
+
+    }
+
     public static Resource getGateway(String gatewayName){
         if (isGatewayExist(gatewayName)) {
             EntityManager em = getEntityManager();

http://git-wip-us.apache.org/repos/asf/airavata/blob/548c2ebf/modules/registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/pom.xml b/modules/registry/pom.xml
index 8063890..6c52e41 100644
--- a/modules/registry/pom.xml
+++ b/modules/registry/pom.xml
@@ -34,7 +34,7 @@
                 <module>registry-cpi</module>
                 <module>airavata-jpa-registry</module>
                 <module>airavata-registry-service</module>
-                <module>airavata-registry-test</module>
+                <!--<module>airavata-registry-test</module>-->
             </modules>
         </profile>
     </profiles>


Mime
View raw message